41 lines
1.1 KiB
Python
Executable file
41 lines
1.1 KiB
Python
Executable file
#!/usr/bin/python3
|
|
|
|
import sys
|
|
from wobbl_tools.data_file import save_dataclass_json, load_dataclass_json
|
|
from utils import Utils
|
|
import file
|
|
from ui import GUI
|
|
from settings import Settings
|
|
|
|
|
|
class BreadEditor:
|
|
def __init__(self):
|
|
self.settings = load_dataclass_json(Settings, "settings.json")
|
|
setattr(self.settings, "save", lambda: save_dataclass_json(self.settings, "settings.json"))
|
|
|
|
# save the file module to a variable because we need to use it in other classes but we change some file class --
|
|
# variables that also need to be accesible from the other classes.
|
|
self.file = file
|
|
File = file.File
|
|
self.utils = Utils(self)
|
|
self.file_actions = file.FileActions(self)
|
|
self.gui = GUI(self)
|
|
|
|
self.gui.connect_gui(self)
|
|
|
|
self.open_files: dict[str, File] = {}
|
|
|
|
def run(self):
|
|
self.gui.post_setup()
|
|
|
|
self.utils.open_last_file()
|
|
|
|
self.utils.popup_init()
|
|
|
|
self.gui.QTMainWindow.show()
|
|
sys.exit(self.gui.qt_app.exec())
|
|
|
|
|
|
if __name__ == "__main__":
|
|
editor = BreadEditor()
|
|
editor.run()
|