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