diff --git a/SparkleLib/Git/SparkleRepoGit.cs b/SparkleLib/Git/SparkleRepoGit.cs index bcc4a14d..66aed8b0 100644 --- a/SparkleLib/Git/SparkleRepoGit.cs +++ b/SparkleLib/Git/SparkleRepoGit.cs @@ -603,7 +603,7 @@ namespace SparkleLib.Git { SparkleLogger.LogInfo ("Git", Name + " | Restoring \"" + path + "\" (revision " + revision + ")"); - // FIXME: git-show doesn't decrypt objects, so we can't use it to retrieve + // git-show doesn't decrypt objects, so we can't use it to retrieve // files from the index. This is a suboptimal workaround but it does the job if (this.is_encrypted) { // Restore the older file... diff --git a/SparkleShare/Mac/SparkleStatusIcon.cs b/SparkleShare/Mac/SparkleStatusIcon.cs index ae7167c8..71034a29 100755 --- a/SparkleShare/Mac/SparkleStatusIcon.cs +++ b/SparkleShare/Mac/SparkleStatusIcon.cs @@ -96,6 +96,9 @@ namespace SparkleShare { }; Controller.UpdateMenuEvent += delegate { + while ((this.menu.Delegate as SparkleMenuDelegate).MenuIsOpen) + System.Threading.Thread.Sleep (100); + Program.Controller.Invoke (() => CreateMenu ()); }; @@ -205,7 +208,35 @@ namespace SparkleShare { this.menu.AddItem (NSMenuItem.SeparatorItem); this.menu.AddItem (this.quit_item); + this.menu.Delegate = new SparkleMenuDelegate (); this.status_item.Menu = this.menu; } + + + private class SparkleMenuDelegate : NSMenuDelegate { + + public SparkleMenuDelegate (IntPtr handle) : base (handle) { } + public SparkleMenuDelegate () { } + + public bool MenuIsOpen { get; private set; } + + + public override void MenuWillHighlightItem (NSMenu menu, NSMenuItem item) + { + } + + + public override void MenuWillOpen (NSMenu menu) + { + MenuIsOpen = true; + } + + + public override void MenuDidClose (NSMenu menu) + { + MenuIsOpen = false; + } + } + } } diff --git a/SparkleShare/SparkleStatusIconController.cs b/SparkleShare/SparkleStatusIconController.cs index 8729be70..453ab5b0 100755 --- a/SparkleShare/SparkleStatusIconController.cs +++ b/SparkleShare/SparkleStatusIconController.cs @@ -48,8 +48,8 @@ namespace SparkleShare { public IconState CurrentState = IconState.Idle; public string StateText = "Welcome to SparkleShare!"; - public string [] Folders; - public string [] FolderErrors; + public string [] Folders = new string [0]; + public string [] FolderErrors = new string [0]; public string FolderSize { @@ -95,7 +95,7 @@ namespace SparkleShare { public bool RecentEventsItemEnabled { get { - return (Program.Controller.Folders.Count > 0); + return (Folders.Length > 0); } } @@ -114,7 +114,7 @@ namespace SparkleShare { if (CurrentState != IconState.Error) { CurrentState = IconState.Idle; - if (Program.Controller.Folders.Count == 0) + if (Folders.Length == 0) StateText = "Welcome to SparkleShare!"; else StateText = "Projects up to date " + FolderSize; @@ -132,7 +132,7 @@ namespace SparkleShare { if (CurrentState != IconState.Error) { CurrentState = IconState.Idle; - if (Program.Controller.Folders.Count == 0) + if (Folders.Length == 0) StateText = "Welcome to SparkleShare!"; else StateText = "Projects up to date " + FolderSize;