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

Luca Bruno lethalman88 at gmail.com
Wed Mar 25 22:56:48 UTC 2009


The following commit has been merged in the master branch:
commit 9c64d1cc4243fe9b7e0075633dbb24cea2cd4e54
Author: Luca Bruno <lethalman88 at gmail.com>
Date:   Wed Mar 25 10:44:34 2009 +0100

    Support for spell checking in the bug report editor

diff --git a/debian/control b/debian/control
index 2693d50..ad43e2c 100644
--- a/debian/control
+++ b/debian/control
@@ -14,7 +14,7 @@ Homepage: http://alioth.debian.org/projects/reportbug/
 Package: reportbug
 Architecture: all
 Depends: ${python:Depends}, apt, python-reportbug
-Suggests: postfix | exim4 | mail-transport-agent, gnupg | pgp, debconf-utils (>> 1.1.0), debsums, file (>> 1.30), dlocate, python-urwid, python-gtk2, python-vte
+Suggests: postfix | exim4 | mail-transport-agent, gnupg | pgp, debconf-utils (>> 1.1.0), debsums, file (>> 1.30), dlocate, python-urwid, python-gtk2, python-vte, python-gnome2-extras
 Conflicts: python-urwid (<< 0.9.8-1), python-central (<< 0.5.13)
 XB-Python-Version: ${python:Versions}
 Description: reports bugs in the Debian distribution
diff --git a/reportbug/ui/gtk2_ui.py b/reportbug/ui/gtk2_ui.py
index 3528f00..26e71f8 100644
--- a/reportbug/ui/gtk2_ui.py
+++ b/reportbug/ui/gtk2_ui.py
@@ -34,6 +34,12 @@ try:
 except ImportError:
     raise UINotImportable, 'Please install the python-vte package to use this interface.'
 
+try:
+    import gtkspell
+    has_spell = True
+except:
+    has_spell = False
+
 gdk.threads_init ()
 
 import sys
@@ -458,6 +464,7 @@ class Page (ReportbugConnector):
     page_type = gtk.ASSISTANT_PAGE_CONTENT
     default_complete = False
     side_image = DEBIAN_LOGO
+    WARNING_COLOR = gtk.gdk.color_parse ("#fff8ae")
 
     def __init__ (self, assistant):
         self.assistant = assistant
@@ -987,6 +994,8 @@ class EditorPage (Page):
         vbox.pack_start (hbox, expand=False)
 
         self.view = gtk.TextView ()
+        if has_spell:
+            gtkspell.Spell (self.view)
         self.info_buffer = self.view.get_buffer ()
         scrolled = create_scrollable (self.view)
         vbox.pack_start (scrolled)
@@ -998,6 +1007,16 @@ class EditorPage (Page):
         scrolled = create_scrollable (view)
         expander.add (scrolled)
         vbox.pack_start (expander, False)
+
+        if not has_spell:
+            box = gtk.EventBox ()
+            label = gtk.Label ("Please install <b>python-gnome2-extras</b> to enable spell checking")
+            label.set_use_markup (True)
+            label.set_line_wrap (True)
+            box.add (label)
+            box.modify_bg (gtk.STATE_NORMAL, self.WARNING_COLOR)
+            box.connect ('button-press-event', lambda *args: box.destroy ())
+            vbox.pack_start (box, False)
         return vbox
 
     def switch_out (self):

-- 
Reportbug - reports bugs in the Debian distribution



More information about the Reportbug-commits mailing list