diff options
Diffstat (limited to 'grc/gui')
-rw-r--r-- | grc/gui/ActionHandler.py | 15 | ||||
-rw-r--r-- | grc/gui/BlockTreeWindow.py | 4 | ||||
-rw-r--r-- | grc/gui/CMakeLists.txt | 1 | ||||
-rw-r--r-- | grc/gui/Preferences.py | 4 |
4 files changed, 10 insertions, 14 deletions
diff --git a/grc/gui/ActionHandler.py b/grc/gui/ActionHandler.py index 9e57565772..ca16a7e7fd 100644 --- a/grc/gui/ActionHandler.py +++ b/grc/gui/ActionHandler.py @@ -63,7 +63,7 @@ class ActionHandler: Messages.register_messenger(self.main_window.add_console_line) Messages.send_init(platform) #initialize - self.init_file_paths = file_paths + self.init_file_paths = [os.path.abspath(file_path) for file_path in file_paths] self.init = False Actions.APPLICATION_INITIALIZE() @@ -112,14 +112,11 @@ class ActionHandler: # Initialize/Quit ################################################## if action == Actions.APPLICATION_INITIALIZE: - if not self.init_file_paths: - self.init_file_paths = list(filter(os.path.exists, Preferences.get_open_files())) - if not self.init_file_paths: self.init_file_paths = [''] - for file_path in self.init_file_paths: - if file_path: main.new_page(file_path) #load pages from file paths - if Preferences.file_open() in self.init_file_paths: - main.new_page(Preferences.file_open(), show=True) - if not self.main_window.current_page: + file_path_to_show = Preferences.file_open() + for file_path in (self.init_file_paths or Preferences.get_open_files()): + if os.path.exists(file_path): + main.new_page(file_path, show=file_path_to_show == file_path) + if not main.current_page: main.new_page() # ensure that at least a blank page exists main.btwin.search_entry.hide() diff --git a/grc/gui/BlockTreeWindow.py b/grc/gui/BlockTreeWindow.py index 90d4b561b7..8504200459 100644 --- a/grc/gui/BlockTreeWindow.py +++ b/grc/gui/BlockTreeWindow.py @@ -179,9 +179,9 @@ class BlockTreeWindow(Gtk.VBox): """Update the documentation column of every block""" def update_doc(model, _, iter_): - if model.iter_has_child(iter_): - return # category node, no doc string key = model.get_value(iter_, KEY_INDEX) + if not key: + return # category node, no doc string block = self.platform.blocks[key] model.set_value(iter_, DOC_INDEX, _format_doc(block.documentation)) diff --git a/grc/gui/CMakeLists.txt b/grc/gui/CMakeLists.txt index aa9592b351..12be4a8151 100644 --- a/grc/gui/CMakeLists.txt +++ b/grc/gui/CMakeLists.txt @@ -22,5 +22,4 @@ file(GLOB py_files "*.py") GR_PYTHON_INSTALL( FILES ${py_files} DESTINATION ${GR_PYTHON_DIR}/gnuradio/grc/gui - COMPONENT "grc" ) diff --git a/grc/gui/Preferences.py b/grc/gui/Preferences.py index 8756a7ab23..d917537971 100644 --- a/grc/gui/Preferences.py +++ b/grc/gui/Preferences.py @@ -77,7 +77,7 @@ def entry(key, value=None, default=None): }.get(_type, _config_parser.get) try: result = getter('main', key) - except configparser.Error: + except (AttributeError, configparser.Error): result = _type() if default is None else default return result @@ -109,7 +109,7 @@ def get_file_list(key): try: files = [value for name, value in _config_parser.items(key) if name.startswith('%s_' % key)] - except configparser.Error: + except (AttributeError, configparser.Error): files = [] return files |