Commits

Steve Borho committed 037e3a9

hggtk/histselect: cleaner method of connecting gtk.main_quit

Comments (0)

Files changed (1)

hggtk/histselect.py

 class HistoryDialog(gtk.Dialog):
     """ Dialog to display Mercurial history """
     def __init__(self, root='', files=[], list_clean=False,
-            select=False, page=100, mainapp=False):
+            select=False, page=100):
         """ Initialize the Dialog """
         if select:
             buttons = (gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT,
         title = "hg log "
         if root: title += " - %s" % root
         self.set_title(title)
-        if mainapp:
-            self.connect('response', gtk.main_quit)
 
         self.root = root
         self.files = files
         return list
         
 def run(root='', files=[], **opts):
-    dialog = HistoryDialog(root=root, files=files, mainapp=True)
+    dialog = HistoryDialog(root=root, files=files)
     dialog.show_all()
+    dialog.connect('response', gtk.main_quit)
     gtk.gdk.threads_init()
     gtk.gdk.threads_enter()
     gtk.main()