diff options
Diffstat (limited to 'grc')
-rw-r--r-- | grc/gui/Dialogs.py | 18 | ||||
-rw-r--r-- | grc/gui/PropsDialog.py | 6 | ||||
-rw-r--r-- | grc/python/Block.py | 3 |
3 files changed, 19 insertions, 8 deletions
diff --git a/grc/gui/Dialogs.py b/grc/gui/Dialogs.py index e1fc680bde..61d677af85 100644 --- a/grc/gui/Dialogs.py +++ b/grc/gui/Dialogs.py @@ -23,7 +23,8 @@ import gtk import Utils import Actions -class TextDisplay(gtk.TextView): + +class SimpleTextDisplay(gtk.TextView): """A non editable gtk text view.""" def __init__(self, text=''): @@ -41,10 +42,18 @@ class TextDisplay(gtk.TextView): self.set_cursor_visible(False) self.set_wrap_mode(gtk.WRAP_WORD_CHAR) - # Added for scroll locking - self.scroll_lock = True - # Add a signal for populating the popup menu +class TextDisplay(SimpleTextDisplay): + + def __init__(self, text=''): + """ + TextDisplay constructor. + + Args: + text: the text to display (string) + """ + SimpleTextDisplay.__init__(self, text) + self.scroll_lock = True self.connect("populate-popup", self.populate_popup) def insert(self, line): @@ -116,6 +125,7 @@ class TextDisplay(gtk.TextView): menu.show_all() return False + def MessageDialogHelper(type, buttons, title=None, markup=None, default_response=None, extra_buttons=None): """ Create a modal message dialog and run it. diff --git a/grc/gui/PropsDialog.py b/grc/gui/PropsDialog.py index 91f7f4ffe9..470e2d59d8 100644 --- a/grc/gui/PropsDialog.py +++ b/grc/gui/PropsDialog.py @@ -21,7 +21,7 @@ import pygtk pygtk.require('2.0') import gtk -from Dialogs import TextDisplay +from Dialogs import SimpleTextDisplay from Constants import MIN_DIALOG_WIDTH, MIN_DIALOG_HEIGHT import Utils @@ -95,14 +95,14 @@ class PropsDialog(gtk.Dialog): self._params_boxes.append((tab, label, vbox)) # Docs for the block - self._docs_text_display = TextDisplay() + self._docs_text_display = SimpleTextDisplay() self._docs_box = gtk.ScrolledWindow() self._docs_box.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self._docs_box.add_with_viewport(self._docs_text_display) notebook.append_page(self._docs_box, gtk.Label("Documentation")) # Error Messages for the block - self._error_messages_text_display = TextDisplay() + self._error_messages_text_display = SimpleTextDisplay() self._error_box = gtk.ScrolledWindow() self._error_box.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self._error_box.add_with_viewport(self._error_messages_text_display) diff --git a/grc/python/Block.py b/grc/python/Block.py index 191b03b452..48b827792e 100644 --- a/grc/python/Block.py +++ b/grc/python/Block.py @@ -106,7 +106,8 @@ class Block(_Block, _GUIBlock): current_generate_option = self.get_parent().get_option('generate_options') for label, option in (('WX GUI', 'wx_gui'), ('QT GUI', 'qt_gui')): if self.get_name().startswith(label) and current_generate_option != option: - self.add_error_message("Can't generate this block in mode " + repr(option)) + self.add_error_message("Can't generate this block in mode " + + repr(current_generate_option)) def rewrite(self): """ |