Browse Source

- in Gerber and Excellon UI added buttons to start the Editor
- in all Editors Selected Tab added a button to Exit the Editor

Marius Stanciu 5 years ago
parent
commit
24192540d7

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

+ 16 - 1
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 = {

+ 17 - 0
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},

+ 16 - 1
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 = {

+ 26 - 0
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 ###########################################
         # #################################################################

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

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