From 64ff4fb9fd13c13318124a7a9e87a128ce7a889c Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Mon, 27 Jan 2020 17:43:00 +0200 Subject: [PATCH] - started t omake some changs in Geometry Editor --- FlatCAMApp.py | 5 ++--- README.md | 1 + flatcamEditors/FlatCAMGeoEditor.py | 36 +++++++++++++++++++++--------- 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/FlatCAMApp.py b/FlatCAMApp.py index a97d67f6..db4c9ad1 100644 --- a/FlatCAMApp.py +++ b/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()] diff --git a/README.md b/README.md index caf14993..ed74004a 100644 --- a/README.md +++ b/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 diff --git a/flatcamEditors/FlatCAMGeoEditor.py b/flatcamEditors/FlatCAMGeoEditor.py index 4dbf6389..340c61bc 100644 --- a/flatcamEditors/FlatCAMGeoEditor.py +++ b/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: