- GCode Editor - fixed the issue with the editor toolbar buttons not being updated like for the other editors

- GCode Editor - the plot_area tab GCode editor that is added will close the Editor when the tab itself is closed
This commit is contained in:
Marius Stanciu
2020-12-13 22:37:26 +02:00
committed by Marius
parent 8940a7d344
commit 466e2d6b81
3 changed files with 219 additions and 205 deletions

View File

@@ -7,6 +7,11 @@ CHANGELOG for FlatCAM beta
=================================================
13.12.2020
- GCode Editor - fixed the issue with the editor toolbar buttons not being updated like for the other editors
- GCode Editor - the plot_area tab GCode editor that is added will close the Editor when the tab itself is closed
12.12.2020
- added an experimental 3D area (archball camera)

View File

@@ -71,10 +71,11 @@ class AppGCodeEditor(QtCore.QObject):
# add the tab if it was closed
self.app.ui.plot_tab_area.addTab(self.ui.gcode_editor_tab, '%s' % _("Code Editor"))
self.ui.gcode_editor_tab.setObjectName('gcode_editor_tab')
# protect the tab that was just added
for idx in range(self.app.ui.plot_tab_area.count()):
if self.app.ui.plot_tab_area.widget(idx).objectName() == self.ui.gcode_editor_tab.objectName():
self.app.ui.plot_tab_area.protectTab(idx)
# for idx in range(self.app.ui.plot_tab_area.count()):
# if self.app.ui.plot_tab_area.widget(idx).objectName() == self.ui.gcode_editor_tab.objectName():
# self.app.ui.plot_tab_area.protectTab(idx)
# delete the absolute and relative position and messages in the infobar
self.app.ui.position_label.setText("")
@@ -617,9 +618,13 @@ class AppGCodeEditor(QtCore.QObject):
def activate(self):
self.app.call_source = 'gcode_editor'
self.app.ui.editor_exit_btn_ret_action.setVisible(True)
self.app.ui.editor_start_btn.setVisible(False)
def deactivate(self):
self.app.call_source = 'app'
self.app.ui.editor_exit_btn_ret_action.setVisible(False)
self.app.ui.editor_start_btn.setVisible(True)
def on_name_activate(self):
self.edited_obj_name = self.ui.name_entry.get_value()

View File

@@ -2587,7 +2587,9 @@ class App(QtCore.QObject):
self.ui.menuobjects.setDisabled(False)
# do not update a geometry or excellon object unless it comes out of an editor
if self.call_source != 'app':
if self.call_source == 'app':
return
edited_obj = self.collection.get_active()
if cleanup is None:
@@ -6218,9 +6220,11 @@ class App(QtCore.QObject):
elif tab_obj_name == "bookmarks_tab":
self.book_dialog_tab.rebuild_actions()
self.book_dialog_tab.deleteLater()
elif tab_obj_name == '3D_area_tab':
elif tab_obj_name == "3D_area_tab":
self.area_3d_tab.deleteLater()
self.area_3d_tab = QtWidgets.QWidget()
elif tab_obj_name == "gcode_editor_tab":
self.editor2object()
else:
pass