From 316201eb77da75235be306278e8f0b121b0b7850 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sat, 1 May 2021 19:32:53 +0100 Subject: [PATCH] systray: Disable whilst we figure out py2exe packaging issue --- EDMarketConnector.py | 38 +++++++++++++++++++------------------- prefs.py | 18 +++++++++--------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 8c11b1fd..97f517ff 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -9,7 +9,7 @@ import locale import pathlib import re import sys -import threading +# import threading import webbrowser from builtins import object, str from os import chdir, environ @@ -264,7 +264,7 @@ if __name__ == '__main__': # noqa: C901 if TYPE_CHECKING: from logging import trace, TRACE # type: ignore # noqa: F401 import update - from infi.systray import SysTrayIcon + # from infi.systray import SysTrayIcon # isort: on def _(x: str) -> str: @@ -332,16 +332,16 @@ class AppWindow(object): self.prefsdialog = None - if platform == 'win32': - from infi.systray import SysTrayIcon + # if platform == 'win32': + # from infi.systray import SysTrayIcon - def open_window(systray: 'SysTrayIcon') -> None: - self.w.deiconify() + # def open_window(systray: 'SysTrayIcon') -> None: + # self.w.deiconify() - menu_options = (("Open", None, open_window),) - # Method associated with on_quit is called whenever the systray is closing - self.systray = SysTrayIcon("EDMarketConnector.ico", applongname, menu_options, on_quit=self.exit_tray) - self.systray.start() + # menu_options = (("Open", None, open_window),) + # # Method associated with on_quit is called whenever the systray is closing + # self.systray = SysTrayIcon("EDMarketConnector.ico", applongname, menu_options, on_quit=self.exit_tray) + # self.systray.start() plug.load_plugins(master) @@ -1399,18 +1399,18 @@ class AppWindow(object): logger.debug('"other" exception', exc_info=e) self.status['text'] = str(e) - def exit_tray(self, systray: 'SysTrayIcon') -> None: - """Tray icon is shutting down.""" - exit_thread = threading.Thread(target=self.onexit) - exit_thread.setDaemon(True) - exit_thread.start() + # def exit_tray(self, systray: 'SysTrayIcon') -> None: + # """Tray icon is shutting down.""" + # exit_thread = threading.Thread(target=self.onexit) + # exit_thread.setDaemon(True) + # exit_thread.start() def onexit(self, event=None) -> None: """Application shutdown procedure.""" - if platform == 'win32': - shutdown_thread = threading.Thread(target=self.systray.shutdown) - shutdown_thread.setDaemon(True) - shutdown_thread.start() + # if platform == 'win32': + # shutdown_thread = threading.Thread(target=self.systray.shutdown) + # shutdown_thread.setDaemon(True) + # shutdown_thread.start() config.set_shutdown() # Signal we're in shutdown now. diff --git a/prefs.py b/prefs.py index 119b727f..65a018a1 100644 --- a/prefs.py +++ b/prefs.py @@ -636,7 +636,7 @@ class PreferencesDialog(tk.Toplevel): # Appearance theme and language setting self.lang = tk.StringVar(value=self.languages.get(config.get_str('language'), _('Default'))) self.always_ontop = tk.BooleanVar(value=bool(config.get_int('always_ontop'))) - self.minimize_system_tray = tk.BooleanVar(value=config.get_bool('minimize_system_tray')) + # self.minimize_system_tray = tk.BooleanVar(value=config.get_bool('minimize_system_tray')) self.theme = tk.IntVar(value=config.get_int('theme')) self.theme_colors = [config.get_str('dark_text'), config.get_str('dark_highlight')] self.theme_prompts = [ @@ -792,13 +792,13 @@ class PreferencesDialog(tk.Toplevel): ) self.ontop_button.grid(columnspan=3, padx=self.BUTTONX, sticky=tk.W, row=row.get()) # Appearance setting - if platform == 'win32': - nb.Checkbutton( - appearance_frame, - text=_('Minimize to system tray'), - variable=self.minimize_system_tray, - command=self.themevarchanged - ).grid(columnspan=3, padx=self.BUTTONX, sticky=tk.W, row=row.get()) # Appearance setting + # if platform == 'win32': + # nb.Checkbutton( + # appearance_frame, + # text=_('Minimize to system tray'), + # variable=self.minimize_system_tray, + # command=self.themevarchanged + # ).grid(columnspan=3, padx=self.BUTTONX, sticky=tk.W, row=row.get()) # Appearance setting nb.Label(appearance_frame).grid(sticky=tk.W) # big spacer @@ -1172,7 +1172,7 @@ class PreferencesDialog(tk.Toplevel): config.set('ui_scale', self.ui_scale.get()) config.set('ui_transparency', self.transparency.get()) config.set('always_ontop', self.always_ontop.get()) - config.set('minimize_system_tray', self.minimize_system_tray.get()) + # config.set('minimize_system_tray', self.minimize_system_tray.get()) config.set('theme', self.theme.get()) config.set('dark_text', self.theme_colors[0]) config.set('dark_highlight', self.theme_colors[1])