Browse Source

File/Widgets menu are only in advanced mode

QGC4.4
Donald Gagne 8 years ago
parent
commit
2d714eaaba
  1. 14
      src/ui/MainWindow.cc
  2. 1
      src/ui/MainWindow.h
  3. 6
      src/ui/MainWindow.ui

14
src/ui/MainWindow.cc

@ -40,6 +40,7 @@ @@ -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() @@ -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) @@ -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();
}
}

1
src/ui/MainWindow.h

@ -158,6 +158,7 @@ private slots: @@ -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);

6
src/ui/MainWindow.ui

@ -54,7 +54,7 @@ @@ -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 @@ @@ -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 @@ @@ -98,7 +98,7 @@
<bool>true</bool>
</property>
<property name="text">
<string>Show Status Bar</string>
<string>Replay Flight Data</string>
</property>
</action>
</widget>

Loading…
Cancel
Save