diff options
-rw-r--r-- | grc/gui/ActionHandler.py | 5 | ||||
-rw-r--r-- | grc/gui/Dialogs.py | 31 | ||||
-rw-r--r-- | grc/gui/Preferences.py | 3 |
3 files changed, 34 insertions, 5 deletions
diff --git a/grc/gui/ActionHandler.py b/grc/gui/ActionHandler.py index 8ece389328..1cc55c4a8f 100644 --- a/grc/gui/ActionHandler.py +++ b/grc/gui/ActionHandler.py @@ -27,6 +27,7 @@ import gtk import gobject from .. base import ParseXML, Constants +from .. python.Constants import XTERM_EXECUTABLE from . import Dialogs, Messages, Preferences, Actions from .ParserErrorsDialog import ParserErrorsDialog @@ -511,6 +512,10 @@ class ActionHandler: elif action == Actions.FLOW_GRAPH_EXEC: if not self.get_page().get_proc(): Actions.FLOW_GRAPH_GEN() + if Preferences.xterm_missing() != XTERM_EXECUTABLE: + if not os.path.exists(XTERM_EXECUTABLE): + Dialogs.MissingXTermDialog(XTERM_EXECUTABLE) + Preferences.xterm_missing(XTERM_EXECUTABLE) if self.get_page().get_saved() and self.get_page().get_file_path(): ExecFlowGraphThread(self) elif action == Actions.FLOW_GRAPH_KILL: diff --git a/grc/gui/Dialogs.py b/grc/gui/Dialogs.py index 61d677af85..6c01219dee 100644 --- a/grc/gui/Dialogs.py +++ b/grc/gui/Dialogs.py @@ -160,6 +160,8 @@ ERRORS_MARKUP_TMPL="""\ $encode($err_msg.replace('\t', ' ')) #end for""" + + def ErrorsDialog(flowgraph): MessageDialogHelper( type=gtk.MESSAGE_ERROR, buttons=gtk.BUTTONS_CLOSE, @@ -167,6 +169,7 @@ def ErrorsDialog(flowgraph): MessageDialogHelper( markup=Utils.parse_template(ERRORS_MARKUP_TMPL, errors=flowgraph.get_error_messages()), ) + class AboutDialog(gtk.AboutDialog): """A cute little about dialog.""" @@ -181,6 +184,7 @@ class AboutDialog(gtk.AboutDialog): self.run() self.destroy() + def HelpDialog(): MessageDialogHelper( type=gtk.MESSAGE_INFO, buttons=gtk.BUTTONS_CLOSE, @@ -208,8 +212,25 @@ COLORS_DIALOG_MARKUP_TMPL = """\ #end if """ -def TypesDialog(platform): MessageDialogHelper( - type=gtk.MESSAGE_INFO, - buttons=gtk.BUTTONS_CLOSE, - title='Types', - markup=Utils.parse_template(COLORS_DIALOG_MARKUP_TMPL, colors=platform.get_colors())) + +def TypesDialog(platform): + MessageDialogHelper( + type=gtk.MESSAGE_INFO, + buttons=gtk.BUTTONS_CLOSE, + title='Types', + markup=Utils.parse_template(COLORS_DIALOG_MARKUP_TMPL, + colors=platform.get_colors()) + ) + + +def MissingXTermDialog(xterm): + MessageDialogHelper( + type=gtk.MESSAGE_WARNING, + buttons=gtk.BUTTONS_OK, + title='Warning: missing xterm executable', + markup=("The xterm executable {0!r} is missing.\n\n" + "You can change this setting in your gnuradio.conf, in " + "section [grc], 'xterm_executable'.\n" + "\n" + "(This message is shown only once)").format(xterm) + ) diff --git a/grc/gui/Preferences.py b/grc/gui/Preferences.py index ddffe88163..a5a7fa91b5 100644 --- a/grc/gui/Preferences.py +++ b/grc/gui/Preferences.py @@ -114,3 +114,6 @@ def reports_window_position(pos=None): def blocks_window_position(pos=None): return entry('blocks_window_position', pos, default=-1) or 1 + +def xterm_missing(cmd=None): + return entry('xterm_missing', cmd, default='INVALID_XTERM_SETTING') |