Преглед изворни кода

- added a remove_tools() function before install_tools() in the init_tools() that is called when creating a new project. Should solve the issue with having double menu entry's in the TOOLS menu

Marius Stanciu пре 7 година
родитељ
комит
7da1d23098
3 измењених фајлова са 9 додато и 1 уклоњено
  1. 7 0
      FlatCAMApp.py
  2. 1 0
      FlatCAMEditor.py
  3. 1 1
      README.md

+ 7 - 0
FlatCAMApp.py

@@ -1459,6 +1459,10 @@ class App(QtCore.QObject):
 
 
         self.log.debug("Tools are installed.")
         self.log.debug("Tools are installed.")
 
 
+    def remove_tools(self):
+        for act in self.ui.menutool.actions():
+            self.ui.menutool.removeAction(act)
+
     def init_tools(self):
     def init_tools(self):
 
 
         # delete the data currently in the Tools Tab and the Tab itself
         # delete the data currently in the Tools Tab and the Tab itself
@@ -1476,6 +1480,9 @@ class App(QtCore.QObject):
         self.ui.tool_tab_layout.addWidget(self.ui.tool_scroll_area)
         self.ui.tool_tab_layout.addWidget(self.ui.tool_scroll_area)
 
 
         # reinstall all the Tools as some may have been removed when the data was removed from the Tools Tab
         # reinstall all the Tools as some may have been removed when the data was removed from the Tools Tab
+        # first remove all of them
+        self.remove_tools()
+        # second install all of them
         self.install_tools()
         self.install_tools()
         self.log.debug("Tools are initialized.")
         self.log.debug("Tools are initialized.")
 
 

+ 1 - 0
FlatCAMEditor.py

@@ -4184,6 +4184,7 @@ class FlatCAMExcEditor(QtCore.QObject):
         self.shapes.enabled = True
         self.shapes.enabled = True
         self.tool_shape.enabled = True
         self.tool_shape.enabled = True
         # self.app.app_cursor.enabled = True
         # self.app.app_cursor.enabled = True
+
         self.app.ui.snap_max_dist_entry.setEnabled(True)
         self.app.ui.snap_max_dist_entry.setEnabled(True)
         self.app.ui.corner_snap_btn.setEnabled(True)
         self.app.ui.corner_snap_btn.setEnabled(True)
         self.app.ui.snap_magnet.setVisible(True)
         self.app.ui.snap_magnet.setVisible(True)

+ 1 - 1
README.md

@@ -16,7 +16,7 @@ CAD program, and create G-Code for Isolation routing.
 - some more changes to GUI interface (solved issues)
 - some more changes to GUI interface (solved issues)
 - added some status bar messages in the Geometry Editor to guide the user when using the Geometry Tools
 - added some status bar messages in the Geometry Editor to guide the user when using the Geometry Tools
 - now the '`' shortcut key that shows the 'shortcut key list' in Editors points to the same window which is created in a tab no longer as a pop-up window. This tab can be detached if needed.
 - now the '`' shortcut key that shows the 'shortcut key list' in Editors points to the same window which is created in a tab no longer as a pop-up window. This tab can be detached if needed.
-- 
+- added a remove_tools() function before install_tools() in the init_tools() that is called when creating a new project. Should solve the issue with having double menu entry's in the TOOLS menu
 
 
 2.2.2019
 2.2.2019