From e1824a09f756770dfb43a9defbc84ab48edd3785 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Thu, 31 Mar 2022 11:40:50 +0300 Subject: [PATCH] - make sure that the state of the workspace is saved correctly on change --- CHANGELOG.md | 1 + appGUI/PlotCanvas.py | 2 ++ appGUI/PlotCanvasLegacy.py | 2 ++ appMain.py | 2 +- 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05f21103..08eb0e63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ CHANGELOG for FlatCAM Evo beta 31.03.2022 - changed the app main icons, hopefully they are more visible on black backgrounds than the ones that FlatCAM has +- make sure that the state of the workspace is saved correctly on change 30.03.2022 diff --git a/appGUI/PlotCanvas.py b/appGUI/PlotCanvas.py index 40d018c8..68bf01eb 100644 --- a/appGUI/PlotCanvas.py +++ b/appGUI/PlotCanvas.py @@ -450,6 +450,7 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas): background-color: olivedrab; } """) + self.fcapp.options['global_workspace'] = True def delete_workspace(self): try: @@ -457,6 +458,7 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas): except Exception: pass self.fcapp.ui.wplace_label.setStyleSheet("") + self.fcapp.options['global_workspace'] = False # redraw the workspace lines on the plot by re adding them to the parent view.scene def restore_workspace(self): diff --git a/appGUI/PlotCanvasLegacy.py b/appGUI/PlotCanvasLegacy.py index 497724f0..2b5609e8 100644 --- a/appGUI/PlotCanvasLegacy.py +++ b/appGUI/PlotCanvasLegacy.py @@ -581,6 +581,7 @@ class PlotCanvasLegacy(QtCore.QObject): background-color: olivedrab; } """) + self.app.options['global_workspace'] = True def delete_workspace(self): try: @@ -589,6 +590,7 @@ class PlotCanvasLegacy(QtCore.QObject): except Exception: pass self.app.ui.wplace_label.setStyleSheet("") + self.app.options['global_workspace'] = False def graph_event_connect(self, event_name, callback): """ diff --git a/appMain.py b/appMain.py index 14804cdf..7c1ad13b 100644 --- a/appMain.py +++ b/appMain.py @@ -1833,7 +1833,7 @@ class App(QtCore.QObject): return os.path.join(self.data_path, 'log.txt') def on_options_value_changed(self, key_changed): - # when changing those properties the associated keys change so we get an updated Properties default Tab + # when changing those properties the associated keys change, so we get an updated Properties default Tab if key_changed in [ "global_grid_lines", "global_grid_snap", "global_axis", "global_workspace", "global_workspaceT", "global_workspace_orientation", "global_hud"