diff --git a/CHANGELOG.md b/CHANGELOG.md index 39824f35..94d290d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ CHANGELOG for FlatCAM beta - in 2Sided Plugin clicking LMB and also pressing CTRL+Shift will add the click coordinates to the Drll Alignment Coordinates - added support for all Plugins to handle the LMB click release event without connect/reconnect of the mouse events - code refactoring in app_Main file +- in 2Sided Plugin, deleting the last drill alignment coordinates will update the clipboard values too 3.10.2021 diff --git a/appPlugins/ToolDblSided.py b/appPlugins/ToolDblSided.py index ec9c226a..2b063cb8 100644 --- a/appPlugins/ToolDblSided.py +++ b/appPlugins/ToolDblSided.py @@ -524,6 +524,20 @@ class DblSidedTool(AppTool): self.drill_values = drill_values_without_last_tupple self.ui.alignment_holes.set_value(self.drill_values) + # adjust the clipboard content too + try: + old_clipb = eval(self.app.clipboard.text()) + except Exception as err: + # self.log.error("App.on_mouse_and_key_modifiers() --> %s" % str(err)) + old_clipb = None + + if isinstance(old_clipb, list): + red_clip = old_clipb[:-1] + clip_text = str(red_clip[0]) if len(red_clip) == 1 else str(red_clip) + else: + clip_text = '' + self.app.clipboard.setText(clip_text) + def on_toggle_pointbox(self, val): if val == "point": self.ui.pr_frame.show() diff --git a/app_Main.py b/app_Main.py index 777112f9..d195d0d5 100644 --- a/app_Main.py +++ b/app_Main.py @@ -7723,17 +7723,20 @@ class App(QtCore.QObject): :return: """ - if self.ui.notebook.currentWidget().objectName() == "plugin_tab": - tab_idx = self.ui.notebook.currentIndex() - for plugin in self.app_plugins: - # execute this only for the current active plugin - if self.ui.notebook.tabText(tab_idx) == plugin.pluginName: - try: - plugin.on_mouse_plugin_click_release() - except AttributeError: - # not all plugins have this implemented - # print("This does not have it", self.ui.notebook.tabText(tab_idx)) - pass + if self.ui.notebook.currentWidget().objectName() != "plugin_tab": + return + + tab_idx = self.ui.notebook.currentIndex() + for plugin in self.app_plugins: + # execute this only for the current active plugin + if self.ui.notebook.tabText(tab_idx) != plugin.pluginName: + continue + try: + plugin.on_mouse_plugin_click_release() + except AttributeError: + # not all plugins have this implemented + # print("This does not have it", self.ui.notebook.tabText(tab_idx)) + pass def delete_hover_shape(self): self.hover_shapes.clear()