diff --git a/FlatCAMApp.py b/FlatCAMApp.py index eaa991fa..a40dc3a4 100644 --- a/FlatCAMApp.py +++ b/FlatCAMApp.py @@ -5914,19 +5914,27 @@ class App(QtCore.QObject): # Clear pool self.clear_pool() - #delete shapes left drawn from mark shape_collections, if any for obj in self.collection.get_list(): - try: - obj.mark_shapes.enabled = False - obj.mark_shapes.clear(update=True) - except: - pass + # delete shapes left drawn from mark shape_collections, if any + if isinstance(obj, FlatCAMGerber): + try: + obj.mark_shapes.enabled = False + obj.mark_shapes.clear(update=True) + except AttributeError: + pass + + # also delete annotation shapes, if any + elif isinstance(obj, FlatCAMCNCjob): + try: + obj.annotation.enabled = False + obj.annotation.clear(update=True) + except AttributeError: + pass # tcl needs to be reinitialized, otherwise old shell variables etc remains self.init_tcl() self.delete_selection_shape() - self.collection.delete_all() self.setup_component_editor() @@ -6119,7 +6127,7 @@ class App(QtCore.QObject): filter = _filter_) if filename == "": - self.inform.emit(_("[WARNING_NOTCL Open Config cancelled.")) + self.inform.emit(_("[WARNING_NOTCL] Open Config cancelled.")) else: self.open_config_file(filename) diff --git a/ObjectCollection.py b/ObjectCollection.py index 862a4375..9e23279d 100644 --- a/ObjectCollection.py +++ b/ObjectCollection.py @@ -583,6 +583,8 @@ class ObjectCollection(QtCore.QAbstractItemModel): self.endRemoveRows() + self.app.plotcanvas.redraw() + if select_project: # always go to the Project Tab after object deletion as it may be done with a shortcut key self.app.ui.notebook.setCurrentWidget(self.app.ui.project_tab) diff --git a/README.md b/README.md index ad9ca54c..ce2c73db 100644 --- a/README.md +++ b/README.md @@ -9,13 +9,19 @@ CAD program, and create G-Code for Isolation routing. ================================================= +8.06.2019 + +- make sure that the annotation shapes are deleted on creation of a new project +- added folder for the Russian translation +- made sure that visibility for TextGroup is set only if index is not None in VisPyVisuals.TextGroup.visible() setter +- RELEASE 8.918 + 7.06.2019 - fixed bug in ToolCutout where creating a cutout object geometry from another external isolation geometry failed - fixed bug in cncjob TclCommand where the gcode could not be correctly generated due of missing bounds params in obj.options dict - fixed a hardcoded tolerance in FlatCAMGeometry.generatecncjob() and in FlatCAMGeometry.mtool_gen_cncjob() to use the parameter from Preferences - updated translations -- RELEASE 8.918 5.06.2019 diff --git a/flatcamGUI/VisPyVisuals.py b/flatcamGUI/VisPyVisuals.py index 254698fd..1cb441e8 100644 --- a/flatcamGUI/VisPyVisuals.py +++ b/flatcamGUI/VisPyVisuals.py @@ -437,12 +437,13 @@ class TextGroup(object): :param value: bool """ self._visible = value - try: - self._collection.data[self._index]['visible'] = value - except KeyError: - print("VisPyVisuals.TextGroup.visible --> KeyError") - pass - self._collection.redraw() + if self._index: + try: + self._collection.data[self._index]['visible'] = value + except KeyError as e: + print("VisPyVisuals.TextGroup.visible --> KeyError --> %s" % str(e)) + pass + self._collection.redraw() class TextCollectionVisual(TextVisual):