Просмотр исходного кода

Merged in marius_stanciu/flatcam_beta/Beta_8.918 (pull request #150)

Beta 8.918
Marius Stanciu 6 лет назад
Родитель
Сommit
5c5f2c1606
4 измененных файлов с 32 добавлено и 15 удалено
  1. 16 8
      FlatCAMApp.py
  2. 2 0
      ObjectCollection.py
  3. 7 1
      README.md
  4. 7 6
      flatcamGUI/VisPyVisuals.py

+ 16 - 8
FlatCAMApp.py

@@ -95,7 +95,7 @@ class App(QtCore.QObject):
 
     # Version
     version = 8.918
-    version_date = "2019/06/07"
+    version_date = "2019/06/09"
     beta = True
 
     # current date now
@@ -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()

+ 2 - 0
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)

+ 7 - 1
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
 

+ 7 - 6
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):