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