#!/usr/bin/python3 import sys from PyQt6.QtCore import QTimer from wobbl_tools.data_file import load_dataclass_json from utils import Utils from file import File, FileActions from ui import GUI from settings import Settings from ipc import IPC class BreadEditor: def __init__(self): self.utils = Utils(self) self.settings = load_dataclass_json(Settings, f"{self.utils.editor_path}/settings.json") self.file_actions = FileActions(self) self.ipc = IPC(self) if not self.ipc.first_instance: return self.gui = GUI(self) self.gui.connect_gui(self) self.open_files: dict[str, File] = {} self.open_files_queue = [] self.files_queue_timer = QTimer(self.gui.QTMainWindow) self.files_queue_timer.timeout.connect(self.utils.check_file_queue) self.files_queue_timer.start(500) def run(self): if not self.ipc.first_instance: return self.gui.post_setup() self.utils.on_start() self.utils.popup_init() self.gui.QTMainWindow.show() sys.exit(self.gui.qt_app.exec()) if __name__ == "__main__": editor = BreadEditor() editor.run()