← Back to team overview

openshot.code team mailing list archive

[Branch ~openshot.code/openshot/main] Rev 673: Add some error handling around the pynotify notifications to catch dbus errors.

 

------------------------------------------------------------
revno: 673
fixes bug: https://launchpad.net/bugs/1002205
committer: Andy Finch <we.rocked.in79@xxxxxxxxx>
branch nick: openshot
timestamp: Tue 2012-05-22 21:21:53 +0100
message:
  Add some error handling around the pynotify notifications to catch dbus errors.
modified:
  openshot/windows/ExportVideo.py
  openshot/windows/UploadVideo.py


--
lp:openshot
https://code.launchpad.net/~openshot.code/openshot/main

Your team OpenShot Code is subscribed to branch lp:openshot.
To unsubscribe from this branch go to https://code.launchpad.net/~openshot.code/openshot/main/+edit-subscription
=== modified file 'openshot/windows/ExportVideo.py'
--- openshot/windows/ExportVideo.py	2012-03-20 22:23:06 +0000
+++ openshot/windows/ExportVideo.py	2012-05-22 20:21:53 +0000
@@ -798,10 +798,14 @@
 				
 				# prompt user that export is completed
 				if has_py_notify:
-					# Use libnotify to show the message (if possible)
-					if pynotify.init("OpenShot Video Editor"):
-						n = pynotify.Notification(title, message)
-						n.show()
+					try:
+						# Use libnotify to show the message (if possible)
+						if pynotify.init("OpenShot Video Editor"):
+							n = pynotify.Notification(title, message)
+							n.show()
+					except:
+						# use a GTK messagebox
+						messagebox.show(title, message)
 				else:
 					# use a GTK messagebox
 					messagebox.show(title, message)

=== modified file 'openshot/windows/UploadVideo.py'
--- openshot/windows/UploadVideo.py	2011-02-13 21:02:32 +0000
+++ openshot/windows/UploadVideo.py	2012-05-22 20:21:53 +0000
@@ -163,10 +163,14 @@
 					
 					# prompt user that export is completed
 					if has_py_notify:
-						# Use libnotify to show the message (if possible)
-						if pynotify.init("OpenShot Video Editor"):
-							n = pynotify.Notification(_("Upload Successful!"), _("Your video has been successfully uploaded!"))
-							n.show()
+						try:
+							# Use libnotify to show the message (if possible)
+							if pynotify.init("OpenShot Video Editor"):
+								n = pynotify.Notification(_("Upload Successful!"), _("Your video has been successfully uploaded!"))
+								n.show()
+						except:
+							# use a GTK messagebox
+							messagebox.show(_("Upload Successful!"), _("Your video has been successfully uploaded!"))
 					else:
 						# use a GTK messagebox
 						messagebox.show(_("Upload Successful!"), _("Your video has been successfully uploaded!"))