diff options
Diffstat (limited to 'grc')
-rw-r--r-- | grc/core/Param.py | 15 | ||||
-rw-r--r-- | grc/gui/Application.py | 5 | ||||
-rw-r--r-- | grc/scripts/freedesktop/gnuradio-grc.desktop | 3 |
3 files changed, 17 insertions, 6 deletions
diff --git a/grc/core/Param.py b/grc/core/Param.py index e8c81383f3..a1e4c782fb 100644 --- a/grc/core/Param.py +++ b/grc/core/Param.py @@ -54,10 +54,19 @@ class TemplateArg(str): setattr(instance, '_param', param) return instance + def __getitem__(self, item): + return str(self._param.get_opt(item)) if self._param.is_enum() else NotImplemented + def __getattr__(self, item): - param = self._param - attributes = param.options.attributes[param.get_value()] - return str(attributes.get(item)) or NotImplemented + if not self._param.is_enum(): + raise AttributeError() + try: + return str(self._param.get_opt(item)) + except KeyError: + raise AttributeError() + + def __str__(self): + return str(self._param.to_code()) def __call__(self): return self._param.get_evaluated() diff --git a/grc/gui/Application.py b/grc/gui/Application.py index b4df4d172e..458210a3f4 100644 --- a/grc/gui/Application.py +++ b/grc/gui/Application.py @@ -703,9 +703,10 @@ class Application(Gtk.Application): elif action == Actions.FLOW_GRAPH_KILL: if page.process: try: - page.process.kill() + page.term_proc() except: - print("could not kill process: %d" % page.process.pid) + print("could not terminate process: %d" % page.get_proc().pid) + elif action == Actions.PAGE_CHANGE: # pass and run the global actions pass elif action == Actions.RELOAD_BLOCKS: diff --git a/grc/scripts/freedesktop/gnuradio-grc.desktop b/grc/scripts/freedesktop/gnuradio-grc.desktop index 39beeca1b8..f065ce4568 100644 --- a/grc/scripts/freedesktop/gnuradio-grc.desktop +++ b/grc/scripts/freedesktop/gnuradio-grc.desktop @@ -1,7 +1,8 @@ [Desktop Entry] Version=1.0 Type=Application -Name=GRC +Name=GNU Radio Companion +Comment=Graphical tool for creating signal flow graphs and generating flow-graph source code Exec=gnuradio-companion %F Categories=Development; MimeType=application/gnuradio-grc; |