Bread_Editor/connect_gui.py
EKNr1 b2afa06ee1 Creating new files now actually works.
Somehow PyQt passed something to the new_file()-function, and it crashed every time because the variable was the wrong type.
2024-12-09 17:49:25 +01:00

15 lines
864 B
Python

#!/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