From ac7495f9b8ab27a9bc9ae64d727423f333cb02d4 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sat, 21 Jan 2012 22:41:07 +0000 Subject: [PATCH] statusicon: add progress reporting on linux --- SparkleShare/Mac/SparkleStatusIcon.cs | 28 +++++++++++++-------------- SparkleShare/SparkleStatusIcon.cs | 5 ++++- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/SparkleShare/Mac/SparkleStatusIcon.cs b/SparkleShare/Mac/SparkleStatusIcon.cs index f0e75ef0..55d45537 100755 --- a/SparkleShare/Mac/SparkleStatusIcon.cs +++ b/SparkleShare/Mac/SparkleStatusIcon.cs @@ -70,8 +70,8 @@ namespace SparkleShare { { using (var a = new NSAutoreleasePool ()) { - ErrorImage = new NSImage (NSBundle.MainBundle.ResourcePath + "/Pixmaps/error.png"); - ErrorImageActive = new NSImage (NSBundle.MainBundle.ResourcePath + "/Pixmaps/error-active.png"); + ErrorImage = new NSImage (NSBundle.MainBundle.ResourcePath + "/Pixmaps/sparkleshare-syncing-error-mac.png"); + ErrorImageActive = new NSImage (NSBundle.MainBundle.ResourcePath + "/Pixmaps/sparkleshare-syncing-error-mac-active.png"); FolderImage = NSImage.ImageNamed ("NSFolder"); CautionImage = NSImage.ImageNamed ("NSCaution"); SparkleShareImage = NSImage.ImageNamed ("sparkleshare-mac"); @@ -111,9 +111,9 @@ namespace SparkleShare { case IconState.Syncing: - StateText = _("Syncing… " + + StateText = _("Syncing… ") + Controller.ProgressPercentage + "% " + - Controller.ProgressSpeed); + Controller.ProgressSpeed; StateMenuItem.Title = StateText; @@ -342,19 +342,19 @@ namespace SparkleShare { FrameNumber = 0; AnimationFrames = new NSImage [] { - new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "idle0.png")), - new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "idle1.png")), - new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "idle2.png")), - new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "idle3.png")), - new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "idle4.png")) + new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-sparkleshare-mac-i.png")), + new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-sparkleshare-mac-ii.png")), + new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-sparkleshare-mac-iii.png")), + new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-sparkleshare-mac-iiii.png")), + new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-sparkleshare-mac-iiiii.png")) }; AnimationFramesActive = new NSImage [] { - new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "idle0-active.png")), - new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "idle1-active.png")), - new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "idle2-active.png")), - new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "idle3-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-i-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", "process-syncing-sparkleshare-mac-iii-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", "process-syncing-sparkleshare-mac-iiiii-active.png")) }; Timer Animation = new Timer () { diff --git a/SparkleShare/SparkleStatusIcon.cs b/SparkleShare/SparkleStatusIcon.cs index 4d70a5b2..86d36f84 100755 --- a/SparkleShare/SparkleStatusIcon.cs +++ b/SparkleShare/SparkleStatusIcon.cs @@ -103,7 +103,10 @@ namespace SparkleShare { case IconState.Syncing: - StateText = _("Syncing…"); + StateText = _("Syncing… ") + + Controller.ProgressPercentage + "% " + + Controller.ProgressSpeed; + UpdateStateText (); if (!Animation.Enabled)