-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thu, 4 Sep 2008 19:38:34 +0200 "Sandro Tosi" <[EMAIL PROTECTED]> wrote:
> all applied as of r645. > > Sandro > 3 patches attached (forgot to attach in the previous mail). - -- 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) iEYEARECAAYFAkjBvD8ACgkQw9Qj+8Kak3Ge6wCeLeokqwkYDvrzx6Qy49l1wzhK l3UAmwbRr2oX2nOJn8t4NmbxD5VVCEt3 =eEsH -----END PGP SIGNATURE-----
From f03f32542d1cecf024de46940ea7fd5b3d1d34c0 Mon Sep 17 00:00:00 2001 From: Luca Bruno <[EMAIL PROTECTED]> Date: Sat, 6 Sep 2008 01:04:59 +0200 Subject: [PATCH] Cleanup empty values code handling --- reportbug/ui/gtk2_ui.py | 38 ++++++++++++-------------------------- 1 files changed, 12 insertions(+), 26 deletions(-) diff --git a/reportbug/ui/gtk2_ui.py b/reportbug/ui/gtk2_ui.py index b4100e2..0ccbce0 100644 --- a/reportbug/ui/gtk2_ui.py +++ b/reportbug/ui/gtk2_ui.py @@ -454,6 +454,7 @@ class Page (ReportbugConnector): def execute_operation (self, *args, **kwargs): self.switch_in () self.connect_signals () + self.empty_ok = kwargs.pop ('empty_ok', False) self.execute (*args, **kwargs) self.assistant.show () @@ -485,7 +486,10 @@ class Page (ReportbugConnector): pass def is_valid (self, value): - return bool (value) + if self.empty_ok: + return True + else: + return bool (value) def validate (self, *args, **kwargs): value = self.get_value () @@ -521,6 +525,10 @@ class GetStringPage (Page): return self.entry.get_text () def execute (self, prompt, options=None, force_prompt=False, default=''): + if 'blank OK' in prompt: + self.empty_ok = True + else: + self.empty_ok = False self.label.set_text (prompt) self.entry.set_text (default) @@ -539,12 +547,6 @@ class GetMultilinePage (Page): def connect_signals (self): self.buffer.connect ('changed', self.validate) - def is_valid (self, value): - if self.empty_ok: - return True - else: - return bool (value) - def get_value (self): text = self.buffer.get_text (self.buffer.get_start_iter (), self.buffer.get_end_iter ()) lines = text.split ('\n') @@ -553,9 +555,8 @@ class GetMultilinePage (Page): del lines[-1] return text.split ('\n') - def execute (self, prompt, empty_ok=True): + def execute (self, prompt): # The result must be iterable for reportbug even if it's empty and not modified - self.empty_ok = empty_ok self.label.set_text (prompt) self.buffer.set_text ("") self.buffer.emit ('changed') @@ -618,12 +619,6 @@ class GetListPage (TreePage): values.append (row[self.value_column]) return values - def is_valid (self, value): - if self.empty_ok: - return True - else: - return bool (value) - def on_add (self, button): dialog = InputStringDialog ("Add a new item to the list") dialog.show_all () @@ -643,8 +638,7 @@ class GetListPage (TreePage): for iter in iters: self.model.remove (iter) - def execute (self, prompt, empty_ok=True): - self.empty_ok = empty_ok + def execute (self, prompt): self.label.set_text (prompt) self.model = gtk.ListStore (str) @@ -670,16 +664,8 @@ class MenuPage (TreePage): vbox.show_all () return vbox - def is_valid (self, value): - if self.empty_ok: - return True - else: - return bool (value) - def execute (self, par, options, prompt, default=None, any_ok=False, - order=None, extras=None, multiple=False, empty_ok=False): - self.empty_ok = empty_ok - + order=None, extras=None, multiple=False): self.label.set_text (par) self.model = gtk.ListStore (str, str) -- 1.5.6.5
From 8fd7381c62d0a6f0fb567b7613851d7d926b2d0f Mon Sep 17 00:00:00 2001 From: Luca Bruno <[EMAIL PROTECTED]> Date: Sat, 6 Sep 2008 01:05:32 +0200 Subject: [PATCH] Added a better intro description --- reportbug/ui/gtk2_ui.py | 19 +++++++++++++++++-- 1 files changed, 17 insertions(+), 2 deletions(-) diff --git a/reportbug/ui/gtk2_ui.py b/reportbug/ui/gtk2_ui.py index 0ccbce0..efb363e 100644 --- a/reportbug/ui/gtk2_ui.py +++ b/reportbug/ui/gtk2_ui.py @@ -504,8 +504,20 @@ class IntroPage (Page): default_complete = True def create_widget (self): - vbox = gtk.VBox () - vbox.pack_start (gtk.Label ("ReportBUG")) + vbox = gtk.VBox (spacing=24) + + label = gtk.Label (""" +<b>Reportbug</b> is a tool designed to make the reporting of bugs in Debian and derived distributions relatively painless. + +This wizard will guide you through the bug reporting process step by step.""") + label.set_use_markup (True) + label.set_line_wrap (True) + label.set_justify (gtk.JUSTIFY_FILL) + vbox.pack_start (label, expand=False) + + link = gtk.LinkButton ("http://alioth.debian.org/projects/reportbug", + "Homepage of reportbug project") + vbox.pack_start (link, expand=False) return vbox class GetStringPage (Page): @@ -1199,6 +1211,9 @@ def forward_operations (parent, operations): forward_operations (assistant, pages) forward_operations (application, dialogs) +# GTK settings +gtk.link_button_set_uri_hook (lambda button, uri: launch_browser (uri)) + def test (): # Write some tests here page = HandleBTSQueryPage (assistant) -- 1.5.6.5
From b5546cea7e9a72f239dd81cd8f11585bac078390 Mon Sep 17 00:00:00 2001 From: Luca Bruno <[EMAIL PROTECTED]> Date: Sat, 6 Sep 2008 01:06:07 +0200 Subject: [PATCH] Added gtk completion for get_string() --- reportbug/ui/gtk2_ui.py | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/reportbug/ui/gtk2_ui.py b/reportbug/ui/gtk2_ui.py index efb363e..3bc0933 100644 --- a/reportbug/ui/gtk2_ui.py +++ b/reportbug/ui/gtk2_ui.py @@ -544,6 +544,21 @@ class GetStringPage (Page): self.label.set_text (prompt) self.entry.set_text (default) + if options: + options.sort () + completion = gtk.EntryCompletion () + model = gtk.ListStore (str) + for option in options: + model.append ([option]) + completion.set_model (model) + completion.set_inline_selection (True) + completion.set_text_column (0) + self.entry.set_completion (completion) + else: + self.completion = None + + self.validate () + class GetMultilinePage (Page): def create_widget (self): vbox = gtk.VBox (spacing=12) -- 1.5.6.5
_______________________________________________ Reportbug-maint mailing list Reportbug-maint@lists.alioth.debian.org http://lists.alioth.debian.org/mailman/listinfo/reportbug-maint