mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2026-10-25 01:06:05 +03:00
[Bugfix] Fix type mismatch when reading certain boolean config values
This commit is contained in:
2 files changed
+9
-9
No files matched your search
@@ -473,7 +473,7 @@ class AppWindow:
|
||||
|
||||
self.prefsdialog = None
|
||||
|
||||
if sys.platform == 'win32' and not bool(config.get_int('no_systray')):
|
||||
if sys.platform == 'win32' and not config.get_bool('no_systray'):
|
||||
from simplesystray import SysTrayIcon
|
||||
|
||||
def open_window(systray: SysTrayIcon, *args) -> None:
|
||||
@@ -656,7 +656,7 @@ class AppWindow:
|
||||
self.menubar.add_cascade(menu=self.help_menu)
|
||||
if sys.platform == 'win32':
|
||||
# Must be added after at least one "real" menu entry
|
||||
self.always_ontop = tk.BooleanVar(value=bool(config.get_int('always_ontop')))
|
||||
self.always_ontop = tk.BooleanVar(value=config.get_bool('always_ontop'))
|
||||
self.system_menu = tk.Menu(self.menubar, name='system', tearoff=tk.FALSE)
|
||||
self.system_menu.add_separator()
|
||||
# LANG: Appearance - Label for checkbox to select if application always on top
|
||||
@@ -743,7 +743,7 @@ class AppWindow:
|
||||
else:
|
||||
self.w.geometry(config.get_str('geometry'))
|
||||
|
||||
self.w.attributes('-topmost', config.get_int('always_ontop') and 1 or 0)
|
||||
self.w.attributes('-topmost', config.get_bool('always_ontop'))
|
||||
|
||||
theme.register(frame)
|
||||
theme.apply(self.w)
|
||||
@@ -1845,7 +1845,7 @@ class AppWindow:
|
||||
|
||||
def _destroy(self) -> None:
|
||||
"""Set parent window's topmost appropriately as we close."""
|
||||
self.parent.wm_attributes('-topmost', config.get_int('always_ontop') and 1 or 0)
|
||||
self.parent.wm_attributes('-topmost', config.get_bool('always_ontop'))
|
||||
self.destroy()
|
||||
self.__class__.showing = False
|
||||
|
||||
@@ -1971,7 +1971,7 @@ class AppWindow:
|
||||
# If we're meant to "minimize to system tray" then hide the window so no taskbar icon is seen
|
||||
if (sys.platform == 'win32'
|
||||
and config.get_bool('minimize_system_tray')
|
||||
and not bool(config.get_int('no_systray'))):
|
||||
and not config.get_bool('no_systray')):
|
||||
# This gets called for more than the root widget, so only react to that
|
||||
if str(event.widget) == '.':
|
||||
self.w.withdraw()
|
||||
|
||||
@@ -713,7 +713,7 @@ class PreferencesDialog(tk.Toplevel):
|
||||
# Appearance theme and language setting
|
||||
# LANG: The system default language choice in Settings > Appearance
|
||||
self.lang = tk.StringVar(value=self.languages.get(config.get_str('language'), tr.tl('Default')))
|
||||
self.always_ontop = tk.BooleanVar(value=bool(config.get_int('always_ontop')))
|
||||
self.always_ontop = tk.BooleanVar(value=config.get_bool('always_ontop'))
|
||||
self.minimize_system_tray = tk.BooleanVar(value=config.get_bool('minimize_system_tray'))
|
||||
self.disable_system_tray = tk.BooleanVar(value=config.get_bool('no_systray'))
|
||||
self.theme = tk.IntVar(value=config.get_int('theme'))
|
||||
@@ -893,7 +893,7 @@ class PreferencesDialog(tk.Toplevel):
|
||||
columnspan=3, padx=self.BUTTONX, pady=self.PADY, sticky=tk.W, row=row.get()
|
||||
) # Appearance setting
|
||||
|
||||
if sys.platform == 'win32' and not bool(config.get_int('no_systray')):
|
||||
if sys.platform == 'win32' and not config.get_bool('no_systray'):
|
||||
nb.Checkbutton(
|
||||
appearance_frame,
|
||||
# LANG: Appearance option for Windows "minimize to system tray"
|
||||
@@ -1349,7 +1349,7 @@ class PreferencesDialog(tk.Toplevel):
|
||||
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())
|
||||
if self.disable_system_tray.get() != config.get_int('no_systray'):
|
||||
if self.disable_system_tray.get() != config.get_bool('no_systray'):
|
||||
self.req_restart = True
|
||||
config.set('no_systray', self.disable_system_tray.get())
|
||||
config.set('theme', self.theme.get())
|
||||
@@ -1387,5 +1387,5 @@ class PreferencesDialog(tk.Toplevel):
|
||||
self.after_cancel(self.cmdrchanged_alarm)
|
||||
self.cmdrchanged_alarm = None
|
||||
|
||||
self.parent.wm_attributes('-topmost', 1 if config.get_int('always_ontop') else 0)
|
||||
self.parent.wm_attributes('-topmost', config.get_bool('always_ontop'))
|
||||
self.destroy()
|
||||
Reference in new issue
Block a user