Commit a9ff6525 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[widgets][mainwindow] Add New menu

parent e9bcb841
......@@ -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
......
......@@ -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)
......
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