Commit 079d6b96 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[widgets][mainwindow] Add about dialogs

parent 7e6be6c7
......@@ -24,6 +24,7 @@
###############################################################################
from PyQt5.QtWidgets import QMainWindow
from PyQt5.QtWidgets import QMessageBox
from PyQt5.QtWidgets import QSplitter
from PyQt5.QtWidgets import qApp
......@@ -44,14 +45,18 @@ class MainWindow(QMainWindow):
super(MainWindow, self).__init__(parent)
menubar = self.menuBar()
fileMenu = menubar.addMenu(self.tr("File"))
quitAction = fileMenu.addAction(self.tr("Quit"))
quitAction.setShortcut("CTRL+Q")
quitAction.triggered.connect(qApp.quit)
preferencesMenu = menubar.addMenu(self.tr("Preferences"))
settingsAction = preferencesMenu.addAction(self.tr("Settings"))
helpMenu = menubar.addMenu(self.tr("Help"))
aboutAction = helpMenu.addAction(self.tr("About"))
aboutQtAction = helpMenu.addAction(self.tr("About Qt"))
self.assetBrowser = AssetBrowser()
self.assetWidget = AssetWidget()
......@@ -61,6 +66,9 @@ class MainWindow(QMainWindow):
self.setCentralWidget(centralWidget)
self.assetBrowser.json_selected.connect(self.assetWidget.load_json)
quitAction.triggered.connect(qApp.quit)
aboutAction.triggered.connect(self.show_about)
aboutQtAction.triggered.connect(self.show_about_qt)
settingsAction.triggered.connect(self.show_settings)
self.load_settings()
......@@ -71,6 +79,24 @@ class MainWindow(QMainWindow):
self.assetBrowser.set_prefix_root(prefix_root_path)
self.assetWidget.set_prefix_root(prefix_root_path)
def show_about(self):
"""About box for the application"""
QMessageBox.about(
self,
self.tr("About"),
self.tr(
f"{qApp.applicationName()}\n"
f"Version: {qApp.applicationVersion()}\n"
"Copyright Idiap Research Institute"
),
)
def show_about_qt(self):
"""About box for Qt"""
QMessageBox.aboutQt(self, self.tr("About Qt"))
def show_settings(self):
"""Show settings dialog"""
pass
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment