Merge branch 'milan'
commit
bddd43e51b
|
@ -1,5 +1,5 @@
|
||||||
|
from email import message
|
||||||
from PySide6 import QtWidgets
|
from PySide6 import QtWidgets
|
||||||
#import gui_helper
|
|
||||||
import util
|
import util
|
||||||
|
|
||||||
app = QtWidgets.QApplication([])
|
app = QtWidgets.QApplication([])
|
||||||
|
@ -52,6 +52,17 @@ class Window(QtWidgets.QMainWindow):
|
||||||
menu_item = menu.addAction(entry)
|
menu_item = menu.addAction(entry)
|
||||||
menu_item.triggered.connect(menu_dict[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:
|
#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
|
# - 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
|
# - 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
|
||||||
|
|
|
@ -1,9 +1,18 @@
|
||||||
import util
|
import util
|
||||||
|
import gui_handler
|
||||||
|
|
||||||
def not_implemented():
|
def not_implemented():
|
||||||
util.warn("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:
|
# format:
|
||||||
# "":{} -> menu or submenu
|
# "":{} -> menu or submenu
|
||||||
# "":function -> menu entry
|
# "":function -> menu entry
|
||||||
|
@ -60,6 +69,6 @@ menu_structure = {
|
||||||
},
|
},
|
||||||
"Help": {
|
"Help": {
|
||||||
"Manual...": not_implemented,
|
"Manual...": not_implemented,
|
||||||
"About IDE...": not_implemented,
|
"About IDE...": about_concorde,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
5
main.py
5
main.py
|
@ -26,9 +26,10 @@ configuration = Config(configuration_file_path, default_configuration)
|
||||||
# PROGRAM MAIN WINDOW
|
# 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)
|
main_window.update_menus(gui_helper.menu_structure)
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in New Issue