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 ()
{
Controller.ShowBubbleEvent += delegate (string title, string subtext, string image_path) {
if (!Program.UI.Controller.NotificationsEnabled)
return;
try {
Notification notification = new Notification () {
Summary = title,

View file

@ -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);

View file

@ -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);
};
}