- Isolation Plugin - if there is no object selected try to select the first one if there is any

- Fixed setting a new style
This commit is contained in:
Marius Stanciu
2021-08-05 22:16:10 +03:00
committed by Marius
parent 1d88491a18
commit 03618172d7
4 changed files with 8 additions and 3 deletions

View File

@@ -286,9 +286,11 @@ class ToolIsolation(AppTool, Gerber):
# try to select in the Gerber combobox the active object
try:
selected_obj = self.app.collection.get_active()
if selected_obj.kind == 'gerber':
if selected_obj is not None and selected_obj.kind == 'gerber':
current_name = selected_obj.options['name']
self.ui.object_combo.set_value(current_name)
if selected_obj is None and [self.ui.object_combo.itemText(i) for i in range(self.ui.object_combo.count())]:
self.ui.object_combo.setCurrentIndex(0)
except Exception as ee:
self.app.log.debug("ToolIsolation.set_tool_ui() Select Gerber object -> %s" % str(ee))