diff --git a/CHANGELOG.md b/CHANGELOG.md index bfd66227..c7c621ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ CHANGELOG for FlatCAM beta - fixed an issue for importing DXF as Geometry when the DXF geometry is a single line - updated the convert_any2geo() method such that resulting geometry objects have the tools attribute required in the newer versions of the app - added a way to keep compatibility with old projects +- some small fixes in the Geo Editor such that the Tool Tab is no longer shown on Editor Exit if it was used by an Editor sub-tool 21.11.2020 diff --git a/appEditors/AppGeoEditor.py b/appEditors/AppGeoEditor.py index da2679c7..2e81afa0 100644 --- a/appEditors/AppGeoEditor.py +++ b/appEditors/AppGeoEditor.py @@ -652,10 +652,10 @@ class PaintOptionsTool(AppTool): self.fcdraw.paint(tooldia, overlap, margin, connect=connect, contour=contour, method=method) self.fcdraw.select_tool("select") - self.app.ui.notebook.setTabText(2, _("Tools")) - self.app.ui.notebook.setCurrentWidget(self.app.ui.project_tab) - - self.app.ui.splitter.setSizes([0, 1]) + # self.app.ui.notebook.setTabText(2, _("Tools")) + # self.app.ui.notebook.setCurrentWidget(self.app.ui.project_tab) + # + # self.app.ui.splitter.setSizes([0, 1]) class TransformEditorTool(AppTool): @@ -2987,7 +2987,7 @@ class FCText(FCShapeTool): (_("Font not supported. Only Regular, Bold, Italic and BoldItalic are " "supported. Error"), str(e))) self.text_gui.text_path = [] - self.text_gui.hide_tool() + # self.text_gui.hide_tool() self.draw_app.select_tool('select') self.draw_app.app.jump_signal.disconnect() return @@ -3068,8 +3068,6 @@ class FCBuffer(FCShapeTool): # I populated the combobox such that the index coincide with the join styles value (whcih is really an INT) join_style = self.buff_tool.buffer_corner_cb.currentIndex() + 1 ret_val = self.draw_app.buffer(buffer_distance, join_style) - self.app.ui.notebook.setTabText(2, _("Tools")) - self.draw_app.app.ui.splitter.setSizes([0, 1]) self.disactivate() if ret_val == 'fail': @@ -3096,8 +3094,6 @@ class FCBuffer(FCShapeTool): # I populated the combobox such that the index coincide with the join styles value (whcih is really an INT) join_style = self.buff_tool.buffer_corner_cb.currentIndex() + 1 ret_val = self.draw_app.buffer_int(buffer_distance, join_style) - self.app.ui.notebook.setTabText(2, _("Tools")) - self.draw_app.app.ui.splitter.setSizes([0, 1]) self.disactivate() if ret_val == 'fail': @@ -3124,8 +3120,8 @@ class FCBuffer(FCShapeTool): # I populated the combobox such that the index coincide with the join styles value (whcih is really an INT) join_style = self.buff_tool.buffer_corner_cb.currentIndex() + 1 ret_val = self.draw_app.buffer_ext(buffer_distance, join_style) - self.app.ui.notebook.setTabText(2, _("Tools")) - self.draw_app.app.ui.splitter.setSizes([0, 1]) + # self.app.ui.notebook.setTabText(2, _("Tools")) + # self.draw_app.app.ui.splitter.setSizes([0, 1]) self.disactivate() if ret_val == 'fail': @@ -3151,7 +3147,7 @@ class FCBuffer(FCShapeTool): self.buff_tool.buffer_ext_button.clicked.connect(self.buff_tool.on_buffer_ext) self.complete = True self.draw_app.select_tool("select") - self.buff_tool.hide_tool() + # self.buff_tool.hide_tool() try: self.draw_app.app.jump_signal.disconnect() except (TypeError, AttributeError): diff --git a/app_Main.py b/app_Main.py index 0bb51048..f577593e 100644 --- a/app_Main.py +++ b/app_Main.py @@ -2566,9 +2566,14 @@ class App(QtCore.QObject): tools_tb.show() # clean the Tools Tab - self.ui.tool_scroll_area.takeWidget() - self.ui.tool_scroll_area.setWidget(QtWidgets.QWidget()) - self.ui.notebook.setTabText(2, _("Tool")) + found_idx = None + for idx in range(self.ui.notebook.count()): + if self.ui.notebook.widget(idx).objectName() == "tool_tab": + found_idx = idx + break + if found_idx: + self.ui.notebook.setCurrentWidget(self.ui.properties_tab) + self.ui.notebook.removeTab(2) if edited_obj.kind == 'geometry': obj_type = "Geometry" @@ -2672,9 +2677,14 @@ class App(QtCore.QObject): tools_tb.show() # clean the Tools Tab - self.ui.tool_scroll_area.takeWidget() - self.ui.tool_scroll_area.setWidget(QtWidgets.QWidget()) - self.ui.notebook.setTabText(2, _("Tool")) + found_idx = None + for idx in range(self.ui.notebook.count()): + if self.ui.notebook.widget(idx).objectName() == "tool_tab": + found_idx = idx + break + if found_idx: + self.ui.notebook.setCurrentWidget(self.ui.properties_tab) + self.ui.notebook.removeTab(2) self.inform.emit('[WARNING_NOTCL] %s' % _("Editor exited. Editor content was not saved.")) @@ -2716,15 +2726,17 @@ class App(QtCore.QObject): if self.old_state_of_tools_toolbar is True: tools_tb.show() - if isinstance(edited_obj, GeometryObject): + if edited_obj.kind == 'geometry': self.geo_editor.deactivate() - elif isinstance(edited_obj, GerberObject): + elif edited_obj.kind == 'gerber': self.grb_editor.deactivate_grb_editor() - elif isinstance(edited_obj, ExcellonObject): + elif edited_obj.kind == 'excellon': self.exc_editor.deactivate() + elif edited_obj.kind == 'cncjob': + self.gcode_editor.deactivate() else: self.inform.emit('[WARNING_NOTCL] %s' % - _("Select a Gerber, Geometry or Excellon Object to update.")) + _("Select a Gerber, Geometry, Excellon or CNCJob object to update.")) return # if notebook is hidden we show it