Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.editor
Commits
079d6b96
Commit
079d6b96
authored
May 02, 2019
by
Samuel GAIST
Browse files
[widgets][mainwindow] Add about dialogs
parent
7e6be6c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
beat/editor/widgets/mainwindow.py
View file @
079d6b96
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment