From 226a2bfe041c989fa7c06c281055aa58b9f465a5 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Fri, 11 Jan 2013 20:11:28 +0100 Subject: [PATCH] bubbles: move logic for when to display notifications. fixes invisible toggling on mac. --- SparkleShare/Linux/SparkleBubbles.cs | 3 +++ SparkleShare/SparkleControllerBase.cs | 6 ++---- SparkleShare/Windows/SparkleBubbles.cs | 3 +++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/SparkleShare/Linux/SparkleBubbles.cs b/SparkleShare/Linux/SparkleBubbles.cs index 8fbbab6f..a174d36c 100755 --- a/SparkleShare/Linux/SparkleBubbles.cs +++ b/SparkleShare/Linux/SparkleBubbles.cs @@ -30,6 +30,9 @@ namespace SparkleShare { public SparkleBubbles () { Controller.ShowBubbleEvent += delegate (string title, string subtext, string image_path) { + if (!Program.UI.Controller.NotificationsEnabled) + return; + try { Notification notification = new Notification () { Summary = title, diff --git a/SparkleShare/SparkleControllerBase.cs b/SparkleShare/SparkleControllerBase.cs index c8853892..db72fb81 100644 --- a/SparkleShare/SparkleControllerBase.cs +++ b/SparkleShare/SparkleControllerBase.cs @@ -444,13 +444,11 @@ namespace SparkleShare { }; repo.NewChangeSet += delegate (SparkleChangeSet change_set) { - if (NotificationsEnabled) - NotificationRaised (change_set); + NotificationRaised (change_set); }; repo.ConflictResolved += delegate { - if (NotificationsEnabled) - AlertNotificationRaised ("Conflict happened", "Don't worry, we've made a copy of each conflicting file."); + AlertNotificationRaised ("Conflict happened", "Don't worry, we've made a copy of each conflicting file."); }; this.repositories.Add (repo); diff --git a/SparkleShare/Windows/SparkleBubbles.cs b/SparkleShare/Windows/SparkleBubbles.cs index 23989391..18e615cc 100644 --- a/SparkleShare/Windows/SparkleBubbles.cs +++ b/SparkleShare/Windows/SparkleBubbles.cs @@ -27,6 +27,9 @@ namespace SparkleShare { public SparkleBubbles () { Controller.ShowBubbleEvent += delegate (string title, string subtext, string image_path) { + if (!Program.UI.Controller.NotificationsEnabled) + return; + Program.UI.StatusIcon.ShowBalloon (title, subtext, image_path); }; }