From f2832690e042f5aabca07d077ddaf3ba3558e2bd Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sun, 13 Mar 2011 17:45:23 +0000 Subject: [PATCH] [osx] Fix logs not being updated when notifications are turned off --- SparkleShare/Mac/SparkleUI.cs | 29 ++++++++++++++++------------- SparkleShare/SparkleController.cs | 2 +- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/SparkleShare/Mac/SparkleUI.cs b/SparkleShare/Mac/SparkleUI.cs index b31de156..62cbe943 100644 --- a/SparkleShare/Mac/SparkleUI.cs +++ b/SparkleShare/Mac/SparkleUI.cs @@ -55,7 +55,6 @@ namespace SparkleShare { public static SparkleIntro Intro; public static NSFont Font; - private SparkleAbout About; private NSAlert Alert; @@ -91,18 +90,22 @@ namespace SparkleShare { InvokeOnMainThread (delegate { - if (NSApplication.SharedApplication.DockTile.BadgeLabel == null) - NSApplication.SharedApplication.DockTile.BadgeLabel = "1"; - else - NSApplication.SharedApplication.DockTile.BadgeLabel = - (int.Parse (NSApplication.SharedApplication.DockTile.BadgeLabel) + 1).ToString (); - - foreach (SparkleLog log in SparkleUI.OpenLogs) - log.UpdateEventLog (); - - NSApplication.SharedApplication.RequestUserAttention - (NSRequestUserAttentionType.InformationalRequest); - + foreach (SparkleLog log in SparkleUI.OpenLogs) + log.UpdateEventLog (); + + if (SparkleShare.Controller.NotificationsEnabled) { + + if (NSApplication.SharedApplication.DockTile.BadgeLabel == null) + NSApplication.SharedApplication.DockTile.BadgeLabel = "1"; + else + NSApplication.SharedApplication.DockTile.BadgeLabel = + (int.Parse (NSApplication.SharedApplication.DockTile.BadgeLabel) + 1).ToString (); + + NSApplication.SharedApplication.RequestUserAttention + (NSRequestUserAttentionType.InformationalRequest); + + } + }); }; diff --git a/SparkleShare/SparkleController.cs b/SparkleShare/SparkleController.cs index 1090e776..61c473b0 100644 --- a/SparkleShare/SparkleController.cs +++ b/SparkleShare/SparkleController.cs @@ -516,7 +516,7 @@ namespace SparkleShare { repo.NewCommit += delegate (SparkleCommit commit, string repository_path) { - if (NotificationsEnabled && NotificationRaised != null) + if (NotificationRaised != null) NotificationRaised (commit, repository_path); };