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
a9ff6525
Commit
a9ff6525
authored
May 09, 2019
by
Samuel GAIST
Browse files
[widgets][mainwindow] Add New menu
parent
e9bcb841
Changes
2
Hide whitespace changes
Inline
Side-by-side
beat/editor/widgets/assetwidget.py
View file @
a9ff6525
...
...
@@ -264,6 +264,12 @@ class AssetWidget(QWidget):
for
i
in
range
(
0
,
self
.
editors
.
count
()):
self
.
editors
.
widget
(
i
).
set_context
(
context
)
def
create_actions
(
self
):
"""Return the creation actions of all editors"""
action_list
=
[
editor
.
create_action
for
editor
in
self
.
editors_type
.
values
()]
return
filter
(
None
,
action_list
)
def
load_json
(
self
,
file_path
):
""" Load the content of the file given in parameter
...
...
beat/editor/widgets/mainwindow.py
View file @
a9ff6525
...
...
@@ -47,6 +47,7 @@ class MainWindow(QMainWindow):
menubar
=
self
.
menuBar
()
fileMenu
=
menubar
.
addMenu
(
self
.
tr
(
"File"
))
newMenu
=
fileMenu
.
addMenu
(
self
.
tr
(
"New..."
))
quitAction
=
fileMenu
.
addAction
(
self
.
tr
(
"Quit"
))
quitAction
.
setShortcut
(
"CTRL+Q"
)
...
...
@@ -59,6 +60,8 @@ class MainWindow(QMainWindow):
self
.
assetBrowser
=
AssetBrowser
()
self
.
assetWidget
=
AssetWidget
()
for
action
in
self
.
assetWidget
.
create_actions
():
newMenu
.
addAction
(
action
)
centralWidget
=
QSplitter
()
centralWidget
.
addWidget
(
self
.
assetBrowser
)
...
...
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