added about dialog, need to improve how it looks

master
Milan Suman 2022-03-20 15:44:57 +05:30
parent f805295620
commit 739ce9d8d8
2 changed files with 23 additions and 3 deletions

View File

@ -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

View File

@ -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,
} }
} }