From ef9ea54bbcac846759bad13e91741974d8fc69fb Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Mon, 14 Mar 2011 00:13:20 +0000 Subject: [PATCH] synchronise linux and mac event hookups --- SparkleShare/Mac/SparkleUI.cs | 1 + SparkleShare/SparkleStatusIcon.cs | 5 +++++ SparkleShare/SparkleUI.cs | 36 +++++++++++++++++++++++++++---- 3 files changed, 38 insertions(+), 4 deletions(-) diff --git a/SparkleShare/Mac/SparkleUI.cs b/SparkleShare/Mac/SparkleUI.cs index 62cbe943..35f284cb 100644 --- a/SparkleShare/Mac/SparkleUI.cs +++ b/SparkleShare/Mac/SparkleUI.cs @@ -122,6 +122,7 @@ namespace SparkleShare { }; + SparkleShare.Controller.OnIdle += delegate { InvokeOnMainThread (delegate { diff --git a/SparkleShare/SparkleStatusIcon.cs b/SparkleShare/SparkleStatusIcon.cs index 462c02ff..02cee041 100644 --- a/SparkleShare/SparkleStatusIcon.cs +++ b/SparkleShare/SparkleStatusIcon.cs @@ -54,7 +54,12 @@ namespace SparkleShare { SparkleShare.Controller.FolderSizeChanged += delegate { Application.Invoke (delegate { + + if (!Animation.Enabled) + SetNormalState (); + UpdateMenu (); + }); }; diff --git a/SparkleShare/SparkleUI.cs b/SparkleShare/SparkleUI.cs index ab4d9d39..e9fbb897 100644 --- a/SparkleShare/SparkleUI.cs +++ b/SparkleShare/SparkleUI.cs @@ -80,6 +80,13 @@ namespace SparkleShare { // Show a bubble when there are new changes SparkleShare.Controller.NotificationRaised += delegate (SparkleCommit commit, string repository_path) { + foreach (SparkleLog log in OpenLogs) + if (log.LocalPath.Equals (repository_path)) + log.UpdateEventLog (); + + if (!SparkleShare.Controller.NotificationsEnabled) + return; + string file_name = ""; string message = null; @@ -134,10 +141,6 @@ namespace SparkleShare { bubble.Icon = new Gdk.Pixbuf (avatar_file_path); else bubble.Icon = SparkleUIHelpers.GetIcon ("avatar-default", 32); - - foreach (SparkleLog log in OpenLogs) - if (log.LocalPath.Equals (repository_path)) - log.UpdateEventLog (); bubble.AddAction ("", "Show Events", delegate { @@ -152,6 +155,7 @@ namespace SparkleShare { }; + // Show a bubble when there was a conflict SparkleShare.Controller.ConflictNotificationRaised += delegate { Application.Invoke (delegate { @@ -164,6 +168,30 @@ namespace SparkleShare { }); }; + + SparkleShare.Controller.AvatarFetched += delegate { + + Application.Invoke (delegate { + + foreach (SparkleLog log in OpenLogs) + log.UpdateEventLog (); + + }); + + }; + + + SparkleShare.Controller.OnIdle += delegate { + + Application.Invoke (delegate { + + foreach (SparkleLog log in OpenLogs) + log.UpdateEventLog (); + + }); + + }; + }