bubbles: move logic for when to display notifications. fixes invisible toggling on mac.

This commit is contained in:
Hylke Bons 2013-01-11 20:11:28 +01:00
parent 7d7cddc680
commit e3cc690eb3
3 changed files with 8 additions and 4 deletions

View file

@ -30,6 +30,9 @@ namespace SparkleShare {
public SparkleBubbles () public SparkleBubbles ()
{ {
Controller.ShowBubbleEvent += delegate (string title, string subtext, string image_path) { Controller.ShowBubbleEvent += delegate (string title, string subtext, string image_path) {
if (!Program.UI.Controller.NotificationsEnabled)
return;
try { try {
Notification notification = new Notification () { Notification notification = new Notification () {
Summary = title, Summary = title,

View file

@ -444,12 +444,10 @@ namespace SparkleShare {
}; };
repo.NewChangeSet += delegate (SparkleChangeSet change_set) { repo.NewChangeSet += delegate (SparkleChangeSet change_set) {
if (NotificationsEnabled)
NotificationRaised (change_set); NotificationRaised (change_set);
}; };
repo.ConflictResolved += delegate { 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.");
}; };

View file

@ -27,6 +27,9 @@ namespace SparkleShare {
public SparkleBubbles () public SparkleBubbles ()
{ {
Controller.ShowBubbleEvent += delegate (string title, string subtext, string image_path) { Controller.ShowBubbleEvent += delegate (string title, string subtext, string image_path) {
if (!Program.UI.Controller.NotificationsEnabled)
return;
Program.UI.StatusIcon.ShowBalloon (title, subtext, image_path); Program.UI.StatusIcon.ShowBalloon (title, subtext, image_path);
}; };
} }