bubbles: catch exceptions from libnotify. Fixes #331
This commit is contained in:
parent
f35a24164f
commit
0734951b95
|
@ -12,6 +12,7 @@ BUILD_DEFINES="-define:HAVE_APP_INDICATOR"
|
|||
endif
|
||||
|
||||
SOURCES = \
|
||||
Program.cs \
|
||||
SparkleAbout.cs \
|
||||
SparkleAboutController.cs \
|
||||
SparkleBubbles.cs \
|
||||
|
@ -25,7 +26,6 @@ SOURCES = \
|
|||
SparkleSetup.cs \
|
||||
SparkleSetupController.cs \
|
||||
SparkleSetupWindow.cs \
|
||||
Program.cs \
|
||||
SparkleSpinner.cs \
|
||||
SparkleStatusIcon.cs \
|
||||
SparkleStatusIconController.cs \
|
||||
|
|
|
@ -30,17 +30,23 @@ namespace SparkleShare {
|
|||
public SparkleBubbles ()
|
||||
{
|
||||
Controller.ShowBubbleEvent += delegate (string title, string subtext, string image_path) {
|
||||
Notification notification = new Notification () {
|
||||
Timeout = 5 * 1000,
|
||||
Urgency = Urgency.Low
|
||||
};
|
||||
try {
|
||||
Notification notification = new Notification () {
|
||||
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.Show ();
|
||||
notification.Show ();
|
||||
|
||||
} catch (Exception) {
|
||||
// Ignore exceptions thrown by libnotify,
|
||||
// they're not important enough to crash
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue