From ca7863a371edce106efed1f24d2ca4c6a84c6808 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Fri, 27 Sep 2019 12:42:16 +0300 Subject: [PATCH] - fixed issue with the old SysTray icon not hidden when the application is restarted programmatically --- FlatCAMApp.py | 15 ++++++++++++--- README.md | 1 + 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/FlatCAMApp.py b/FlatCAMApp.py index 887901f2..929b36fc 100644 --- a/FlatCAMApp.py +++ b/FlatCAMApp.py @@ -1880,9 +1880,7 @@ class App(QtCore.QObject): # ### GUI PREFERENCES SIGNALS ## # ############################## - self.ui.general_defaults_form.general_app_group.ge_radio.activated_custom.connect( - lambda: fcTranslate.restart_program(app=self) - ) + self.ui.general_defaults_form.general_app_group.ge_radio.activated_custom.connect(self.on_app_restart) self.ui.general_options_form.general_app_group.units_radio.group_toggle_fn = self.on_toggle_units self.ui.general_defaults_form.general_app_group.language_apply_btn.clicked.connect( @@ -2799,6 +2797,17 @@ class App(QtCore.QObject): name) ) + def on_app_restart(self): + + # make sure that the Sys Tray icon is hidden before restart otherwise it will + # be left in the SySTray + try: + self.trayIcon.hide() + except Exception as e: + log.debug("App.on_app_restart() --> %s" % str(e)) + + fcTranslate.restart_program(app=self) + def defaults_read_form(self): """ Will read all the values in the Preferences GUI and update the defaults dictionary. diff --git a/README.md b/README.md index a8277259..4cd7adba 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ CAD program, and create G-Code for Isolation routing. - added posibility of using a big mouse cursor or a small mouse cursor. The big mouse cursor is made from 2 infinite lines. This was implemented for both graphic engines - added ability to change the cursor size when the small mouse cursor is selected in Preferences -> General - removed the line that remove the spaces from the path parameter in the Tcl commands that open something (Gerber, Gcode, Excellon) +- fixed issue with the old SysTray icon not hidden when the application is restarted programmatically 27.09.2019