diff --git a/SparkleShare/Mac/SparkleShare/SparkleMacController.cs b/SparkleShare/Mac/SparkleShare/SparkleMacController.cs index 8055dee1..d08692a6 100644 --- a/SparkleShare/Mac/SparkleShare/SparkleMacController.cs +++ b/SparkleShare/Mac/SparkleShare/SparkleMacController.cs @@ -63,16 +63,6 @@ namespace SparkleShare { Directory.CreateDirectory (SparklePaths.SparklePath); - - string folder_icon_path = Path.Combine (NSBundle.MainBundle.ResourcePath, - "Pixmaps", "sparkleshare-folder.icns"); - - NSImage folder_icon = new NSImage (folder_icon_path); - - NSWorkspace.SharedWorkspace.SetIconforFile (folder_icon, - SparklePaths.SparklePath, 0); - - return true; } else { diff --git a/SparkleShare/Mac/SparkleShare/SparkleStatusIcon.cs b/SparkleShare/Mac/SparkleShare/SparkleStatusIcon.cs index 4b0a115f..df6d7069 100644 --- a/SparkleShare/Mac/SparkleShare/SparkleStatusIcon.cs +++ b/SparkleShare/Mac/SparkleShare/SparkleStatusIcon.cs @@ -16,6 +16,7 @@ using System; using System.Drawing; +using System.IO; using System.Timers; using MonoMac.Foundation; using MonoMac.AppKit; @@ -69,7 +70,12 @@ namespace SparkleShare { SparkleShare.Controller.FolderSizeChanged += delegate { InvokeOnMainThread (delegate { + + if (!Animation.Enabled) + SetNormalState (); + UpdateMenu (); + }); }; @@ -160,8 +166,12 @@ namespace SparkleShare { FolderMenuItem.Activated += delegate { SparkleShare.Controller.OpenSparkleShareFolder (); }; + - FolderMenuItem.Image = new NSImage (NSBundle.MainBundle.ResourcePath + "/Pixmaps/sparkleshare-mac-16.png"); + string folder_icon_path = Path.Combine (NSBundle.MainBundle.ResourcePath, + "sparkleshare.icns"); + + FolderMenuItem.Image = new NSImage (folder_icon_path); FolderMenuItem.Image.Size = new SizeF (16, 16); Menu.AddItem (FolderMenuItem); diff --git a/SparkleShare/Mac/SparkleShare/SparkleUI.cs b/SparkleShare/Mac/SparkleShare/SparkleUI.cs index 75361de2..5022e832 100644 --- a/SparkleShare/Mac/SparkleShare/SparkleUI.cs +++ b/SparkleShare/Mac/SparkleShare/SparkleUI.cs @@ -44,7 +44,8 @@ namespace SparkleShare { { NSApplication.Init (); - + + SetSparkleIcon (); // TODO: Getting crashes when I remove this NSApplication.SharedApplication.ApplicationIconImage @@ -92,7 +93,21 @@ namespace SparkleShare { }); }; + + } + + + public void SetSparkleIcon () + { + + string folder_icon_path = Path.Combine (NSBundle.MainBundle.ResourcePath, + "sparkleshare.icns"); + NSImage folder_icon = new NSImage (folder_icon_path); + + NSWorkspace.SharedWorkspace.SetIconforFile (folder_icon, + SparkleShare.Controller.SparklePath, 0); + } diff --git a/SparkleShare/SparkleController.cs b/SparkleShare/SparkleController.cs index cb58ce6a..eff4d546 100644 --- a/SparkleShare/SparkleController.cs +++ b/SparkleShare/SparkleController.cs @@ -36,6 +36,8 @@ namespace SparkleShare { public List Repositories; public string FolderSize; public bool FirstRun; + + public readonly string SparklePath; public event OnQuitWhileSyncingEventHandler OnQuitWhileSyncing; @@ -86,7 +88,9 @@ namespace SparkleShare { AddToBookmarks (); FolderSize = GetFolderSize (); - + + + SparklePath = SparklePaths.SparklePath; string global_config_file_path = SparkleHelpers.CombineMore (SparklePaths.SparkleConfigPath, "config"); @@ -555,6 +559,12 @@ namespace SparkleShare { if (FolderListChanged != null) FolderListChanged (); + + FolderSize = GetFolderSize (); + + if (FolderSizeChanged != null) + FolderSizeChanged (FolderSize); + } @@ -584,6 +594,12 @@ namespace SparkleShare { if (FolderListChanged != null) FolderListChanged (); + + FolderSize = GetFolderSize (); + + if (FolderSizeChanged != null) + FolderSizeChanged (FolderSize); + }