From 2cff6dc854a42d5b20ad642cd56886151982ca29 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Mon, 2 Nov 2020 04:25:42 +0200 Subject: [PATCH] - made sure that the object selection will not work while in Editors or in the App Tools - some minor changes to strings and icons --- CHANGELOG.md | 2 ++ appGUI/MainGUI.py | 6 +++--- app_Main.py | 11 +++++++---- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b0aa775..5db88bd3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ CHANGELOG for FlatCAM beta - fixed the Tcl COmmand Panelize, Excellon panelization section - Fixed an issue in Tool Calibration export_excellon method call - PEP8 corrections all over the app +- made sure that the object selection will not work while in Editors or in the App Tools +- some minor changes to strings and icons 1.11.2020 diff --git a/appGUI/MainGUI.py b/appGUI/MainGUI.py index b969493c..446b5d5a 100644 --- a/appGUI/MainGUI.py +++ b/appGUI/MainGUI.py @@ -342,8 +342,8 @@ class MainGUI(QtWidgets.QMainWindow): QtGui.QIcon(self.app.resource_location + '/edit16.png'), '%s\t%s' % (_('Edit Object'), _('E'))) self.menueditok = self.menuedit.addAction( - QtGui.QIcon(self.app.resource_location + '/edit_ok16.png'), - '%s\t%s' % (_('Close Editor'), _('Ctrl+S'))) + QtGui.QIcon(self.app.resource_location + '/power16.png'), + '%s\t%s' % (_('Exit Editor'), _('Ctrl+S'))) # adjust the initial state of the menu entries related to the editor self.menueditedit.setDisabled(False) @@ -1693,7 +1693,7 @@ class MainGUI(QtWidgets.QMainWindow): self.popmenu_edit = self.popMenu.addAction( QtGui.QIcon(self.app.resource_location + '/edit32.png'), _("Edit")) self.popmenu_save = self.popMenu.addAction( - QtGui.QIcon(self.app.resource_location + '/floppy32.png'), _("Close Editor")) + QtGui.QIcon(self.app.resource_location + '/power16.png'), _("Exit Editor")) self.popmenu_save.setVisible(False) self.popMenu.addSeparator() diff --git a/app_Main.py b/app_Main.py index 07ef7a93..fec89aa2 100644 --- a/app_Main.py +++ b/app_Main.py @@ -2357,7 +2357,6 @@ class App(QtCore.QObject): :return: None """ self.defaults.report_usage("object2editor()") - self.log.debug("######################### Starting the EDITOR ################################") # disable the objects menu as it may interfere with the appEditors self.ui.menuobjects.setDisabled(True) @@ -2469,6 +2468,7 @@ class App(QtCore.QObject): self.ui.plot_tab_area.setTabText(0, _("EDITOR Area")) self.ui.plot_tab_area.protectTab(0) + self.log.debug("######################### Starting the EDITOR ################################") self.inform.emit('[WARNING_NOTCL] %s' % _("Editor is activated ...")) self.should_we_save = True @@ -2480,7 +2480,6 @@ class App(QtCore.QObject): :return: None """ self.defaults.report_usage("editor2object()") - self.log.debug("######################### Closing the EDITOR ################################") # re-enable the objects menu that was disabled on entry in Editor mode self.ui.menuobjects.setDisabled(False) @@ -2492,7 +2491,7 @@ class App(QtCore.QObject): if cleanup is None: msgbox = QtWidgets.QMessageBox() msgbox.setText(_("Do you want to save the edited object?")) - msgbox.setWindowTitle(_("Close Editor")) + msgbox.setWindowTitle(_("Exit Editor")) msgbox.setWindowIcon(QtGui.QIcon(self.resource_location + '/save_as.png')) msgbox.setIcon(QtWidgets.QMessageBox.Question) @@ -2688,6 +2687,7 @@ class App(QtCore.QObject): # restore the call_source to app self.call_source = 'app' + self.log.debug("######################### Closing the EDITOR ################################") # edited_obj.plot() self.ui.plot_tab_area.setTabText(0, _("Plot Area")) @@ -6634,6 +6634,10 @@ class App(QtCore.QObject): self.inform.emit('[success] %s' % _("Coordinates copied to clipboard.")) return + # the object selection on canvas does not work for App Tools or for Editors + if self.call_source != 'app': + return + if self.doubleclick is True: self.doubleclick = False if self.collection.get_selected(): @@ -6662,7 +6666,6 @@ class App(QtCore.QObject): log.warning("FlatCAMApp.on_mouse_click_release_over_plot() select area --> Error: %s" % str(e)) return else: - key_modifier = QtWidgets.QApplication.keyboardModifiers() if key_modifier == QtCore.Qt.ShiftModifier: mod_key = 'Shift'