linux bubbles: Clean up

This commit is contained in:
Hylke Bons 2015-08-08 14:18:39 +01:00
parent ed07fc6254
commit 16ea7b06d0

View file

@ -39,31 +39,31 @@ namespace SparkleShare {
if (!Program.Controller.NotificationsEnabled)
return;
Application.Invoke (delegate {
Notification notification = new Notification () {
Summary = title,
Body = subtext,
Timeout = 5 * 1000,
Urgency = Urgency.Low
};
Application.Invoke (delegate {
Notification notification = new Notification () {
Summary = title,
Body = subtext,
Timeout = 5 * 1000,
Urgency = Urgency.Low
};
if (image_path != null)
notification.Icon = new Gdk.Pixbuf (image_path);
else
notification.IconName = "folder-sparkleshare";
if (image_path != null)
notification.Icon = new Gdk.Pixbuf (image_path);
else
notification.IconName = "folder-sparkleshare";
notification.Closed += delegate (object o, EventArgs args) {
if ((args as CloseArgs).Reason == CloseReason.User)
Controller.BubbleClicked ();
};
notification.Closed += delegate (object o, EventArgs args) {
if ((args as CloseArgs).Reason == CloseReason.User)
Controller.BubbleClicked ();
};
try {
notification.Show ();
try {
notification.Show ();
} catch (Exception e) {
SparkleLogger.LogInfo ("Notification", "Error showing notification: ", e);
}
});
} catch (Exception e) {
SparkleLogger.LogInfo ("Notification", "Error showing notification: ", e);
}
});
}
}
}