From 951744d6faa4a197cd7c6b2e4d49838a5acbde45 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Fri, 5 Jun 2020 07:19:53 +0300 Subject: [PATCH] - added mouse events disconnect in the quit_application() method --- CHANGELOG.md | 1 + app_Main.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d92f58c5..35f014de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ CHANGELOG for FlatCAM beta - Tool Calculators: allowed comma to be used as decimal separator - changed how the import of svg.path module is done in the ParseSVG.py file - Tool Isolation - new feature that allow to isolate interiors of polygons (holes in polygons). It is possible that the isolation to be reported as successful (internal limitations) but some interiors to not be isolated. This way the user get to fix the isolation by doing an extra isolation. +- added mouse events disconnect in the quit_application() method 4.06.2020 diff --git a/app_Main.py b/app_Main.py index 26246c87..599c145c 100644 --- a/app_Main.py +++ b/app_Main.py @@ -3219,6 +3219,22 @@ class App(QtCore.QObject): pass log.debug("App.quit_application() --> Gerber Editor deactivated.") + # disconnect the mouse events + if self.is_legacy: + self.plotcanvas.graph_event_disconnect(self.mm) + self.plotcanvas.graph_event_disconnect(self.mp) + self.plotcanvas.graph_event_disconnect(self.mr) + self.plotcanvas.graph_event_disconnect(self.mdc) + self.plotcanvas.graph_event_disconnect(self.kp) + + else: + self.mm = self.plotcanvas.graph_event_disconnect('mouse_move', self.on_mouse_move_over_plot) + self.mp = self.plotcanvas.graph_event_disconnect('mouse_press', self.on_mouse_click_over_plot) + self.mr = self.plotcanvas.graph_event_disconnect('mouse_release', self.on_mouse_click_release_over_plot) + self.mdc = self.plotcanvas.graph_event_disconnect('mouse_double_click', + self.on_mouse_double_click_over_plot) + self.kp = self.plotcanvas.graph_event_disconnect('key_press', self.ui.keyPressEvent) + self.preferencesUiManager.save_defaults(silent=True) log.debug("App.quit_application() --> App Defaults saved.")