retitle 702521 urwid interface Cancel button doesn't cancel bug reprot
tags 702521 + patch
thanks

On Thu, Mar 07, 2013 at 12:58:17PM -0500, Ryan Kavanagh wrote:
> When selecting the severity of a bug under urwid, the "Cancel" button
> doesn't do anything, apart from refresh the screen.

The problem is more widespread, the Cancel button on the tag selecting
screen doesn't work either. I've prepared a patch fixing this
(attached); you can merge in the changes from
    git://anonscm.debian.org/users/rak/reportbug.git
and browse them online at
    http://anonscm.debian.org/gitweb/?p=users/rak/reportbug.git

Best wishes,
Ryan

-- 
|_)|_/  Ryan Kavanagh           | Debian Developer
| \| \  http://ryanak.ca/       | GPG Key 4A11C97A
diff --git a/bin/reportbug b/bin/reportbug
index 774eaad..58d32fc 100755
--- a/bin/reportbug
+++ b/bin/reportbug
@@ -1929,6 +1929,9 @@ For more details, please see: http://www.debian.org/devel/wnpp/''')
                                        "problem or report?", severities,
                                        'Please select a severity level: ',
                                        default=default, order=debbugs.SEVLIST)
+                    # urwid has a cancel and a quit button that return < 0
+                    if (severity < 0):
+                        sys.exit()
 
             if rtype == 'gnats':
                 # Class of report
@@ -2002,6 +2005,9 @@ For more details, please see: http://www.debian.org/devel/wnpp/''')
             taglist = ui.select_multiple(
                 'Do any of the following apply to this report?', tags,
                 'Please select tags: ')
+            if taglist == None:
+                # We've pressed cancel or quit in urwid
+                sys.exit()
 
         patch = ('patch' in taglist)
 
diff --git a/debian/changelog b/debian/changelog
index 3121c51..d583e5d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+reportbug (6.4.3+nmu1) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * bin/reportbug, reportbug/ui/urwid_ui.py
+    - The cancel button displayed when selecting the bug's severity or tags
+      under the Urwid UI should cause us to abort, rather than display the
+      prompt again; Closes: #702521
+
+ -- Ryan Kavanagh <r...@debian.org>  Thu, 07 Mar 2013 12:49:03 -0500
+
 reportbug (6.4.3) unstable; urgency=low
 
   * reportbug/debbugs.py
diff --git a/reportbug/ui/urwid_ui.py b/reportbug/ui/urwid_ui.py
index e85f8ae..5b23021 100644
--- a/reportbug/ui/urwid_ui.py
+++ b/reportbug/ui/urwid_ui.py
@@ -431,7 +431,8 @@ def menu(par, options, prompt, default=None, title=None, any_ok=False,
             box.add_buttons( [(oklabel, 0), (cancellabel, -1)] )
         result, chosen = box.main(ui)
         if result < 0:
-            return []
+            # We return None to differentiate a Cancel/Quit from no selection, []
+            return None
         return chosen
 
     # Single menu option only

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Reportbug-maint mailing list
Reportbug-maint@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/reportbug-maint

Reply via email to