-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
35 lines (27 loc) · 1.09 KB
/
Copy pathmain.py
File metadata and controls
35 lines (27 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from PySide6.QtWidgets import *
from src.error_reporter import install_error_dialogs
from src.config import Config
from src.gui import MainWindow
from src.shell import is_windows_7,get_real_winver,show_taskbar,hide_taskbar
import src.observer as observer
from threading import Thread
import sys
if __name__ == "__main__":
app = QApplication(sys.argv)
error_reporter = install_error_dialogs()
config = Config()
window = MainWindow(config)
observer.set_on_config_change(window.config_reload_requested.emit)
window.show()
window.closeEvent = lambda event: show_taskbar()
hide_taskbar()
major,minor,build = get_real_winver()
print(f"running on nt {major}.{minor}.{build}")
if is_windows_7():
#on w7 the start btn needs to be hidden individually
from src.shell import hide_start_btn,show_start_btn
hide_start_btn()
window.closeEvent = lambda event: (show_taskbar(),show_start_btn())
observer_thread = Thread(target=observer.start,args=(config.config_dir,),daemon=True)
observer_thread.start()
sys.exit(app.exec())