Commit 2d714eaa authored by Donald Gagne's avatar Donald Gagne

File/Widgets menu are only in advanced mode

parent e7c302dc
......@@ -40,6 +40,7 @@
#include "LogCompressor.h"
#include "UAS.h"
#include "QGCImageProvider.h"
#include "QGCCorePlugin.h"
#ifndef __mobile__
#include "Linecharts.h"
......@@ -175,6 +176,9 @@ MainWindow::MainWindow()
_ui.menuWidgets->addAction(qmlTestAction);
#endif
connect(qgcApp()->toolbox()->corePlugin(), &QGCCorePlugin::showAdvancedUIChanged, this, &MainWindow::_showAdvancedUIChanged);
_showAdvancedUIChanged(qgcApp()->toolbox()->corePlugin()->showAdvancedUI());
// Status Bar
setStatusBar(new QStatusBar(this));
statusBar()->setSizeGripEnabled(true);
......@@ -558,3 +562,13 @@ QObject* MainWindow::rootQmlObject(void)
{
return _mainQmlWidgetHolder->getRootObject();
}
void MainWindow::_showAdvancedUIChanged(bool advanced)
{
if (advanced) {
menuBar()->addMenu(_ui.menuFile);
menuBar()->addMenu(_ui.menuWidgets);
} else {
menuBar()->clear();
}
}
......@@ -158,6 +158,7 @@ private slots:
void _closeWindow(void) { close(); }
void _vehicleAdded(Vehicle* vehicle);
void _showDockWidgetAction(bool show);
void _showAdvancedUIChanged(bool advanced);
#ifdef UNITTEST_BUILD
void _showQmlTestWidget(void);
......
......@@ -54,7 +54,7 @@
<height>22</height>
</rect>
</property>
<widget class="QMenu" name="menuMGround">
<widget class="QMenu" name="menuFile">
<property name="title">
<string>File</string>
</property>
......@@ -68,7 +68,7 @@
<string>Widgets</string>
</property>
</widget>
<addaction name="menuMGround"/>
<addaction name="menuFile"/>
<addaction name="menuWidgets"/>
</widget>
<widget class="QStatusBar" name="statusBar"/>
......@@ -98,7 +98,7 @@
<bool>true</bool>
</property>
<property name="text">
<string>Show Status Bar</string>
<string>Replay Flight Data</string>
</property>
</action>
</widget>
......
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