linux bubbles: Clean up
This commit is contained in:
parent
ed07fc6254
commit
16ea7b06d0
|
@ -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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue