-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I still couldn't find a solution for the "Forward button", I'm asking to GTK+ 
and PyGTK hackers.
I've a attached some patches though:
01 fix the bug you described about the list
02 for select_options() (i.e. at the end of the report) activate the default 
button
03 tests
04 with size_request the user couldn't shrink the window
05 some label layout fixes

- -- 
http://syx.googlecode.com - Smalltalk YX
http://lethalman.blogspot.com - Thoughts about computer technologies
http://www.ammazzatecitutti.org - Ammazzateci tutti
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkjC/9AACgkQw9Qj+8Kak3Fx9wCeJ0WMycEHCO8mwwnJGT6LzQbZ
3L4AnjPXaM6RjegMmYLWKUhgOqneBhqw
=iZj7
-----END PGP SIGNATURE-----
From 170bb230c446b982060a3bc2aa7ca70b7714f0df Mon Sep 17 00:00:00 2001
From: Luca Bruno <[EMAIL PROTECTED]>
Date: Sat, 6 Sep 2008 23:42:16 +0200
Subject: [PATCH] Empty list allowed for get_multiline()

---
 reportbug/ui/gtk2_ui.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/reportbug/ui/gtk2_ui.py b/reportbug/ui/gtk2_ui.py
index b08d591..d1d1721 100644
--- a/reportbug/ui/gtk2_ui.py
+++ b/reportbug/ui/gtk2_ui.py
@@ -594,6 +594,7 @@ class GetMultilinePage (Page):
         return text.split ('\n')
 
     def execute (self, prompt):
+        self.empty_ok = True
         # The result must be iterable for reportbug even if it's empty and not modified
         self.label.set_text (prompt)
         self.buffer.set_text ("")
@@ -680,6 +681,8 @@ class GetListPage (TreePage):
             self.model.remove (iter)
 
     def execute (self, prompt):
+        self.empty_ok = True
+
         self.label.set_text (prompt)
 
         self.model = gtk.ListStore (str)
-- 
1.5.6.5

From b1de3a8c2e99eb2b4ebb5068625d6c5964353fb7 Mon Sep 17 00:00:00 2001
From: Luca Bruno <[EMAIL PROTECTED]>
Date: Sat, 6 Sep 2008 23:43:06 +0200
Subject: [PATCH] Fixed 'default' button behavior for select_options()

---
 reportbug/ui/gtk2_ui.py |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/reportbug/ui/gtk2_ui.py b/reportbug/ui/gtk2_ui.py
index d1d1721..20aabde 100644
--- a/reportbug/ui/gtk2_ui.py
+++ b/reportbug/ui/gtk2_ui.py
@@ -1028,10 +1028,15 @@ class SelectOptionsPage (Page):
         self.application.set_next_value (menuopt)
         self.assistant.forward_page ()
 
+    def setup_focus (self):
+        if self.default:
+            self.default.set_flags (gtk.CAN_DEFAULT | gtk.HAS_DEFAULT)
+            self.default.grab_default ()
+
     def execute (self, prompt, menuopts, options):
         self.label.set_text (prompt)
 
-        default = None
+        self.default = None
         buttons = []
         for menuopt in menuopts:
             desc = options[menuopt.lower ()]
@@ -1041,7 +1046,7 @@ class SelectOptionsPage (Page):
             button = gtk.Button (options[menuopt.lower ()])
             button.connect ('clicked', self.on_clicked, menuopt.lower ())
             if menuopt.isupper ():
-                default = button
+                self.default = button
                 buttons.insert (0, gtk.HSeparator ())
                 buttons.insert (0, button)
             else:
@@ -1050,11 +1055,6 @@ class SelectOptionsPage (Page):
         for button in buttons:
             self.vbox.pack_start (button, expand=False)
 
-        if default:
-            default.set_flags (gtk.CAN_DEFAULT | gtk.HAS_DEFAULT)
-            default.grab_default ()
-            default.grab_focus ()
-
         self.vbox.show_all ()
 
 class ProgressPage (Page):
-- 
1.5.6.5

From bb72deb017bdae01ae98846bb7d8961affb466fd Mon Sep 17 00:00:00 2001
From: Luca Bruno <[EMAIL PROTECTED]>
Date: Sat, 6 Sep 2008 23:43:53 +0200
Subject: [PATCH] More tests

---
 reportbug/ui/gtk2_ui.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/reportbug/ui/gtk2_ui.py b/reportbug/ui/gtk2_ui.py
index 6bf2682..b5d6307 100644
--- a/reportbug/ui/gtk2_ui.py
+++ b/reportbug/ui/gtk2_ui.py
@@ -1262,9 +1262,11 @@ def initialize ():
 
 def test ():
     # Write some tests here
+    print select_options ('test', 'A', {'a': 'A test'})
+    print get_multiline ('ENTER', empty_ok=True)
     print get_string ("test")
     page = HandleBTSQueryPage (assistant)
-    application.run_once_in_main_thread (page.execute_operation, [('asd', (Bug ('#123 [asd] [we] we we Reported by: asd;' ), Bug ('#123 [asd] [we] we we Reported by: asd;')))], 'asd')
+    application.run_once_in_main_thread (page.execute_operation, [('test', (Bug ('#123 [test] [we] we we Reported by: test;' ), Bug ('#123 [test] [we] we we Reported by: test;')))], 'test')
     return application.get_last_value ()
 
 if __name__ == '__main__':
-- 
1.5.6.5

From 62603440d1cc1fcaa65908e1f56b94261c4233ff Mon Sep 17 00:00:00 2001
From: Luca Bruno <[EMAIL PROTECTED]>
Date: Sun, 7 Sep 2008 00:00:47 +0200
Subject: [PATCH] Use default size instead of requested size. Shrink bugs dialog to width 600

---
 reportbug/ui/gtk2_ui.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/reportbug/ui/gtk2_ui.py b/reportbug/ui/gtk2_ui.py
index c669165..740f56e 100644
--- a/reportbug/ui/gtk2_ui.py
+++ b/reportbug/ui/gtk2_ui.py
@@ -377,7 +377,7 @@ class BugsDialog (gtk.Dialog):
         self.notebook = gtk.Notebook ()
         self.vbox.pack_start (self.notebook)
         self.connect ('response', self.on_response)
-        self.set_size_request (800, 600)
+        self.set_default_size (600, 600)
 
     def on_response (self, *args):
         self.destroy ()
@@ -1091,7 +1091,7 @@ class ReportbugAssistant (gtk.Assistant):
         self.showing_page = None
         self.requested_page = None
         self.progress_page = None
-        self.set_size_request (600, 400)
+        self.set_default_size (600, 400)
         self.set_forward_page_func (self.forward)
         self.connect_signals ()
         self.setup_pages ()
-- 
1.5.6.5

From e3c00f28b56c67eeffea953fab9c8d01c36d28f9 Mon Sep 17 00:00:00 2001
From: Luca Bruno <[EMAIL PROTECTED]>
Date: Sun, 7 Sep 2008 00:00:26 +0200
Subject: [PATCH] More linewraps for labels

---
 reportbug/ui/gtk2_ui.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/reportbug/ui/gtk2_ui.py b/reportbug/ui/gtk2_ui.py
index da02b3a..c669165 100644
--- a/reportbug/ui/gtk2_ui.py
+++ b/reportbug/ui/gtk2_ui.py
@@ -328,7 +328,9 @@ class BugPage (gtk.EventBox, threading.Thread):
         bodies = info[1]
         vbox = gtk.VBox (spacing=12)
         vbox.set_border_width (12)
-        vbox.pack_start (gtk.Label ('Description: '+desc), expand=False)
+        label = gtk.Label ('Description: '+desc)
+        label.set_line_wrap (True)
+        vbox.pack_start (label, expand=False)
         
         view = gtk.TreeView ()
         view.get_selection().set_mode (gtk.SELECTION_NONE)
@@ -1067,6 +1069,7 @@ class ProgressPage (Page):
     def create_widget (self):
         vbox = gtk.VBox (spacing=6)
         self.label = gtk.Label ()
+        self.label.set_line_wrap (True)
         self.progress = gtk.ProgressBar ()
         self.progress.set_pulse_step (0.01)
         vbox.pack_start (self.label, expand=False)
-- 
1.5.6.5

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

Reply via email to