From 24192540d7b16408a0ccf709ef288cdb7a5f68f3 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Fri, 10 Jul 2020 05:03:54 +0300 Subject: [PATCH] - in Gerber and Excellon UI added buttons to start the Editor - in all Editors Selected Tab added a button to Exit the Editor --- CHANGELOG.md | 2 ++ appEditors/AppExcEditor.py | 17 ++++++++++++++++- appEditors/AppGeoEditor.py | 17 +++++++++++++++++ appEditors/AppGerberEditor.py | 17 ++++++++++++++++- appGUI/ObjectUI.py | 26 ++++++++++++++++++++++++++ appObjects/FlatCAMExcellon.py | 3 +++ appObjects/FlatCAMGerber.py | 3 +++ 7 files changed, 83 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb2cd107..400d0200 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ CHANGELOG for FlatCAM beta - Tool Drilling - moved some of the Excellon Preferences related to drilling operation to it's own group Drilling Tool Options - optimized the CNCJob UI to look like other parts of the app +- in Gerber and Excellon UI added buttons to start the Editor +- in all Editors Selected Tab added a button to Exit the Editor 9.07.2020 diff --git a/appEditors/AppExcEditor.py b/appEditors/AppExcEditor.py index 26b80931..ba473126 100644 --- a/appEditors/AppExcEditor.py +++ b/appEditors/AppExcEditor.py @@ -2028,7 +2028,22 @@ class AppExcEditor(QtCore.QObject): self.slot_array_frame.hide() - self.tools_box.addStretch() + layout.addStretch() + + # Editor + self.exit_editor_button = QtWidgets.QPushButton(_('Exit Editor')) + self.exit_editor_button.setToolTip( + _("Exit from Editor.") + ) + self.exit_editor_button.setStyleSheet(""" + QPushButton + { + font-weight: bold; + } + """) + layout.addWidget(self.exit_editor_button) + + self.exit_editor_button.clicked.connect(lambda: self.app.editor2object()) # ## Toolbar events and properties self.tools_exc = { diff --git a/appEditors/AppGeoEditor.py b/appEditors/AppGeoEditor.py index fe572306..ab37dca5 100644 --- a/appEditors/AppGeoEditor.py +++ b/appEditors/AppGeoEditor.py @@ -3295,6 +3295,23 @@ class AppGeoEditor(QtCore.QObject): self.geo_parent = self.tw.invisibleRootItem() + layout.addStretch() + + # Editor + self.exit_editor_button = QtWidgets.QPushButton(_('Exit Editor')) + self.exit_editor_button.setToolTip( + _("Exit from Editor.") + ) + self.exit_editor_button.setStyleSheet(""" + QPushButton + { + font-weight: bold; + } + """) + layout.addWidget(self.exit_editor_button) + + self.exit_editor_button.clicked.connect(lambda: self.app.editor2object()) + # ## Toolbar events and properties self.tools = { "select": {"button": self.app.ui.geo_select_btn, "constructor": FCSelect}, diff --git a/appEditors/AppGerberEditor.py b/appEditors/AppGerberEditor.py index 30b7bd99..a1c66aca 100644 --- a/appEditors/AppGerberEditor.py +++ b/appEditors/AppGerberEditor.py @@ -2892,7 +2892,22 @@ class AppGerberEditor(QtCore.QObject): self.array_frame.hide() - self.custom_box.addStretch() + layout.addStretch() + + # Editor + self.exit_editor_button = QtWidgets.QPushButton(_('Exit Editor')) + self.exit_editor_button.setToolTip( + _("Exit from Editor.") + ) + self.exit_editor_button.setStyleSheet(""" + QPushButton + { + font-weight: bold; + } + """) + layout.addWidget(self.exit_editor_button) + + self.exit_editor_button.clicked.connect(lambda: self.app.editor2object()) # Toolbar events and properties self.tools_gerber = { diff --git a/appGUI/ObjectUI.py b/appGUI/ObjectUI.py index a3e25c92..380a3c41 100644 --- a/appGUI/ObjectUI.py +++ b/appGUI/ObjectUI.py @@ -311,6 +311,19 @@ class GerberObjectUI(ObjectUI): ) self.custom_box.addWidget(self.create_buffer_button) + # Editor + self.editor_button = QtWidgets.QPushButton(_('Gerber Editor')) + self.editor_button.setToolTip( + _("Edit an Gerber object.") + ) + self.editor_button.setStyleSheet(""" + QPushButton + { + font-weight: bold; + } + """) + self.custom_box.addWidget(self.editor_button) + separator_line = QtWidgets.QFrame() separator_line.setFrameShape(QtWidgets.QFrame.HLine) separator_line.setFrameShadow(QtWidgets.QFrame.Sunken) @@ -584,6 +597,19 @@ class ExcellonObjectUI(ObjectUI): # this column is not used; reserved for future usage self.tools_table.setColumnHidden(4, True) + # Editor + self.editor_button = QtWidgets.QPushButton(_('Excellon Editor')) + self.editor_button.setToolTip( + _("Edit an Excellon object.") + ) + self.editor_button.setStyleSheet(""" + QPushButton + { + font-weight: bold; + } + """) + self.tools_box.addWidget(self.editor_button) + # ################################################################# # ########## TOOLS GRID ########################################### # ################################################################# diff --git a/appObjects/FlatCAMExcellon.py b/appObjects/FlatCAMExcellon.py index 09d9b27e..1c36e932 100644 --- a/appObjects/FlatCAMExcellon.py +++ b/appObjects/FlatCAMExcellon.py @@ -268,6 +268,9 @@ class ExcellonObject(FlatCAMObj, Excellon): self.ui.solid_cb.stateChanged.connect(self.on_solid_cb_click) self.ui.multicolored_cb.stateChanged.connect(self.on_multicolored_cb_click) + # Editor + self.ui.editor_button.clicked.connect(lambda: self.app.object2editor()) + self.ui.drill_button.clicked.connect(lambda: self.app.drilling_tool.run(toggle=True)) # self.ui.milling_button.clicked.connect(lambda: self.app.milling_tool.run(toggle=True)) diff --git a/appObjects/FlatCAMGerber.py b/appObjects/FlatCAMGerber.py index 25d759d3..5ecadb8a 100644 --- a/appObjects/FlatCAMGerber.py +++ b/appObjects/FlatCAMGerber.py @@ -207,6 +207,9 @@ class GerberObject(FlatCAMObj, Gerber): self.ui.solid_cb.stateChanged.connect(self.on_solid_cb_click) self.ui.multicolored_cb.stateChanged.connect(self.on_multicolored_cb_click) + # Editor + self.ui.editor_button.clicked.connect(lambda: self.app.object2editor()) + # Tools self.ui.iso_button.clicked.connect(self.app.isolation_tool.run) self.ui.generate_ncc_button.clicked.connect(self.app.ncclear_tool.run)