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

- started t omake some changs in Geometry Editor

Marius Stanciu 6 лет назад
Родитель
Сommit
64ff4fb9fd
3 измененных файлов с 29 добавлено и 13 удалено
  1. 2 3
      FlatCAMApp.py
  2. 1 0
      README.md
  3. 26 10
      flatcamEditors/FlatCAMGeoEditor.py

+ 2 - 3
FlatCAMApp.py

@@ -3314,8 +3314,7 @@ class App(QtCore.QObject):
                 isinstance(edited_object, FlatCAMExcellon):
             pass
         else:
-            self.inform.emit('[WARNING_NOTCL] %s' %
-                             _("Select a Geometry, Gerber or Excellon Object to edit."))
+            self.inform.emit('[WARNING_NOTCL] %s' % _("Select a Geometry, Gerber or Excellon Object to edit."))
             return
 
         if isinstance(edited_object, FlatCAMGeometry):
@@ -3323,7 +3322,7 @@ class App(QtCore.QObject):
             self.geo_editor.toolbar_old_state = True if self.ui.geo_edit_toolbar.isVisible() else False
 
             # we set the notebook to hidden
-            self.ui.splitter.setSizes([0, 1])
+            # self.ui.splitter.setSizes([0, 1])
 
             if edited_object.multigeo is True:
                 sel_rows = [item.row() for item in edited_object.ui.geo_tools_table.selectedItems()]

+ 1 - 0
README.md

@@ -15,6 +15,7 @@ CAD program, and create G-Code for Isolation routing.
 - more work in Punch Gerber Tool
 - the Jump To popup window will now autoselect the LineEdit therefore no more need for an extra click after launching the function
 - made some structural changes in Properties Tool
+- started t omake some changs in Geometry Editor
 
 24.02.2020
 

+ 26 - 10
flatcamEditors/FlatCAMGeoEditor.py

@@ -3341,10 +3341,25 @@ class FlatCAMGeoEditor(QtCore.QObject):
         self.delete_selected()
         self.replot()
 
+    def set_ui(self):
+        # updated units
+        self.units = self.app.defaults['units'].upper()
+        self.decimals = self.app.decimals
+
+    def build_ui(self, first_run=None):
+
+        # try:
+        #     # if connected, disconnect the signal from the slot on item_changed as it creates issues
+        #     self.apertures_table.itemChanged.disconnect()
+        # except (TypeError, AttributeError):
+        #     pass
+        pass
+
     def activate(self):
         # adjust the status of the menu entries related to the editor
         self.app.ui.menueditedit.setDisabled(True)
         self.app.ui.menueditok.setDisabled(False)
+
         # adjust the visibility of some of the canvas context menu
         self.app.ui.popmenu_edit.setVisible(False)
         self.app.ui.popmenu_save.setVisible(True)
@@ -3382,9 +3397,9 @@ class FlatCAMGeoEditor(QtCore.QObject):
         self.app.ui.g_editor_cmenu.menuAction().setVisible(True)
 
         # prevent the user to change anything in the Selected Tab while the Geo Editor is active
-        sel_tab_widget_list = self.app.ui.selected_tab.findChildren(QtWidgets.QWidget)
-        for w in sel_tab_widget_list:
-            w.setEnabled(False)
+        # sel_tab_widget_list = self.app.ui.selected_tab.findChildren(QtWidgets.QWidget)
+        # for w in sel_tab_widget_list:
+        #     w.setEnabled(False)
 
         # Tell the App that the editor is active
         self.editor_active = True
@@ -3399,6 +3414,7 @@ class FlatCAMGeoEditor(QtCore.QObject):
         # adjust the status of the menu entries related to the editor
         self.app.ui.menueditedit.setDisabled(False)
         self.app.ui.menueditok.setDisabled(True)
+
         # adjust the visibility of some of the canvas context menu
         self.app.ui.popmenu_edit.setVisible(True)
         self.app.ui.popmenu_save.setVisible(False)
@@ -3456,13 +3472,13 @@ class FlatCAMGeoEditor(QtCore.QObject):
         self.app.ui.e_editor_cmenu.menuAction().setVisible(False)
         self.app.ui.g_editor_cmenu.menuAction().setVisible(False)
 
-        try:
-            # re-enable all the widgets in the Selected Tab that were disabled after entering in Edit Geometry Mode
-            sel_tab_widget_list = self.app.ui.selected_tab.findChildren(QtWidgets.QWidget)
-            for w in sel_tab_widget_list:
-                w.setEnabled(True)
-        except Exception as e:
-            log.debug("FlatCAMGeoEditor.deactivate() --> %s" % str(e))
+        # try:
+        #     # re-enable all the widgets in the Selected Tab that were disabled after entering in Edit Geometry Mode
+        #     sel_tab_widget_list = self.app.ui.selected_tab.findChildren(QtWidgets.QWidget)
+        #     for w in sel_tab_widget_list:
+        #         w.setEnabled(True)
+        # except Exception as e:
+        #     log.debug("FlatCAMGeoEditor.deactivate() --> %s" % str(e))
 
         # Show original geometry
         if self.fcgeometry: