-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
executable file
·46 lines (34 loc) · 1.67 KB
/
main.py
File metadata and controls
executable file
·46 lines (34 loc) · 1.67 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
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/python3
import os
import sys
import signal
from PySide6.QtGui import QGuiApplication, QIcon
from PySide6.QtCore import QUrl
from PySide6.QtQml import QQmlApplicationEngine
import sys
import os
from src.global_installer_state import GlobalInstallerState
def main():
app = QGuiApplication(sys.argv)
app.setWindowIcon(QIcon('images/squid.png'))
engine = QQmlApplicationEngine()
# including QML dirs, just in case
engine.addImportPath('ui/components')
engine.addImportPath('ui/pages')
engine.addImportPath('ui')
signal.signal(signal.SIGINT, signal.SIG_DFL)
# setting qqc style
if not os.environ.get("QT_QUICK_CONTROLS_STYLE"):
os.environ["QT_QUICK_CONTROLS_STYLE"] = "org.kde.desktop"
global_installer_state = GlobalInstallerState()
engine.rootContext().setContextProperty("translatorBackend", global_installer_state.translator_backend_wrapper)
engine.rootContext().setContextProperty("adaptiveImageProvider", global_installer_state.adaptive_image_provider)
engine.rootContext().setContextProperty("userProfileBackend", global_installer_state.user_profile_backend)
engine.rootContext().setContextProperty("additionalTweaksBackend", global_installer_state.additional_tweaks_backend)
engine.rootContext().setContextProperty("driveBackend", global_installer_state.drive_backend)
engine.rootContext().setContextProperty("internetCheckerBackend", global_installer_state.internet_checker_backend)
engine.rootContext().setContextProperty("installationProcessBackend", global_installer_state.installation_process_backend)
engine.load(QUrl('ui/MainWindow.qml'))
app.exec()
if __name__ == "__main__":
main()