mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-21 11:27:38 +03:00
EDMarketConnector.py: Guard platform specific func
Some callback functions are only used on windows, but defined for everyone, this causes mypy to fail in fun ways.
This commit is contained in:
parent
490bd9dbdd
commit
f94072a99e
@ -1617,10 +1617,11 @@ class AppWindow(object):
|
||||
monitor.system and
|
||||
tk.NORMAL or tk.DISABLED)
|
||||
|
||||
def ontop_changed(self, event=None) -> None:
|
||||
"""Set main window 'on top' state as appropriate."""
|
||||
config.set('always_ontop', self.always_ontop.get())
|
||||
self.w.wm_attributes('-topmost', self.always_ontop.get())
|
||||
if sys.platform == 'win32':
|
||||
def ontop_changed(self, event=None) -> None:
|
||||
"""Set main window 'on top' state as appropriate."""
|
||||
config.set('always_ontop', self.always_ontop.get())
|
||||
self.w.wm_attributes('-topmost', self.always_ontop.get())
|
||||
|
||||
def copy(self, event=None) -> None:
|
||||
"""Copy system, and possible station, name to clipboard."""
|
||||
@ -1760,13 +1761,14 @@ class AppWindow(object):
|
||||
with open(f, 'wb') as h:
|
||||
h.write(str(companion.session.capi_raw_data).encode(encoding='utf-8'))
|
||||
|
||||
def exit_tray(self, systray: 'SysTrayIcon') -> None:
|
||||
"""Tray icon is shutting down."""
|
||||
exit_thread = threading.Thread(
|
||||
target=self.onexit,
|
||||
daemon=True,
|
||||
)
|
||||
exit_thread.start()
|
||||
if sys.platform == 'win32':
|
||||
def exit_tray(self, systray: 'SysTrayIcon') -> None:
|
||||
"""Tray icon is shutting down."""
|
||||
exit_thread = threading.Thread(
|
||||
target=self.onexit,
|
||||
daemon=True,
|
||||
)
|
||||
exit_thread.start()
|
||||
|
||||
def onexit(self, event=None) -> None:
|
||||
"""Application shutdown procedure."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user