[osx] Fix logs not being updated when notifications are turned off

This commit is contained in:
Hylke Bons 2011-03-13 17:45:23 +00:00
parent cda56fcbb4
commit 66b30d0d37
2 changed files with 17 additions and 14 deletions

View file

@ -55,7 +55,6 @@ namespace SparkleShare {
public static SparkleIntro Intro; public static SparkleIntro Intro;
public static NSFont Font; public static NSFont Font;
private SparkleAbout About;
private NSAlert Alert; private NSAlert Alert;
@ -91,18 +90,22 @@ namespace SparkleShare {
InvokeOnMainThread (delegate { InvokeOnMainThread (delegate {
if (NSApplication.SharedApplication.DockTile.BadgeLabel == null) foreach (SparkleLog log in SparkleUI.OpenLogs)
NSApplication.SharedApplication.DockTile.BadgeLabel = "1"; log.UpdateEventLog ();
else
NSApplication.SharedApplication.DockTile.BadgeLabel = if (SparkleShare.Controller.NotificationsEnabled) {
(int.Parse (NSApplication.SharedApplication.DockTile.BadgeLabel) + 1).ToString ();
if (NSApplication.SharedApplication.DockTile.BadgeLabel == null)
foreach (SparkleLog log in SparkleUI.OpenLogs) NSApplication.SharedApplication.DockTile.BadgeLabel = "1";
log.UpdateEventLog (); else
NSApplication.SharedApplication.DockTile.BadgeLabel =
NSApplication.SharedApplication.RequestUserAttention (int.Parse (NSApplication.SharedApplication.DockTile.BadgeLabel) + 1).ToString ();
(NSRequestUserAttentionType.InformationalRequest);
NSApplication.SharedApplication.RequestUserAttention
(NSRequestUserAttentionType.InformationalRequest);
}
}); });
}; };

View file

@ -516,7 +516,7 @@ namespace SparkleShare {
repo.NewCommit += delegate (SparkleCommit commit, string repository_path) { repo.NewCommit += delegate (SparkleCommit commit, string repository_path) {
if (NotificationsEnabled && NotificationRaised != null) if (NotificationRaised != null)
NotificationRaised (commit, repository_path); NotificationRaised (commit, repository_path);
}; };