Skip to contentSkip to conversation

gitview: Move the console error messages to message dialog

PATCH Aneesh Kumar K.V 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

gitview: Move the console error messages to message dialog

This changes display the error/warning info using message dialog rather than printing them using print

---
 contrib/gitview/gitview |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
contrib/gitview/gitview +7 -2
index c708534..b836047 100755
@@ -983,10 +983,15 @@ class GitView:
 		try:
 			self.treeview.set_cursor(self.index[revid])
 		except KeyError:
-			print "Revision %s not present in the list" % revid
+			dialog = gtk.MessageDialog(parent=None, flags=0,
+					type=gtk.MESSAGE_WARNING, buttons=gtk.BUTTONS_CLOSE,
+					message_format=None)
+			dialog.set_markup("Revision <b>%s</b> not present in the list" % revid)
 			# revid == 0 is the parent of the first commit
 			if (revid != 0 ):
-				print "Try running gitview without any options"
+				dialog.format_secondary_text("Try running gitview without any options")
+			dialog.run()
+			dialog.destroy()
 
 		self.treeview.grab_focus()
 
Signature · 1 line
1.3.3.g4d548-dirty