diff --git a/CHANGELOG.md b/CHANGELOG.md index 20c69aed..c12b1054 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ CHANGELOG for FlatCAM beta ================================================= +15.08.2021 + +- fixed some issues with using the exec_() which now should be exec() +- added a context menu action in the canvas context menu for moving selected objects to origin + 14.08.2021 - small change due of porting to PyQt6 in self.on_portable_checked() method diff --git a/FlatCAM.py b/FlatCAM.py index 9d875187..169d7b97 100644 --- a/FlatCAM.py +++ b/FlatCAM.py @@ -167,4 +167,4 @@ if __name__ == '__main__': timer.start(100) sys.exit(app.exec()) - # app.exec_() + # app.exec() diff --git a/appGUI/GUIElements.py b/appGUI/GUIElements.py index 95f5bf9a..cbf1f5f3 100644 --- a/appGUI/GUIElements.py +++ b/appGUI/GUIElements.py @@ -348,7 +348,7 @@ class FCLineEdit(QtWidgets.QLineEdit): self.menu.addAction(sel_all_action) sel_all_action.triggered.connect(self.selectAll) - self.menu.exec_(event.globalPos()) + self.menu.exec(event.globalPos()) def cut_text(self): clipboard = QtWidgets.QApplication.clipboard() @@ -1063,7 +1063,7 @@ class FCSpinner(QtWidgets.QSpinBox): if line_edit.isReadOnly(): step_down_action.setDisabled(True) - self.menu.exec_(event.globalPos()) + self.menu.exec(event.globalPos()) def cut_text(self): clipboard = QtWidgets.QApplication.clipboard() @@ -1462,7 +1462,7 @@ class FCDoubleSpinner(QtWidgets.QDoubleSpinBox): if line_edit.isReadOnly(): step_down_action.setDisabled(True) - self.menu.exec_(event.globalPos()) + self.menu.exec(event.globalPos()) def cut_text(self): clipboard = QtWidgets.QApplication.clipboard() @@ -1655,7 +1655,7 @@ class FCTextEdit(QtWidgets.QTextEdit): self.menu.addAction(sel_all_action) sel_all_action.triggered.connect(self.selectAll) - self.menu.exec_(event.globalPos()) + self.menu.exec(event.globalPos()) def cut_text(self): tcursor = self.textCursor() @@ -2012,7 +2012,7 @@ class FCPlainTextAreaExtended(QtWidgets.QPlainTextEdit): else: self.copy_action.setDisabled(False) - self.menu.exec_(event.globalPos()) + self.menu.exec(event.globalPos()) def add_action_to_context_menu(self, text, shortcut='', icon=None, callback=lambda: None, separator=None): """ @@ -3241,9 +3241,9 @@ class FCDetachableTab(QtWidgets.QTabWidget): drag.setPixmap(targetPixmap) # Initiate the drag - dropAction = drag.exec_(QtCore.Qt.DropAction.MoveAction | QtCore.Qt.DropAction.CopyAction) + dropAction = drag.exec(QtCore.Qt.DropAction.MoveAction | QtCore.Qt.DropAction.CopyAction) - # For Linux: Here, drag.exec_() will not return MoveAction on Linux. So it + # For Linux: Here, drag.exec() will not return MoveAction on Linux. So it # must be set manually if self.dragDropedPos.x() != 0 and self.dragDropedPos.y() != 0: dropAction = QtCore.Qt.DropAction.MoveAction @@ -4061,7 +4061,7 @@ class _BrowserTextEdit(QTextEdit): self.cut_action.setDisabled(False) self.copy_action.setDisabled(False) - self.menu.exec_(event.globalPos()) + self.menu.exec(event.globalPos()) def keyPressEvent(self, event) -> None: modifiers = QtWidgets.QApplication.keyboardModifiers() diff --git a/appGUI/MainGUI.py b/appGUI/MainGUI.py index d812c4b5..3fecf248 100644 --- a/appGUI/MainGUI.py +++ b/appGUI/MainGUI.py @@ -1786,6 +1786,8 @@ class MainGUI(QtWidgets.QMainWindow): self.popmenu_save.setVisible(False) self.popMenu.addSeparator() + self.popmenu_move2origin = self.popMenu.addAction( + QtGui.QIcon(self.app.resource_location + '/origin2_32.png'), _("Move2Origin")) self.popmenu_move = self.popMenu.addAction( QtGui.QIcon(self.app.resource_location + '/move32.png'), _("Move")) self.popmenu_properties = self.popMenu.addAction( diff --git a/app_Main.py b/app_Main.py index 942e3be5..e6362e48 100644 --- a/app_Main.py +++ b/app_Main.py @@ -2211,6 +2211,7 @@ class App(QtCore.QObject): self.ui.popmenu_edit.triggered.connect(self.object2editor) self.ui.popmenu_save.triggered.connect(lambda: self.editor2object()) self.ui.popmenu_move.triggered.connect(self.obj_move) + self.ui.popmenu_move2origin.triggered.connect(self.on_move2origin) self.ui.popmenu_properties.triggered.connect(self.obj_properties) diff --git a/tclCommands/TclCommand.py b/tclCommands/TclCommand.py index c8fa8036..9453d382 100644 --- a/tclCommands/TclCommand.py +++ b/tclCommands/TclCommand.py @@ -391,7 +391,7 @@ class TclCommandSignaled(TclCommand): QtCore.QTimer.singleShot(time_val, report_quit) # Block - loop.exec_() + loop.exec() # Restore exception management sys.excepthook = oeh