From 4cc88ec5fef1613ac2c4a358f64669b75a7ad6ac Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Wed, 25 Nov 2020 14:24:47 +0200 Subject: [PATCH] - fixed an error in Geo Editor when trying to save an empty Geometry - in Preferences made sure that clicking the Restore Defaults will update the values in the Preferences Tab - some changes in the Tools visibility in the Tools ToolBar --- CHANGELOG.md | 3 +++ appEditors/AppGeoEditor.py | 13 ++++++++----- appGUI/MainGUI.py | 14 ++++++++++++++ appGUI/preferences/PreferencesUIManager.py | 1 + app_Main.py | 5 +++-- 5 files changed, 29 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 721d8275..fcfdbaab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ CHANGELOG for FlatCAM beta - had a first shot in creating a way to show the log messages in the Tcl Shell if a setting in Preferences is set - fixed Isolation Tool tool table context menu pointing at the same method for the menu entries: Add Tool and Pick from DB - made sure that the GUI element FCInputDialogSpinnerButton has the spinner element auto-selected on launch +- fixed an error in Geo Editor when trying to save an empty Geometry +- in Preferences made sure that clicking the Restore Defaults will update the values in the Preferences Tab +- some changes in the Tools visibility in the Tools ToolBar 24.11.2020 diff --git a/appEditors/AppGeoEditor.py b/appEditors/AppGeoEditor.py index edd961c2..e267c696 100644 --- a/appEditors/AppGeoEditor.py +++ b/appEditors/AppGeoEditor.py @@ -4872,11 +4872,14 @@ class AppGeoEditor(QtCore.QObject): new_geo = linemerge(new_geo) fcgeometry.solid_geometry.append(new_geo) - bounds = fcgeometry.bounds() - fcgeometry.options['xmin'] = bounds[0] - fcgeometry.options['ymin'] = bounds[1] - fcgeometry.options['xmax'] = bounds[2] - fcgeometry.options['ymax'] = bounds[3] + try: + bounds = fcgeometry.bounds() + fcgeometry.options['xmin'] = bounds[0] + fcgeometry.options['ymin'] = bounds[1] + fcgeometry.options['xmax'] = bounds[2] + fcgeometry.options['ymax'] = bounds[3] + except Exception: + pass self.deactivate() diff --git a/appGUI/MainGUI.py b/appGUI/MainGUI.py index bbc48434..150a3035 100644 --- a/appGUI/MainGUI.py +++ b/appGUI/MainGUI.py @@ -1080,6 +1080,13 @@ class MainGUI(QtWidgets.QMainWindow): self.toolbartools.addSeparator() + self.align_btn = self.toolbartools.addAction( + QtGui.QIcon(self.app.resource_location + '/align32.png'), _("Align Objects Tool")) + # self.sub_btn = self.toolbartools.addAction( + # QtGui.QIcon(self.app.resource_location + '/sub32.png'), _("Subtract Tool")) + + self.toolbartools.addSeparator() + self.extract_btn = self.toolbartools.addAction( QtGui.QIcon(self.app.resource_location + '/extract32.png'), _("Extract Tool")) self.copperfill_btn = self.toolbartools.addAction( @@ -2277,6 +2284,13 @@ class MainGUI(QtWidgets.QMainWindow): self.toolbartools.addSeparator() + self.align_btn = self.toolbartools.addAction( + QtGui.QIcon(self.app.resource_location + '/align32.png'), _("Align Objects Tool")) + # self.sub_btn = self.toolbartools.addAction( + # QtGui.QIcon(self.app.resource_location + '/sub32.png'), _("Subtract Tool")) + + self.toolbartools.addSeparator() + self.extract_btn = self.toolbartools.addAction( QtGui.QIcon(self.app.resource_location + '/extract32.png'), _("Extract Tool")) self.copperfill_btn = self.toolbartools.addAction( diff --git a/appGUI/preferences/PreferencesUIManager.py b/appGUI/preferences/PreferencesUIManager.py index 54b38371..13ca0126 100644 --- a/appGUI/preferences/PreferencesUIManager.py +++ b/appGUI/preferences/PreferencesUIManager.py @@ -1052,6 +1052,7 @@ class PreferencesUIManager: """ log.debug("on_restore_defaults_preferences()") self.defaults.reset_to_factory_defaults() + self.defaults_write_form() self.on_preferences_edited() self.inform.emit('[success] %s' % _("Preferences default values are restored.")) diff --git a/app_Main.py b/app_Main.py index 6ce9c6ef..7355e1e7 100644 --- a/app_Main.py +++ b/app_Main.py @@ -2176,6 +2176,9 @@ class App(QtCore.QObject): self.ui.film_btn.triggered.connect(lambda: self.film_tool.run(toggle=True)) self.ui.dblsided_btn.triggered.connect(lambda: self.dblsidedtool.run(toggle=True)) + self.ui.align_btn.triggered.connect(lambda: self.align_objects_tool.run(toggle=True)) + # self.ui.sub_btn.triggered.connect(lambda: self.sub_tool.run(toggle=True)) + self.ui.extract_btn.triggered.connect(lambda: self.extract_tool.run(toggle=True)) self.ui.copperfill_btn.triggered.connect(lambda: self.copper_thieving_tool.run(toggle=True)) self.ui.corners_tool_btn.triggered.connect(lambda: self.corners_tool.run(toggle=True)) @@ -2183,10 +2186,8 @@ class App(QtCore.QObject): self.ui.calculators_btn.triggered.connect(lambda: self.calculator_tool.run(toggle=True)) # self.ui.cal_btn.triggered.connect(lambda: self.cal_exc_tool.run(toggle=True)) - # self.ui.align_btn.triggered.connect(lambda: self.align_objects_tool.run(toggle=True)) # # self.ui.solder_btn.triggered.connect(lambda: self.paste_tool.run(toggle=True)) - # self.ui.sub_btn.triggered.connect(lambda: self.sub_tool.run(toggle=True)) # self.ui.rules_btn.triggered.connect(lambda: self.rules_tool.run(toggle=True)) # self.ui.optimal_btn.triggered.connect(lambda: self.optimal_tool.run(toggle=True)) #