[Reportbug-commits] [SCM] Reportbug - reports bugs in the Debian distribution branch, master, updated. 4.8-22-gac12227

Luca Bruno lethalman88 at gmail.com
Thu Nov 26 21:19:14 UTC 2009


The following commit has been merged in the master branch:
commit 15ec2201fd81a8ca5df317ec2d8ce0793f7b8d1d
Author: Luca Bruno <lethalman88 at gmail.com>
Date:   Sun Nov 22 12:02:05 2009 +0100

    don't show back button as it's not possible to go back; thanks to all the people reporting the bug; Closes: #532467

diff --git a/debian/changelog b/debian/changelog
index 264b1e8..580cec1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -48,8 +48,10 @@ reportbug (4.8+WIP) UNRELEASED; urgency=low
     - more clean handling of response in error/info dialogs; thanks to
       Julian Andres Klode; Closes: #527259
     - open a terminal when fallbacking to text mode if stdout is not available
+    - don't show back button as it's not possible to go back;
+      thanks to all the people reporting the bug; Closes: #532467
 
- -- Luca Bruno <lethalman88 at gmail.com>  Sun, 22 Nov 2009 11:33:28 +0100
+ -- Luca Bruno <lethalman88 at gmail.com>  Sun, 22 Nov 2009 11:51:10 +0100
 
 reportbug (4.8) unstable; urgency=low
 
diff --git a/reportbug/ui/gtk2_ui.py b/reportbug/ui/gtk2_ui.py
index 50e6fcd..32f1c22 100644
--- a/reportbug/ui/gtk2_ui.py
+++ b/reportbug/ui/gtk2_ui.py
@@ -1268,8 +1268,10 @@ class ProgressPage (Page):
 class ReportbugAssistant (gtk.Assistant):
     def __init__ (self, application):
         gtk.Assistant.__init__ (self)
-        self.set_title ('Reportbug')
         self.application = application
+
+        self.set_title ('Reportbug')
+        self.nuke_back_button ()
         self.showing_page = None
         self.requested_page = None
         self.progress_page = None
@@ -1278,12 +1280,29 @@ class ReportbugAssistant (gtk.Assistant):
         self.connect_signals ()
         self.setup_pages ()
 
+    def nuke_back_cb (self, widget):
+        # This is a real hack for two reasons:
+        # 1. There's no other way to access action area but inspecting the assistant and searching for the back button
+        # 2. Hide back button on show, because it can be shown-hidden by the assistant depending on the page
+        if isinstance (widget, gtk.Button):
+            if widget.get_label() == 'gtk-go-back':
+                widget.connect ('show', self.on_back_show)
+                return
+        if isinstance (widget, gtk.Container):
+            widget.forall (self.nuke_back_cb)
+
+    def nuke_back_button (self):
+        self.nuke_back_cb (self)
+
     def connect_signals (self):
         self.connect ('cancel', self.close)
         self.connect ('prepare', self.on_prepare)
         self.connect ('delete-event', self.close)
         self.connect ('apply', self.close)
-        
+
+    def on_back_show (self, widget):
+        widget.hide ()
+
     def on_prepare (self, assistant, widget):
         # If the user goes back then forward, we must ensure the feedback value to reportbug must be sent
         # when the user clicks on "Forward" to the requested page by reportbug

-- 
Reportbug - reports bugs in the Debian distribution



More information about the Reportbug-commits mailing list