Merge branch 'milan'

master
BodgeMaster 2022-03-21 04:16:47 +01:00
commit bddd43e51b
3 changed files with 26 additions and 5 deletions

View File

@ -1,5 +1,5 @@
from email import message
from PySide6 import QtWidgets
#import gui_helper
import util
app = QtWidgets.QApplication([])
@ -52,6 +52,17 @@ class Window(QtWidgets.QMainWindow):
menu_item = menu.addAction(entry)
menu_item.triggered.connect(menu_dict[entry])
class Message(QtWidgets.QMessageBox):
def __init__(self, title, text):
super().__init__()
self.setWindowTitle(title)
self.setText(text)
self.setStandardButtons(QtWidgets.QMessageBox.Ok)
self.exec()
#TODO: This needs to run in a thread but Qt really doesn't want it to. There are two ways around this:
# - create the QtWidgets.QApplication inside a thread and run all QT stuff inside that thread
# - make a generic wrapper for window mainloop that will always run in the main thread while the actual main control flow of the program gets moved to another thread

View File

@ -1,9 +1,18 @@
import util
import gui_handler
def not_implemented():
util.warn("Not implemented!")
def about_concorde():
dialog = gui_handler.Message("About Concorde",
"""
Version: 0.0.1
Made by BodgeMaster and Shwoomple
""")
# format:
# "":{} -> menu or submenu
# "":function -> menu entry
@ -60,6 +69,6 @@ menu_structure = {
},
"Help": {
"Manual...": not_implemented,
"About IDE...": not_implemented,
"About IDE...": about_concorde,
}
}

View File

@ -26,9 +26,10 @@ configuration = Config(configuration_file_path, default_configuration)
# PROGRAM MAIN WINDOW
################################################################################
# It seems like opening multiple instances already works as intended
main_window = gui_handler.Window()
main_window.set_title("Concorde IDE")
main_window.set_size(configuration.get_configuration_value("window size")["x"], configuration.get_configuration_value("window size")["y"])
main_window = gui_handler.Window(title="Concorde IDE", size=(configuration.get_configuration_value("window size")["x"], configuration.get_configuration_value("window size")["y"]))
main_window.update_menus(gui_helper.menu_structure)