[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 06/20: grc: add warning for invalid xterm s
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 06/20: grc: add warning for invalid xterm setting (fixes #828) |
Date: |
Fri, 28 Aug 2015 19:19:51 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch master
in repository gnuradio.
commit ce21c31af563bc669085cb1a0a711f58f40c8231
Author: Sebastian Koslowski <address@hidden>
Date: Wed Aug 12 14:03:47 2015 +0200
grc: add warning for invalid xterm setting (fixes #828)
---
grc/gui/ActionHandler.py | 5 +++++
grc/gui/Dialogs.py | 31 ++++++++++++++++++++++++++-----
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 8ece389..1cc55c4 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 61d677a..6c01219 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 ddffe88..a5a7fa9 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')
- [Commit-gnuradio] [gnuradio] branch master updated (22e2f1a -> 68c6862), git, 2015/08/28
- [Commit-gnuradio] [gnuradio] 02/20: Merge branch 'maint_grcwg' into master_grcwg, git, 2015/08/28
- [Commit-gnuradio] [gnuradio] 01/20: qtgui: added trigger callbacks to GRC XML files, git, 2015/08/28
- [Commit-gnuradio] [gnuradio] 06/20: grc: add warning for invalid xterm setting (fixes #828),
git <=
- [Commit-gnuradio] [gnuradio] 05/20: grc: rewrite Preferences.py, git, 2015/08/28
- [Commit-gnuradio] [gnuradio] 16/20: Merge remote-tracking branch 'ckuethe/trap_import_errors', git, 2015/08/28
- [Commit-gnuradio] [gnuradio] 17/20: Merge remote-tracking branch 'saikwolf/qt_themeing', git, 2015/08/28
- [Commit-gnuradio] [gnuradio] 11/20: clarify missing module exception., git, 2015/08/28
- [Commit-gnuradio] [gnuradio] 07/20: grc: move gui prefs file to ~/.gnuradio/grc.conf, git, 2015/08/28
- [Commit-gnuradio] [gnuradio] 20/20: Merge branch 'maint', git, 2015/08/28
- [Commit-gnuradio] [gnuradio] 19/20: Merge remote-tracking branch 'gnuradio-wg-grc/master_grcwg', git, 2015/08/28
- [Commit-gnuradio] [gnuradio] 04/20: grc: clean-up ActionHandler.py imports, git, 2015/08/28
- [Commit-gnuradio] [gnuradio] 14/20: Merge remote-tracking branch 'estatz/qtgui_trigger_callbacks', git, 2015/08/28
- [Commit-gnuradio] [gnuradio] 13/20: grc: super-secret, git, 2015/08/28