- upgraded all the plugins such that at each launch the Plugin UI is reinitialized reducing the chances to get errors like "wrapped up C++ object deleted" with the side effect that the performance might be slightly reduced

This commit is contained in:
Marius Stanciu
2021-03-28 15:21:17 +03:00
committed by Marius
parent d0327ff37d
commit 4c92083c01
39 changed files with 1239 additions and 957 deletions

View File

@@ -44,12 +44,7 @@ class AlignObjects(AppTool):
# #############################################################################
self.ui = AlignUI(layout=self.layout, app=self.app)
self.pluginName = self.ui.pluginName
# Signals
self.ui.align_object_button.clicked.connect(self.on_align)
self.ui.type_obj_radio.activated_custom.connect(self.on_type_obj_changed)
self.ui.type_aligner_obj_radio.activated_custom.connect(self.on_type_aligner_changed)
self.ui.reset_button.clicked.connect(self.set_tool_ui)
self.connect_signals_at_init()
self.mr = None
@@ -76,6 +71,13 @@ class AlignObjects(AppTool):
self.aligned_old_fill_color = None
self.aligned_old_line_color = None
def connect_signals_at_init(self):
# Signals
self.ui.align_object_button.clicked.connect(self.on_align)
self.ui.type_obj_radio.activated_custom.connect(self.on_type_obj_changed)
self.ui.type_aligner_obj_radio.activated_custom.connect(self.on_type_aligner_changed)
self.ui.reset_button.clicked.connect(self.set_tool_ui)
def run(self, toggle=True):
self.app.defaults.report_usage("ToolAlignObjects()")
@@ -125,6 +127,12 @@ class AlignObjects(AppTool):
AppTool.install(self, icon, separator, shortcut='Alt+A', **kwargs)
def set_tool_ui(self):
self.clear_ui(self.layout)
self.ui = AlignUI(layout=self.layout, app=self.app)
self.pluginName = self.ui.pluginName
self.connect_signals_at_init()
self.reset_fields()
self.clicked_points = []