From ea358d1f744bd6f85f2409ee570bf561df69c397 Mon Sep 17 00:00:00 2001 From: yakimka Date: Wed, 30 Sep 2020 15:56:57 +0300 Subject: [PATCH] Add Settings and About actions in tray icon context menu --- CherryTomato/main.py | 9 +++++++++ CherryTomato/main_window.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CherryTomato/main.py b/CherryTomato/main.py index d3e0d04..371d7fd 100755 --- a/CherryTomato/main.py +++ b/CherryTomato/main.py @@ -27,6 +27,15 @@ def setTrayIcon(app, mainWindow): trayIcon = QSystemTrayIcon(parent=app, icon=icon) menu = QMenu(parent=mainWindow) + + settingsAction = QAction(text='Settings', parent=menu) + settingsAction.triggered.connect(mainWindow.showSettingsWindow) + menu.addAction(settingsAction) + + aboutAction = QAction(text='About', parent=menu) + aboutAction.triggered.connect(mainWindow.showAboutWindow) + menu.addAction(aboutAction) + quitAction = QAction(text='Quit', parent=menu) quitAction.triggered.connect(app.quit) menu.addAction(quitAction) diff --git a/CherryTomato/main_window.py b/CherryTomato/main_window.py index efc7e23..5ea9997 100644 --- a/CherryTomato/main_window.py +++ b/CherryTomato/main_window.py @@ -119,7 +119,7 @@ def setColor(self, base: tuple, highlight: tuple): self.progress.setPalette(palette) self.button.setColor(highlight) - @Qt.pyqtSlot(name='setFocusOnWindowAndPlayNotification') + @Qt.pyqtSlot(name='setFocusOnWindow') def setFocusOnWindow(self): self.show() self.activateWindow()