diff --git a/main.py b/main.py index 90480c3..eb7dd88 100644 --- a/main.py +++ b/main.py @@ -20,22 +20,26 @@ import sys from PySide6.QtWidgets import QApplication from PySide6.QtCore import QFile, QIODevice from PySide6.QtUiTools import QUiLoader +from utils import Logger if __name__ == "__main__": + # needed variables app = QApplication(sys.argv) - + logger = Logger() ui_file_name = "main.ui" + + # create the window ui_file = QFile(ui_file_name) if not ui_file.open(QIODevice.ReadOnly): - print(f"Cannot open {ui_file_name}: {ui_file.errorString()}") + logger.log(f"Cannot open {ui_file_name}: {ui_file.errorString()}", 1) sys.exit(-1) - loader = QUiLoader() - window = loader.load(ui_file) + window = QUiLoader().load(ui_file) ui_file.close() if not window: print(loader.errorString()) sys.exit(-1) window.show() + # run as long as the app is executing sys.exit(app.exec())