36 lines
975 B
Python
36 lines
975 B
Python
from __future__ import annotations
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
from app.qt_compat import QApplication, QT_API, QT_IMPORT_ERROR
|
|
|
|
|
|
def main() -> int:
|
|
from app.core.controller import InfinityMirrorController
|
|
from app.ui.main_window import MainWindow
|
|
from app.ui.theme import apply_dark_theme
|
|
|
|
if QApplication is None:
|
|
print("No supported Qt binding could be loaded.")
|
|
if QT_IMPORT_ERROR is not None:
|
|
print(f"Import error: {QT_IMPORT_ERROR}")
|
|
return 1
|
|
|
|
app = QApplication(sys.argv)
|
|
apply_dark_theme(app)
|
|
|
|
project_root = Path(__file__).resolve().parents[1]
|
|
controller = InfinityMirrorController(project_root)
|
|
controller.load_initial_config()
|
|
app.aboutToQuit.connect(controller.shutdown)
|
|
|
|
window = MainWindow(controller)
|
|
window.statusBar().showMessage(f"Using Qt binding: {QT_API}", 5000)
|
|
window.show()
|
|
return app.exec()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|