From 2f9ad618191c6f81cb10d51dd7db42902dbc5ef1 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Wed, 18 Sep 2019 15:22:45 +0300 Subject: [PATCH] - fixed issue with the sys tray icon not hiding after application close --- FlatCAMApp.py | 12 ++++++++++++ README.md | 1 + flatcamGUI/FlatCAMGUI.py | 8 -------- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/FlatCAMApp.py b/FlatCAMApp.py index 4aa60c2f..ef01f6fc 100644 --- a/FlatCAMApp.py +++ b/FlatCAMApp.py @@ -395,6 +395,13 @@ class App(QtCore.QObject): self.ui.geom_update[int, int, int, int, int].connect(self.save_geometry) self.ui.final_save.connect(self.final_save) + # ################################################################# + # ####################### SYS TRAY ################################ + # ################################################################# + + self.parent_w = QtWidgets.QWidget() + self.trayIcon = FlatCAMSystemTray(app=self, icon=QtGui.QIcon('share/flatcam_icon32.png'), parent=self.parent_w) + # ############################################################################# # ############################## Data ######################################### # ############################################################################# @@ -2468,6 +2475,8 @@ class App(QtCore.QObject): else: self.ui.show() + self.trayIcon.show() + # ##################################################################################### # ########################## START-UP ARGUMENTS ####################################### # ##################################################################################### @@ -4460,12 +4469,15 @@ class App(QtCore.QObject): response = msgbox.clickedButton() if response == bt_yes: + self.trayIcon.hide() self.on_file_saveprojectas(use_thread=True, quit_action=True) elif response == bt_no: + self.trayIcon.hide() self.quit_application() elif response == bt_cancel: return else: + self.trayIcon.hide() self.quit_application() def quit_application(self): diff --git a/README.md b/README.md index 4bf69128..41bafdac 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ CAD program, and create G-Code for Isolation routing. - added sys tray menu - added possibility to edit the custom keywords used by the autocompleter (in Tcl Shell and in the Code Editor). It is done in the Edit -> Preferences -> Utilities - added a new setting in Edit -> Preferences -> General -> GUI Settings -> Textbox Font which control the font on the texbox GUI elements +- fixed issue with the sys tray icon not hiding after application close 17.09.2019 diff --git a/flatcamGUI/FlatCAMGUI.py b/flatcamGUI/FlatCAMGUI.py index b6c835ea..17e26da6 100644 --- a/flatcamGUI/FlatCAMGUI.py +++ b/flatcamGUI/FlatCAMGUI.py @@ -2055,14 +2055,6 @@ class FlatCAMGUI(QtWidgets.QMainWindow): self.lock_toolbar(lock=lock_state) self.lock_action.triggered[bool].connect(self.lock_toolbar) - # ################################################################# - # ####################### SYS TRAY ################################ - # ################################################################# - - self.w = QtWidgets.QWidget() - self.trayIcon = FlatCAMSystemTray(self.app, QtGui.QIcon('share/flatcam_icon32.png'), self.w) - - def eventFilter(self, obj, event): # filter the ToolTips display based on a Preferences setting if self.general_defaults_form.general_gui_set_group.toggle_tooltips_cb.get_value() is False: