diff --git a/bread_editor/connect_gui.py b/bread_editor/connect_gui.py deleted file mode 100644 index d9ee6c1..0000000 --- a/bread_editor/connect_gui.py +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/python3 - -def connect_gui(app): - app.gui.main_window.openFile.triggered.connect(app.file_actions.open_files) - app.gui.main_window.newFile.triggered.connect(lambda: app.file_actions.create_file()) - app.gui.main_window.saveFile.triggered.connect(app.file_actions.save_current_file) - app.gui.main_window.saveFileAs.triggered.connect(app.file_actions.save_current_file_as) - - app.gui.main_window.menuSettings.triggered.connect(app.gui.main_window.settingsDock.show) - - app.gui.main_window.bitsAreSquaresSetting.stateChanged.connect(app.utils.update_style_in_all_bit_editors) - app.gui.main_window.highlightOnesSetting.stateChanged.connect(app.utils.update_style_in_all_bit_editors) - - app.gui.main_window.openFileTabs.tabCloseRequested.connect(app.file_actions.close_current_file) - app.gui.QTMainWindow.closeEvent = app.utils.on_close diff --git a/bread_editor/main.py b/bread_editor/main.py index 5cb0d5d..fc11e69 100755 --- a/bread_editor/main.py +++ b/bread_editor/main.py @@ -24,7 +24,6 @@ class BreadEditor: self.gui = GUI(self) - self.gui.connect_gui(self) self.open_files: dict[str, File] = {} self.open_files_queue = [] diff --git a/bread_editor/ui.py b/bread_editor/ui.py index ec6862c..a866707 100644 --- a/bread_editor/ui.py +++ b/bread_editor/ui.py @@ -2,7 +2,6 @@ from PyQt6.QtWidgets import QApplication, QMainWindow from bread_editor.gui.main_window import Ui_MainWindow -from bread_editor.connect_gui import connect_gui class GUI: @@ -15,8 +14,7 @@ class GUI: self.main_window = Ui_MainWindow() self.setup_gui() - - self.connect_gui = connect_gui + self.connect_gui() def setup_gui(self): self.main_window.setupUi(self.QTMainWindow) @@ -30,3 +28,17 @@ class GUI: self.main_window.highlightOnesSetting.setChecked(self.app.settings.highlight_ones) self.app.utils.update_style_in_all_bit_editors() + + def connect_gui(self): + self.main_window.openFile.triggered.connect(self.app.file_actions.open_files) + self.main_window.newFile.triggered.connect(lambda: self.app.file_actions.create_file()) + self.main_window.saveFile.triggered.connect(self.app.file_actions.save_current_file) + self.main_window.saveFileAs.triggered.connect(self.app.file_actions.save_current_file_as) + + self.main_window.menuSettings.triggered.connect(self.main_window.settingsDock.show) + + self.main_window.bitsAreSquaresSetting.stateChanged.connect(self.app.utils.update_style_in_all_bit_editors) + self.main_window.highlightOnesSetting.stateChanged.connect(self.app.utils.update_style_in_all_bit_editors) + + self.main_window.openFileTabs.tabCloseRequested.connect(self.app.file_actions.close_current_file) + self.QTMainWindow.closeEvent = self.app.utils.on_close