diff --git a/CHANGELOG.md b/CHANGELOG.md index d76b1253..2e421f00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ CHANGELOG for FlatCAM beta - in Tool Isolation, for Polygon Selection method, added ability to select all/clear all polygons allowing thus negative selection (select all followed by deselection of the polygons you don't want isolated, e.g a ground plane) - some refactoring between app_Main class and MainGUI class - on tab close in Notebook the tool_shapes are deleted (shape markings used by some of the App Tools) therefore part fo the clean-up +- added some protections in case the Editors could not start such that the app is not crashed 26.11.2020 diff --git a/app_Main.py b/app_Main.py index e8787ad8..a47e6caa 100644 --- a/app_Main.py +++ b/app_Main.py @@ -2444,6 +2444,11 @@ class App(QtCore.QObject): return if edited_object.kind == 'geometry': + if self.geo_editor is None: + self.ui.menuobjects.setDisabled(False) + self.inform.emit('[ERROR_NOTCL] %s' % _("The Editor could not start.")) + return + # store the Geometry Editor Toolbar visibility before entering in the Editor self.geo_editor.toolbar_old_state = True if self.ui.geo_edit_toolbar.isVisible() else False @@ -2487,6 +2492,11 @@ class App(QtCore.QObject): # set call source to the Editor we go into self.call_source = 'geo_editor' elif edited_object.kind == 'excellon': + if self.exc_editor is None: + self.ui.menuobjects.setDisabled(False) + self.inform.emit('[ERROR_NOTCL] %s' % _("The Editor could not start.")) + return + # store the Excellon Editor Toolbar visibility before entering in the Editor self.exc_editor.toolbar_old_state = True if self.ui.exc_edit_toolbar.isVisible() else False @@ -2498,6 +2508,11 @@ class App(QtCore.QObject): # set call source to the Editor we go into self.call_source = 'exc_editor' elif edited_object.kind == 'gerber': + if self.grb_editor is None: + self.ui.menuobjects.setDisabled(False) + self.inform.emit('[ERROR_NOTCL] %s' % _("The Editor could not start.")) + return + # store the Gerber Editor Toolbar visibility before entering in the Editor self.grb_editor.toolbar_old_state = True if self.ui.grb_edit_toolbar.isVisible() else False @@ -2512,6 +2527,10 @@ class App(QtCore.QObject): # reset the following variables so the UI is built again after edit edited_object.ui_build = False elif edited_object.kind == 'cncjob': + if self.gcode_editor is None: + self.ui.menuobjects.setDisabled(False) + self.inform.emit('[ERROR_NOTCL] %s' % _("The Editor could not start.")) + return if self.ui.splitter.sizes()[0] == 0: self.ui.splitter.setSizes([1, 1])