Commit dd068eea authored by Artur Grunau's avatar Artur Grunau
Browse files

Add a "Tools" submenu to the main menu

The "Tools" submenu lists all standard docked tools offered by the
application (i.e. "Pipeline tree", "Pipeline properties", and "Log
viewer"), and lets the user toggle their visibility.
parent c8ef752b
......@@ -162,11 +162,21 @@ namespace campvis {
}
void MainWindow::populateMainMenu() {
// Populate the file menu
QMenuBar* menuBar = this->menuBar();
QMenu* fileMenu = menuBar->addMenu(tr("&File"));
fileMenu->addAction(tr("&Quit"), qApp, SLOT(closeAllWindows()), QKeySequence(Qt::CTRL + Qt::Key_Q));
menuBar->addMenu(_mdiArea->menu());
// Populate the visualizations menu
QMenu* visualizationsMenu = _mdiArea->menu();
visualizationsMenu->setTitle(tr("&Visualizations"));
menuBar->addMenu(visualizationsMenu);
// Populate the tools menu
QMenu* toolsMenu = menuBar->addMenu(tr("&Tools"));
toolsMenu->addAction(ui.pipelineTreeDock->toggleViewAction());
toolsMenu->addAction(ui.pipelinePropertiesDock->toggleViewAction());
toolsMenu->addAction(ui.logViewerDock->toggleViewAction());
}
bool MainWindow::eventFilter(QObject* watched, QEvent* event) {
......
......@@ -46,7 +46,7 @@ namespace campvis {
this->setDocumentMode(true);
// Menu setup
_menu = new QMenu(tr("&Visualizations"));
_menu = new QMenu(this);
QActionGroup* displayStyleActions = new QActionGroup(this);
QAction* displayTiledAction = displayStyleActions->addAction(tr("Display tiled"));
......
......@@ -13,8 +13,7 @@
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget">
</widget>
<widget class="QWidget" name="centralwidget"/>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
......@@ -30,6 +29,9 @@
<property name="allowedAreas">
<set>Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea</set>
</property>
<property name="windowTitle">
<string>Pipeline tree</string>
</property>
<attribute name="dockWidgetArea">
<number>1</number>
</attribute>
......@@ -39,12 +41,18 @@
<property name="allowedAreas">
<set>Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea</set>
</property>
<property name="windowTitle">
<string>Pipeline properties</string>
</property>
<attribute name="dockWidgetArea">
<number>1</number>
</attribute>
<widget class="QWidget" name="pipelinePropertiesDockContents"/>
</widget>
<widget class="QDockWidget" name="logViewerDock">
<property name="windowTitle">
<string>Log viewer</string>
</property>
<attribute name="dockWidgetArea">
<number>8</number>
</attribute>
......
Markdown is supported
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