- 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
This commit is contained in:
Marius Stanciu 2019-06-08 21:36:34 +03:00
parent 24f9de8c16
commit 5f972ab85e
4 changed files with 32 additions and 15 deletions

View File

@ -5914,19 +5914,27 @@ class App(QtCore.QObject):
# Clear pool # Clear pool
self.clear_pool() self.clear_pool()
#delete shapes left drawn from mark shape_collections, if any
for obj in self.collection.get_list(): for obj in self.collection.get_list():
try: # delete shapes left drawn from mark shape_collections, if any
obj.mark_shapes.enabled = False if isinstance(obj, FlatCAMGerber):
obj.mark_shapes.clear(update=True) try:
except: obj.mark_shapes.enabled = False
pass 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 # tcl needs to be reinitialized, otherwise old shell variables etc remains
self.init_tcl() self.init_tcl()
self.delete_selection_shape() self.delete_selection_shape()
self.collection.delete_all() self.collection.delete_all()
self.setup_component_editor() self.setup_component_editor()
@ -6119,7 +6127,7 @@ class App(QtCore.QObject):
filter = _filter_) filter = _filter_)
if filename == "": if filename == "":
self.inform.emit(_("[WARNING_NOTCL Open Config cancelled.")) self.inform.emit(_("[WARNING_NOTCL] Open Config cancelled."))
else: else:
self.open_config_file(filename) self.open_config_file(filename)

View File

@ -583,6 +583,8 @@ class ObjectCollection(QtCore.QAbstractItemModel):
self.endRemoveRows() self.endRemoveRows()
self.app.plotcanvas.redraw()
if select_project: if select_project:
# always go to the Project Tab after object deletion as it may be done with a shortcut key # 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) self.app.ui.notebook.setCurrentWidget(self.app.ui.project_tab)

View File

@ -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 7.06.2019
- fixed bug in ToolCutout where creating a cutout object geometry from another external isolation geometry failed - 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 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 - fixed a hardcoded tolerance in FlatCAMGeometry.generatecncjob() and in FlatCAMGeometry.mtool_gen_cncjob() to use the parameter from Preferences
- updated translations - updated translations
- RELEASE 8.918
5.06.2019 5.06.2019

View File

@ -437,12 +437,13 @@ class TextGroup(object):
:param value: bool :param value: bool
""" """
self._visible = value self._visible = value
try: if self._index:
self._collection.data[self._index]['visible'] = value try:
except KeyError: self._collection.data[self._index]['visible'] = value
print("VisPyVisuals.TextGroup.visible --> KeyError") except KeyError as e:
pass print("VisPyVisuals.TextGroup.visible --> KeyError --> %s" % str(e))
self._collection.redraw() pass
self._collection.redraw()
class TextCollectionVisual(TextVisual): class TextCollectionVisual(TextVisual):