Parcourir la source

- added Editor Push buttons in Geometry and CNCJob UI's

Marius Stanciu il y a 5 ans
Parent
commit
7b891900be

+ 2 - 0
CHANGELOG.md

@@ -10,6 +10,8 @@ CHANGELOG for FlatCAM beta
 15.07.2020
 
 - added icons to some of the push buttons
+- Tool Drilling - automatically switch to the Selected Tab after job finished
+- added Editor Push buttons in Geometry and CNCJob UI's
 
 14.07.2020
 

+ 1 - 0
appEditors/AppExcEditor.py

@@ -4195,6 +4195,7 @@ class AppExcEditorUI:
 
         # Editor
         self.exit_editor_button = QtWidgets.QPushButton(_('Exit Editor'))
+        self.exit_editor_button.setIcon(QtGui.QIcon(self.app.resource_location + '/power16.png'))
         self.exit_editor_button.setToolTip(
             _("Exit from Editor.")
         )

+ 1 - 0
appEditors/AppGeoEditor.py

@@ -3299,6 +3299,7 @@ class AppGeoEditor(QtCore.QObject):
 
         # Editor
         self.exit_editor_button = QtWidgets.QPushButton(_('Exit Editor'))
+        self.exit_editor_button.setIcon(QtGui.QIcon(self.app.resource_location + '/power16.png'))
         self.exit_editor_button.setToolTip(
             _("Exit from Editor.")
         )

+ 1 - 0
appEditors/AppGerberEditor.py

@@ -2896,6 +2896,7 @@ class AppGerberEditor(QtCore.QObject):
 
         # Editor
         self.exit_editor_button = QtWidgets.QPushButton(_('Exit Editor'))
+        self.exit_editor_button.setIcon(QtGui.QIcon(self.app.resource_location + '/power16.png'))
         self.exit_editor_button.setToolTip(
             _("Exit from Editor.")
         )

+ 28 - 8
appGUI/ObjectUI.py

@@ -1860,6 +1860,26 @@ class CNCObjectUI(ObjectUI):
         )
         self.custom_box.addWidget(self.updateplot_button)
 
+        # Editor
+        self.editor_button = QtWidgets.QPushButton(_('GCode Editor'))
+        self.editor_button.setIcon(QtGui.QIcon(self.app.resource_location + '/edit_file32.png'))
+
+        self.editor_button.setToolTip(
+            _("Edit an GCode 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)
+        self.custom_box.addWidget(separator_line)
+
         # ####################
         # ## Export G-Code ##
         # ####################
@@ -1991,13 +2011,13 @@ class CNCObjectUI(ObjectUI):
         h_lay = QtWidgets.QHBoxLayout()
         h_lay.setAlignment(QtCore.Qt.AlignVCenter)
         self.custom_box.addLayout(h_lay)
-
-        # Edit GCode Button
-        self.modify_gcode_button = QtWidgets.QPushButton(_('View CNC Code'))
-        self.modify_gcode_button.setToolTip(
-            _("Opens TAB to view/modify/print G-Code\n"
-              "file.")
-        )
+        #
+        # # Edit GCode Button
+        # self.modify_gcode_button = QtWidgets.QPushButton(_('View CNC Code'))
+        # self.modify_gcode_button.setToolTip(
+        #     _("Opens TAB to view/modify/print G-Code\n"
+        #       "file.")
+        # )
 
         # GO Button
         self.export_gcode_button = QtWidgets.QPushButton(_('Save CNC Code'))
@@ -2006,7 +2026,7 @@ class CNCObjectUI(ObjectUI):
               "file.")
         )
 
-        h_lay.addWidget(self.modify_gcode_button)
+        # h_lay.addWidget(self.modify_gcode_button)
         h_lay.addWidget(self.export_gcode_button)
         # self.custom_box.addWidget(self.export_gcode_button)
 

+ 1 - 1
appObjects/FlatCAMCNCJob.py

@@ -436,7 +436,7 @@ class CNCJobObject(FlatCAMObj, CNCjob):
 
         self.ui.updateplot_button.clicked.connect(self.on_updateplot_button_click)
         self.ui.export_gcode_button.clicked.connect(self.on_exportgcode_button_click)
-        self.ui.modify_gcode_button.clicked.connect(self.on_edit_code_click)
+        self.ui.editor_button.clicked.connect(self.on_edit_code_click)
 
         self.ui.tc_variable_combo.currentIndexChanged[str].connect(self.on_cnc_custom_parameters)
 

+ 2 - 0
appObjects/FlatCAMGeometry.py

@@ -611,6 +611,8 @@ class GeometryObject(FlatCAMObj, Geometry):
         self.ui.plot_cb.stateChanged.connect(self.on_plot_cb_click)
         self.ui.multicolored_cb.stateChanged.connect(self.on_multicolored_cb_click)
 
+        self.ui.editor_button.clicked.connect(self.app.object2editor)
+
         self.ui.generate_cnc_button.clicked.connect(self.on_generatecnc_button_click)
         self.ui.paint_tool_button.clicked.connect(lambda: self.app.paint_tool.run(toggle=False))
         self.ui.generate_ncc_button.clicked.connect(lambda: self.app.ncclear_tool.run(toggle=False))

+ 3 - 0
appTools/ToolDrilling.py

@@ -1826,6 +1826,9 @@ class ToolDrilling(AppTool, Excellon):
             with self.app.proc_container.new(_("Generating CNC Code")):
                 a_obj.app_obj.new_object("cncjob", job_name, job_init)
 
+            # Switch notebook to Selected page
+            self.app.ui.notebook.setCurrentWidget(self.app.ui.selected_tab)
+
         # Create promise for the new name.
         self.app.collection.promise(job_name)