statusicon: add progress reporting on linux

This commit is contained in:
Hylke Bons 2012-01-21 22:41:07 +00:00
parent f428120a22
commit ac7495f9b8
2 changed files with 18 additions and 15 deletions

View file

@ -70,8 +70,8 @@ namespace SparkleShare {
{ {
using (var a = new NSAutoreleasePool ()) using (var a = new NSAutoreleasePool ())
{ {
ErrorImage = new NSImage (NSBundle.MainBundle.ResourcePath + "/Pixmaps/error.png"); ErrorImage = new NSImage (NSBundle.MainBundle.ResourcePath + "/Pixmaps/sparkleshare-syncing-error-mac.png");
ErrorImageActive = new NSImage (NSBundle.MainBundle.ResourcePath + "/Pixmaps/error-active.png"); ErrorImageActive = new NSImage (NSBundle.MainBundle.ResourcePath + "/Pixmaps/sparkleshare-syncing-error-mac-active.png");
FolderImage = NSImage.ImageNamed ("NSFolder"); FolderImage = NSImage.ImageNamed ("NSFolder");
CautionImage = NSImage.ImageNamed ("NSCaution"); CautionImage = NSImage.ImageNamed ("NSCaution");
SparkleShareImage = NSImage.ImageNamed ("sparkleshare-mac"); SparkleShareImage = NSImage.ImageNamed ("sparkleshare-mac");
@ -111,9 +111,9 @@ namespace SparkleShare {
case IconState.Syncing: case IconState.Syncing:
StateText = _("Syncing… " + StateText = _("Syncing… ") +
Controller.ProgressPercentage + "% " + Controller.ProgressPercentage + "% " +
Controller.ProgressSpeed); Controller.ProgressSpeed;
StateMenuItem.Title = StateText; StateMenuItem.Title = StateText;
@ -342,19 +342,19 @@ namespace SparkleShare {
FrameNumber = 0; FrameNumber = 0;
AnimationFrames = new NSImage [] { AnimationFrames = new NSImage [] {
new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "idle0.png")), new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-sparkleshare-mac-i.png")),
new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "idle1.png")), new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-sparkleshare-mac-ii.png")),
new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "idle2.png")), new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-sparkleshare-mac-iii.png")),
new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "idle3.png")), new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-sparkleshare-mac-iiii.png")),
new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "idle4.png")) new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-sparkleshare-mac-iiiii.png"))
}; };
AnimationFramesActive = new NSImage [] { AnimationFramesActive = new NSImage [] {
new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "idle0-active.png")), new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-sparkleshare-mac-i-active.png")),
new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "idle1-active.png")), new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-sparkleshare-mac-ii-active.png")),
new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "idle2-active.png")), new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-sparkleshare-mac-iii-active.png")),
new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "idle3-active.png")), new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-sparkleshare-mac-iiii-active.png")),
new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "idle4-active.png")) new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-sparkleshare-mac-iiiii-active.png"))
}; };
Timer Animation = new Timer () { Timer Animation = new Timer () {

View file

@ -103,7 +103,10 @@ namespace SparkleShare {
case IconState.Syncing: case IconState.Syncing:
StateText = _("Syncing…"); StateText = _("Syncing… ") +
Controller.ProgressPercentage + "% " +
Controller.ProgressSpeed;
UpdateStateText (); UpdateStateText ();
if (!Animation.Enabled) if (!Animation.Enabled)