Bread_Editor/main.py

36 lines
902 B
Python
Raw Normal View History

#!/usr/bin/python3
import sys
2024-11-21 18:54:32 +01:00
from wobbl_tools.data_file import save_dataclass_json, load_dataclass_json
from utils import Utils
2024-11-21 18:54:32 +01:00
from file import FileActions, File, BitEditor
from ui import GUI
2024-11-21 18:54:32 +01:00
from settings import Settings
class BreadEditor:
def __init__(self):
2024-11-21 18:54:32 +01:00
self.settings = load_dataclass_json(Settings, "settings.json")
setattr(self.settings, "save", lambda: save_dataclass_json(self.settings, "settings.json"))
self.utils = Utils(self)
self.file_actions = FileActions(self)
self.gui = GUI(self)
2024-11-21 18:54:32 +01:00
self.BitEditor = BitEditor
self.gui.connect_gui(self)
2024-11-21 17:34:58 +01:00
self.open_files: dict[str, File] = {}
2024-11-21 16:40:37 +01:00
def run(self):
2024-11-21 18:54:32 +01:00
self.gui.post_setup()
self.utils.popup_init()
self.gui.QTMainWindow.show()
sys.exit(self.gui.qt_app.exec())
if __name__ == "__main__":
editor = BreadEditor()
editor.run()