Wobuzz/wobuzz/main.py

35 lines
925 B
Python
Raw Normal View History

2024-12-20 18:02:59 +01:00
#!/usr/bin/python3
import sys
from PyQt6.QtWidgets import QApplication
from wobbl_tools.data_file import load_dataclass_json
from settings import Settings
from utils import Utils
from player.player import Player
2024-12-21 19:00:06 +01:00
from gui import GUI
from gui_communication.gui_communication import GUICommunication
2024-12-20 18:02:59 +01:00
class Wobuzz:
def __init__(self):
self.qt_app = QApplication([])
2024-12-20 18:02:59 +01:00
self.utils = Utils(self)
self.settings = load_dataclass_json(Settings, self.utils.settings_location, self, True, True)
self.settings.set_attribute_change_event(self.on_settings_change)
2024-12-22 16:11:43 +01:00
self.player = Player(self)
self.gui = GUI(self)
2024-12-21 19:00:06 +01:00
self.gui_communication = GUICommunication(self)
2024-12-20 18:02:59 +01:00
def on_settings_change(self, key, value):
self.gui_communication.on_settings_change(key, value)
return True
2024-12-20 18:02:59 +01:00
if __name__ == "__main__":
wobuzz = Wobuzz()
sys.exit(wobuzz.qt_app.exec())