[Reportbug-commits] [SCM] Reportbug - reports bugs in the Debian distribution branch, master, updated. 4.9-109-gbc3be7d

Sandro Tosi morph at debian.org
Mon Jun 7 18:09:02 UTC 2010


The following commit has been merged in the master branch:
commit bc3be7de7f3c67d1fd7c7d6a05fa4ecbe7109637
Author: Sandro Tosi <morph at debian.org>
Date:   Mon Jun 7 20:04:23 2010 +0200

    ask confirmation to user when closing reportbug using GTK+ UI; thanks to Matej Zary for the report; Closes: #574843

diff --git a/debian/changelog b/debian/changelog
index 5177adc..2797d9b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,8 +10,11 @@ reportbug (4.12.3) UNRELEASED; urgency=low
   * bin/reportbug, reportbug/{debianbts.py, utils.py}
     - don't present suite tags ('sid', 'lenny', etc) when running in modes lower
       than 'advanced'; thanks to Julien Cristau for the report; Closes: #583890
+  * reportbug/ui/gtk2_ui.py
+    - ask confirmation to user when closing reportbug using GTK+ UI; thanks to
+      Matej Zary for the report; Closes: #574843
 
- -- Sandro Tosi <morph at debian.org>  Sat, 05 Jun 2010 10:38:05 +0200
+ -- Sandro Tosi <morph at debian.org>  Mon, 07 Jun 2010 20:03:46 +0200
 
 reportbug (4.12.2) unstable; urgency=low
 
diff --git a/reportbug/ui/gtk2_ui.py b/reportbug/ui/gtk2_ui.py
index 08585fe..056ef0a 100644
--- a/reportbug/ui/gtk2_ui.py
+++ b/reportbug/ui/gtk2_ui.py
@@ -1341,7 +1341,7 @@ class ReportbugAssistant (gtk.Assistant):
         self._hack_buttons (self)
 
     def connect_signals (self):
-        self.connect ('cancel', self.close)
+        self.connect ('cancel', self.confirm_exit)
         self.connect ('prepare', self.on_prepare)
         self.connect ('delete-event', self.close)
         self.connect ('apply', self.close)
@@ -1367,6 +1367,15 @@ class ReportbugAssistant (gtk.Assistant):
 
     def close (self, *args):
         sys.exit (0)
+
+    def confirm_exit(self, *args):
+        dialog = gtk.MessageDialog (None, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
+                                    gtk.MESSAGE_WARNING, gtk.BUTTONS_YES_NO,
+                                    "Are you sure you want to quit Reportbug?")
+        response = dialog.run ()
+        dialog.destroy ()
+        if response == gtk.RESPONSE_YES:
+            sys.exit (0)
         
     def forward (self, page_num):
         return page_num + 1

-- 
Reportbug - reports bugs in the Debian distribution



More information about the Reportbug-commits mailing list