- in 2Sided Plugin, deleting the last drill alignment coordinates will update the clipboard values too

This commit is contained in:
Marius Stanciu
2021-10-04 17:59:10 +03:00
parent 411f410025
commit ab704e2a60
3 changed files with 29 additions and 11 deletions

View File

@@ -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 - 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 - 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 - code refactoring in app_Main file
- in 2Sided Plugin, deleting the last drill alignment coordinates will update the clipboard values too
3.10.2021 3.10.2021

View File

@@ -524,6 +524,20 @@ class DblSidedTool(AppTool):
self.drill_values = drill_values_without_last_tupple self.drill_values = drill_values_without_last_tupple
self.ui.alignment_holes.set_value(self.drill_values) 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): def on_toggle_pointbox(self, val):
if val == "point": if val == "point":
self.ui.pr_frame.show() self.ui.pr_frame.show()

View File

@@ -7723,11 +7723,14 @@ class App(QtCore.QObject):
:return: :return:
""" """
if self.ui.notebook.currentWidget().objectName() == "plugin_tab": if self.ui.notebook.currentWidget().objectName() != "plugin_tab":
return
tab_idx = self.ui.notebook.currentIndex() tab_idx = self.ui.notebook.currentIndex()
for plugin in self.app_plugins: for plugin in self.app_plugins:
# execute this only for the current active plugin # execute this only for the current active plugin
if self.ui.notebook.tabText(tab_idx) == plugin.pluginName: if self.ui.notebook.tabText(tab_idx) != plugin.pluginName:
continue
try: try:
plugin.on_mouse_plugin_click_release() plugin.on_mouse_plugin_click_release()
except AttributeError: except AttributeError: