Fix Windows system tray icon shortcuts not working
This commit is contained in:
@@ -414,6 +414,8 @@ def win_system_tray():
|
|||||||
versioncheck.check_update()
|
versioncheck.check_update()
|
||||||
|
|
||||||
def tray_update(sysTrayIcon):
|
def tray_update(sysTrayIcon):
|
||||||
|
global SIGNAL
|
||||||
|
global WIN_SYS_TRAY_ICON
|
||||||
if UPDATE_AVAILABLE:
|
if UPDATE_AVAILABLE:
|
||||||
SIGNAL = 'update'
|
SIGNAL = 'update'
|
||||||
else:
|
else:
|
||||||
@@ -421,9 +423,11 @@ def win_system_tray():
|
|||||||
WIN_SYS_TRAY_ICON.update(hover_text=hover_text)
|
WIN_SYS_TRAY_ICON.update(hover_text=hover_text)
|
||||||
|
|
||||||
def tray_restart(sysTrayIcon):
|
def tray_restart(sysTrayIcon):
|
||||||
|
global SIGNAL
|
||||||
SIGNAL = 'restart'
|
SIGNAL = 'restart'
|
||||||
|
|
||||||
def tray_quit(sysTrayIcon):
|
def tray_quit(sysTrayIcon):
|
||||||
|
global SIGNAL
|
||||||
SIGNAL = 'shutdown'
|
SIGNAL = 'shutdown'
|
||||||
|
|
||||||
if UPDATE_AVAILABLE:
|
if UPDATE_AVAILABLE:
|
||||||
@@ -441,6 +445,7 @@ def win_system_tray():
|
|||||||
|
|
||||||
logger.info("Launching system tray icon.")
|
logger.info("Launching system tray icon.")
|
||||||
|
|
||||||
|
global WIN_SYS_TRAY_ICON
|
||||||
try:
|
try:
|
||||||
WIN_SYS_TRAY_ICON = SysTrayIcon(icon, hover_text, menu_options, on_quit=tray_quit)
|
WIN_SYS_TRAY_ICON = SysTrayIcon(icon, hover_text, menu_options, on_quit=tray_quit)
|
||||||
WIN_SYS_TRAY_ICON.start()
|
WIN_SYS_TRAY_ICON.start()
|
||||||
|
|||||||
Reference in New Issue
Block a user