38 lines
958 B
Python
38 lines
958 B
Python
#!/usr/bin/python3
|
|
|
|
import sys
|
|
from PyQt6 import QtWidgets
|
|
from gui.main_window import Ui_MainWindow
|
|
from utils import Utils
|
|
from connect_gui import connect_gui
|
|
|
|
|
|
class BreadEditor:
|
|
def __init__(self):
|
|
self.utils = Utils(self)
|
|
self.open_files = {}
|
|
|
|
self.qt_app = QtWidgets.QApplication(sys.argv)
|
|
|
|
self.QTMainWindow = QtWidgets.QMainWindow()
|
|
|
|
self.main_window = Ui_MainWindow()
|
|
self.main_window.setupUi(self.QTMainWindow)
|
|
|
|
connect_gui(self)
|
|
|
|
def open_file(self, file_path):
|
|
self.open_files[file_path] = file_path.split("/")[-1] # set name that shows in the tab list
|
|
self.main_window.openFileTabs.addTab(
|
|
QtWidgets.QWidget(self.main_window.openFileTabs),
|
|
self.open_files[file_path]
|
|
)
|
|
|
|
def run(self):
|
|
self.QTMainWindow.show()
|
|
sys.exit(self.qt_app.exec())
|
|
|
|
|
|
if __name__ == "__main__":
|
|
editor = BreadEditor()
|
|
editor.run()
|