Commit 6d20e85d authored by dogmaphobic's avatar dogmaphobic

Merge remote-tracking branch 'mavlink/master' into toggleMapButtons

* mavlink/master:
  Increase size of controls for tablet
  Make sync warning less tall
  Use Flickable to allow scroll on Tablet
  More header fixes for Mobile build
  More header moves for Mobile build
  More header moves for no widgets in Mobile build
  Move widget controllers out of Mobile build
  QGCUnconnectedInfoWidget needed in Mobile builds
  Remove widget code from Mobile builds
parents f299ff45 76077ac5
......@@ -153,7 +153,6 @@ INCLUDEPATH += \
src/ui/linechart \
src/ui/map \
src/ui/mapdisplay \
src/ui/mavlink \
src/ui/mission \
src/ui/px4_configuration \
src/ui/toolbar \
......@@ -166,28 +165,18 @@ FORMS += \
src/ui/Linechart.ui \
src/ui/LogReplayLinkConfigurationWidget.ui \
src/ui/MainWindow.ui \
src/ui/mavlink/QGCMAVLinkMessageSender.ui \
src/ui/MAVLinkSettingsWidget.ui \
src/ui/MultiVehicleDockWidget.ui \
src/ui/QGCCommConfiguration.ui \
src/ui/QGCDataPlot2D.ui \
src/ui/QGCLinkConfiguration.ui \
src/ui/QGCMapRCToParamDialog.ui \
src/ui/QGCMAVLinkInspector.ui \
src/ui/QGCMAVLinkLogPlayer.ui \
src/ui/QGCPluginHost.ui \
src/ui/QGCTabbedInfoView.ui \
src/ui/QGCTCPLinkConfiguration.ui \
src/ui/QGCUASFileView.ui \
src/ui/QGCUASFileViewMulti.ui \
src/ui/QGCUDPLinkConfiguration.ui \
src/ui/SettingsDialog.ui \
src/ui/uas/QGCUnconnectedInfoWidget.ui \
src/ui/uas/UASMessageView.ui \
src/ui/uas/UASQuickView.ui \
src/ui/uas/UASQuickViewItemSelect.ui \
src/ui/UASInfo.ui \
src/ui/UASRawStatusView.ui \
!iOSBuild {
FORMS += \
......@@ -196,10 +185,19 @@ FORMS += \
!MobileBuild {
FORMS += \
src/ui/MultiVehicleDockWidget.ui \
src/ui/QGCHilConfiguration.ui \
src/ui/QGCHilFlightGearConfiguration.ui \
src/ui/QGCHilJSBSimConfiguration.ui \
src/ui/QGCHilXPlaneConfiguration.ui \
src/ui/QGCMAVLinkInspector.ui \
src/ui/QGCTabbedInfoView.ui \
src/ui/QGCUASFileView.ui \
src/ui/QGCUASFileViewMulti.ui \
src/ui/uas/UASQuickView.ui \
src/ui/uas/UASQuickViewItemSelect.ui \
src/ui/UASInfo.ui \
src/ui/UASRawStatusView.ui \
}
HEADERS += \
......@@ -232,7 +230,6 @@ HEADERS += \
src/QGCApplication.h \
src/QGCComboBox.h \
src/QGCConfig.h \
src/QGCDockWidget.h \
src/QGCFileDialog.h \
src/QGCGeo.h \
src/QGCLoggingCategory.h \
......@@ -263,37 +260,20 @@ HEADERS += \
src/ui/linechart/ScrollZoomer.h \
src/ui/LogReplayLinkConfigurationWidget.h \
src/ui/MainWindow.h \
src/ui/mavlink/QGCMAVLinkMessageSender.h \
src/ui/MAVLinkDecoder.h \
src/ui/MAVLinkSettingsWidget.h \
src/ui/MultiVehicleDockWidget.h \
src/ui/QGCCommConfiguration.h \
src/ui/QGCDataPlot2D.h \
src/ui/QGCLinkConfiguration.h \
src/ui/QGCMainWindowAPConfigurator.h \
src/ui/QGCMapRCToParamDialog.h \
src/ui/QGCMAVLinkInspector.h \
src/ui/QGCMAVLinkLogPlayer.h \
src/ui/QGCPluginHost.h \
src/ui/QGCTabbedInfoView.h \
src/ui/QGCTCPLinkConfiguration.h \
src/ui/QGCUASFileView.h \
src/ui/QGCUASFileViewMulti.h \
src/ui/QGCUDPLinkConfiguration.h \
src/ui/SettingsDialog.h \
src/ui/toolbar/MainToolBar.h \
src/ui/uas/QGCUnconnectedInfoWidget.h \
src/ui/uas/UASInfoWidget.h \
src/ui/uas/UASMessageView.h \
src/ui/uas/UASQuickView.h \
src/ui/uas/UASQuickViewGaugeItem.h \
src/ui/uas/UASQuickViewItem.h \
src/ui/uas/UASQuickViewItemSelect.h \
src/ui/uas/UASQuickViewTextItem.h \
src/ui/UASRawStatusView.h \
src/ViewWidgets/CustomCommandWidget.h \
src/ViewWidgets/CustomCommandWidgetController.h \
src/ViewWidgets/ViewWidgetController.h \
src/MissionItem.h \
src/AutoPilotPlugins/PX4/PX4AirframeLoader.h
......@@ -309,13 +289,29 @@ HEADERS += \
src/comm/QGCHilLink.h \
src/comm/QGCJSBSimLink.h \
src/comm/QGCXPlaneLink.h \
src/QGCDockWidget.h \
src/ui/CameraView.h \
src/ui/HILDockWidget.h \
src/ui/MultiVehicleDockWidget.h \
src/ui/QGCHilConfiguration.h \
src/ui/QGCHilFlightGearConfiguration.h \
src/ui/QGCHilJSBSimConfiguration.h \
src/ui/QGCHilXPlaneConfiguration.h \
src/ui/QGCMAVLinkInspector.h \
src/ui/QGCTabbedInfoView.h \
src/ui/QGCUASFileView.h \
src/ui/QGCUASFileViewMulti.h \
src/ui/uas/UASInfoWidget.h \
src/ui/uas/UASQuickView.h \
src/ui/uas/UASQuickViewGaugeItem.h \
src/ui/uas/UASQuickViewItem.h \
src/ui/uas/UASQuickViewItemSelect.h \
src/ui/uas/UASQuickViewTextItem.h \
src/ui/UASRawStatusView.h \
src/VehicleSetup/JoystickConfigController.h \
src/ViewWidgets/CustomCommandWidget.h \
src/ViewWidgets/CustomCommandWidgetController.h \
src/ViewWidgets/ViewWidgetController.h \
}
SOURCES += \
......@@ -344,7 +340,6 @@ SOURCES += \
src/QGC.cc \
src/QGCApplication.cc \
src/QGCComboBox.cc \
src/QGCDockWidget.cc \
src/QGCFileDialog.cc \
src/QGCLoggingCategory.cc \
src/QGCPalette.cc \
......@@ -370,37 +365,20 @@ SOURCES += \
src/ui/linechart/ScrollZoomer.cc \
src/ui/LogReplayLinkConfigurationWidget.cc \
src/ui/MainWindow.cc \
src/ui/mavlink/QGCMAVLinkMessageSender.cc \
src/ui/MAVLinkDecoder.cc \
src/ui/MAVLinkSettingsWidget.cc \
src/ui/MultiVehicleDockWidget.cc \
src/ui/QGCCommConfiguration.cc \
src/ui/QGCDataPlot2D.cc \
src/ui/QGCLinkConfiguration.cc \
src/ui/QGCMainWindowAPConfigurator.cc \
src/ui/QGCMapRCToParamDialog.cpp \
src/ui/QGCMAVLinkInspector.cc \
src/ui/QGCMAVLinkLogPlayer.cc \
src/ui/QGCPluginHost.cc \
src/ui/QGCTabbedInfoView.cpp \
src/ui/QGCTCPLinkConfiguration.cc \
src/ui/QGCUASFileView.cc \
src/ui/QGCUASFileViewMulti.cc \
src/ui/QGCUDPLinkConfiguration.cc \
src/ui/SettingsDialog.cc \
src/ui/toolbar/MainToolBar.cc \
src/ui/uas/QGCUnconnectedInfoWidget.cc \
src/ui/uas/UASInfoWidget.cc \
src/ui/uas/UASMessageView.cc \
src/ui/uas/UASQuickView.cc \
src/ui/uas/UASQuickViewGaugeItem.cc \
src/ui/uas/UASQuickViewItem.cc \
src/ui/uas/UASQuickViewItemSelect.cc \
src/ui/uas/UASQuickViewTextItem.cc \
src/ui/UASRawStatusView.cpp \
src/ViewWidgets/CustomCommandWidget.cc \
src/ViewWidgets/CustomCommandWidgetController.cc \
src/ViewWidgets/ViewWidgetController.cc \
src/MissionItem.cc \
src/AutoPilotPlugins/PX4/PX4AirframeLoader.cc
......@@ -415,13 +393,29 @@ SOURCES += \
src/comm/QGCFlightGearLink.cc \
src/comm/QGCJSBSimLink.cc \
src/comm/QGCXPlaneLink.cc \
src/QGCDockWidget.cc \
src/ui/CameraView.cc \
src/ui/HILDockWidget.cc \
src/ui/MultiVehicleDockWidget.cc \
src/ui/QGCHilConfiguration.cc \
src/ui/QGCHilFlightGearConfiguration.cc \
src/ui/QGCHilJSBSimConfiguration.cc \
src/ui/QGCHilXPlaneConfiguration.cc \
src/ui/QGCMAVLinkInspector.cc \
src/ui/QGCTabbedInfoView.cpp \
src/ui/QGCUASFileView.cc \
src/ui/QGCUASFileViewMulti.cc \
src/ui/uas/UASInfoWidget.cc \
src/ui/uas/UASQuickView.cc \
src/ui/uas/UASQuickViewGaugeItem.cc \
src/ui/uas/UASQuickViewItem.cc \
src/ui/uas/UASQuickViewItemSelect.cc \
src/ui/uas/UASQuickViewTextItem.cc \
src/ui/UASRawStatusView.cpp \
src/VehicleSetup/JoystickConfigController.cc \
src/ViewWidgets/CustomCommandWidget.cc \
src/ViewWidgets/CustomCommandWidgetController.cc \
src/ViewWidgets/ViewWidgetController.cc \
}
#
......
......@@ -29,6 +29,7 @@
#include "QGCMessageBox.h"
#include "MainWindow.h"
#include "ParameterLoader.h"
#include "UAS.h"
AutoPilotPlugin::AutoPilotPlugin(Vehicle* vehicle, QObject* parent)
: QObject(parent)
......
......@@ -28,6 +28,7 @@
#include "FlightModesComponentController.h"
#include "AirframeComponentController.h"
#include "QGCMessageBox.h"
#include "UAS.h"
/// @file
/// @brief This is the AutoPilotPlugin implementatin for the MAV_AUTOPILOT_PX4 type.
......
This diff is collapsed.
......@@ -27,6 +27,7 @@
#include "PowerComponentController.h"
#include "QGCMAVLink.h"
#include "QGCMessageBox.h"
#include "UAS.h"
#include <QVariant>
#include <QQmlProperty>
......
......@@ -27,6 +27,7 @@
#include "SensorsComponentController.h"
#include "QGCMAVLink.h"
#include "QGCMessageBox.h"
#include "UAS.h"
#include <QVariant>
#include <QQmlProperty>
......
......@@ -24,6 +24,7 @@
#include "FactPanelController.h"
#include "MultiVehicleManager.h"
#include "QGCMessageBox.h"
#include "UAS.h"
#include <QQmlEngine>
......
......@@ -31,6 +31,7 @@
#include "QGCMessageBox.h"
#include "UASMessageHandler.h"
#include "FirmwarePlugin.h"
#include "UAS.h"
#include <QFile>
#include <QDebug>
......
......@@ -115,7 +115,7 @@ QGCView {
Rectangle {
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
width: parent.width / 3
width: parent.width * 0.75
height: syncNeededText.height + (ScreenTools.defaultFontPixelWidth * 2)
border.width: 1
border.color: "white"
......
......@@ -163,9 +163,6 @@ QGCApplication::QGCApplication(int &argc, char* argv[], bool unitTesting)
, _runningUnitTests(unitTesting)
, _styleIsDark(true)
, _fakeMobile(false)
#ifdef UNITTEST_BUILD
, _useNewMissionEditor(true) // Unit Tests run new mission editor
#endif
#ifdef QT_DEBUG
, _testHighDPI(false)
#endif
......@@ -337,9 +334,7 @@ void QGCApplication::_initCommon(void)
qmlRegisterUncreatableType<QGCQGeoCoordinate> ("QGroundControl", 1, 0, "QGCQGeoCoordinate", "Reference only");
qmlRegisterUncreatableType<CoordinateVector> ("QGroundControl", 1, 0, "CoordinateVector", "Reference only");
qmlRegisterType<ViewWidgetController> ("QGroundControl.Controllers", 1, 0, "ViewWidgetController");
qmlRegisterType<ParameterEditorController> ("QGroundControl.Controllers", 1, 0, "ParameterEditorController");
qmlRegisterType<CustomCommandWidgetController> ("QGroundControl.Controllers", 1, 0, "CustomCommandWidgetController");
qmlRegisterType<FlightModesComponentController> ("QGroundControl.Controllers", 1, 0, "FlightModesComponentController");
qmlRegisterType<AirframeComponentController> ("QGroundControl.Controllers", 1, 0, "AirframeComponentController");
qmlRegisterType<SensorsComponentController> ("QGroundControl.Controllers", 1, 0, "SensorsComponentController");
......@@ -348,6 +343,8 @@ void QGCApplication::_initCommon(void)
qmlRegisterType<ScreenToolsController> ("QGroundControl.Controllers", 1, 0, "ScreenToolsController");
#ifndef __mobile__
qmlRegisterType<ViewWidgetController> ("QGroundControl.Controllers", 1, 0, "ViewWidgetController");
qmlRegisterType<CustomCommandWidgetController> ("QGroundControl.Controllers", 1, 0, "CustomCommandWidgetController");
qmlRegisterType<FirmwareUpgradeController> ("QGroundControl.Controllers", 1, 0, "FirmwareUpgradeController");
qmlRegisterType<JoystickConfigController> ("QGroundControl.Controllers", 1, 0, "JoystickConfigController");
#endif
......@@ -420,14 +417,6 @@ bool QGCApplication::_initForNormalAppBoot(void)
_styleIsDark = settings.value(_styleKey, _styleIsDark).toBool();
_loadCurrentStyle();
// Temp hack for new mission editor
#ifdef __mobile__
// Mobile builds always use new Mission Editor
_useNewMissionEditor = true;
#else
_useNewMissionEditor = settings.value("UseNewMissionEditor", false).toBool();
#endif
// Show splash screen
QPixmap splashImage(":/res/SplashScreen");
QSplashScreen* splashScreen = new QSplashScreen(splashImage);
......
......@@ -178,8 +178,6 @@ private:
QStringList _missingParams; ///< List of missing facts to be displayed
bool _fakeMobile; ///< true: Fake ui into displaying mobile interface
bool _useNewMissionEditor; ///< true: Use new Mission Editor
#ifdef QT_DEBUG
bool _testHighDPI; ///< true: double fonts sizes for simulating high dpi devices
......
......@@ -32,6 +32,7 @@
#include <QRegularExpression>
#include <QMessageBox>
#include <QPushButton>
QString QGCFileDialog::getExistingDirectory(
QWidget* parent,
......
......@@ -64,7 +64,7 @@ Button {
background: Item {
property bool down: control.pressed || (control.checkable && control.checked)
implicitWidth: Math.round(TextSingleton.implicitHeight * 4.5)
implicitHeight: Math.max(25, Math.round(TextSingleton.implicitHeight * 1.2))
implicitHeight: ScreenTools.isMobile ? ScreenTools.defaultFontPixelHeight * 3 * 0.75 : Math.max(25, Math.round(TextSingleton.implicitHeight * 1.2))
Rectangle {
anchors.fill: parent
......
......@@ -11,7 +11,7 @@ CheckBox {
style: CheckBoxStyle {
label: Item {
implicitWidth: text.implicitWidth + 2
implicitHeight: text.implicitHeight
implicitHeight: ScreenTools.isMobile ? ScreenTools.defaultFontPixelHeight * 3 * 0.75 : text.implicitHeight
baselineOffset: text.baselineOffset
Rectangle {
anchors.fill: text
......
......@@ -18,7 +18,7 @@ ComboBox {
background: Item {
implicitWidth: Math.round(TextSingleton.implicitHeight * 4.5)
implicitHeight: Math.max(25, Math.round(TextSingleton.implicitHeight * 1.2))
implicitHeight: ScreenTools.isMobile ? ScreenTools.defaultFontPixelHeight * 3 * 0.75 : Math.max(25, Math.round(TextSingleton.implicitHeight * 1.2))
Rectangle {
anchors.fill: parent
......
......@@ -11,7 +11,7 @@ RadioButton {
style: RadioButtonStyle {
label: Item {
implicitWidth: text.implicitWidth + 2
implicitHeight: text.implicitHeight
implicitHeight: ScreenTools.isMobile ? ScreenTools.defaultFontPixelHeight * 3 * 0.75 : text.implicitHeight
baselineOffset: text.y + text.baselineOffset
Rectangle {
anchors.fill: text
......
......@@ -12,6 +12,7 @@ TextField {
property var __qgcPal: QGCPalette { colorGroupEnabled: enabled }
textColor: __qgcPal.textFieldText
height: ScreenTools.isMobile ? ScreenTools.defaultFontPixelHeight * 3 * 0.75 : implicitHeight
Label {
id: unitsLabelWidthGenerator
......
......@@ -31,21 +31,25 @@ This file is part of the QGROUNDCONTROL project
#include <QtGlobal>
#include <QApplication>
#include <QSslSocket>
#include <QProcessEnvironment>
#ifndef __mobile__
#include <QSerialPortInfo>
#include <QSerialPortInfo>
#endif
#include <QProcessEnvironment>
#include "QGCApplication.h"
#include "MainWindow.h"
#ifdef QT_DEBUG
#ifndef __mobile__
#include "UnitTest.h"
#endif
#include "CmdLineOptParser.h"
#ifdef Q_OS_WIN
#include <crtdbg.h>
#endif
#ifndef __mobile__
#include "UnitTest.h"
#endif
#include "CmdLineOptParser.h"
#ifdef Q_OS_WIN
#include <crtdbg.h>
#endif
#endif
#include <iostream>
/* SDL does ugly things to main() */
......
......@@ -33,11 +33,11 @@ This file is part of the QGROUNDCONTROL project
#include <QTimer>
#include <QHostInfo>
#include <QSplashScreen>
#include <QQuickView>
#include <QDesktopWidget>
#include <QScreen>
#include <QDesktopServices>
#include <QDockWidget>
#include "QGC.h"
#include "MAVLinkProtocol.h"
......@@ -46,27 +46,28 @@ This file is part of the QGROUNDCONTROL project
#include "QGCMAVLinkLogPlayer.h"
#include "SettingsDialog.h"
#include "MAVLinkDecoder.h"
#include "QGCMAVLinkMessageSender.h"
#include "UASQuickView.h"
#include "QGCDataPlot2D.h"
#include "Linecharts.h"
#include "QGCTabbedInfoView.h"
#include "UASRawStatusView.h"
#include "FlightDisplayView.h"
#include "FlightDisplayWidget.h"
#include "SetupView.h"
#include "QGCUASFileViewMulti.h"
#include "QGCApplication.h"
#include "QGCFileDialog.h"
#include "QGCMessageBox.h"
#include "QGCDockWidget.h"
#include "MultiVehicleManager.h"
#include "CustomCommandWidget.h"
#include "HomePositionManager.h"
#include "MissionEditor.h"
#include "LogCompressor.h"
#include "UAS.h"
#ifndef __mobile__
#include "QGCUASFileViewMulti.h"
#include "UASQuickView.h"
#include "QGCTabbedInfoView.h"
#include "UASRawStatusView.h"
#include "CustomCommandWidget.h"
#include "QGCDockWidget.h"
#include "FlightDisplayWidget.h"
#include "UASInfoWidget.h"
#include "HILDockWidget.h"
#endif
......@@ -86,6 +87,7 @@ This file is part of the QGROUNDCONTROL project
/// The key under which the Main Window settings are saved
const char* MAIN_SETTINGS_GROUP = "QGC_MAINWINDOW";
#ifndef __mobile__
const char* MainWindow::_mavlinkDockWidgetName = "MAVLINK_INSPECTOR_DOCKWIDGET";
const char* MainWindow::_customCommandWidgetName = "CUSTOM_COMMAND_DOCKWIDGET";
const char* MainWindow::_filesDockWidgetName = "FILE_VIEW_DOCKWIDGET";
......@@ -94,6 +96,7 @@ const char* MainWindow::_mapViewDockWidgetName = "MAP_VIEW_DOCKWIDGET";
const char* MainWindow::_pfdDockWidgetName = "PRIMARY_FLIGHT_DISPLAY_DOCKWIDGET";
const char* MainWindow::_uasInfoViewDockWidgetName = "UAS_INFO_INFOVIEW_DOCKWIDGET";
const char* MainWindow::_hilDockWidgetName = "HIL_DOCKWIDGET";
#endif
static MainWindow* _instance = NULL; ///< @brief MainWindow singleton
......@@ -162,10 +165,12 @@ MainWindow::MainWindow(QSplashScreen* splashScreen)
menuBar()->setNativeMenuBar(false);
#endif
#ifndef __mobile__
#ifdef UNITTEST_BUILD
QAction* qmlTestAction = new QAction("Test QML palette and controls", NULL);
connect(qmlTestAction, &QAction::triggered, this, &MainWindow::_showQmlTestWidget);
_ui.menuWidgets->addAction(qmlTestAction);
#endif
#endif
// Load QML Toolbar
......@@ -184,9 +189,12 @@ MainWindow::MainWindow(QSplashScreen* splashScreen)
setStatusBar(new QStatusBar(this));
statusBar()->setSizeGripEnabled(true);
#ifndef __mobile__
emit initStatusChanged(tr("Building common widgets."), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141));
_buildCommonWidgets();
emit initStatusChanged(tr("Building common actions"), Qt::AlignLeft | Qt::AlignBottom, QColor(62, 93, 141));
#endif
// Create actions
connectCommonActions();
// Connect user interface devices
......@@ -332,6 +340,7 @@ QString MainWindow::_getWindowGeometryKey()
return "_geometry";
}
#ifndef __mobile__
void MainWindow::_createDockWidget(const QString& title, const QString& name, Qt::DockWidgetArea area, QWidget* innerWidget)
{
Q_ASSERT(!_mapName2DockWidget.contains(name));
......@@ -401,46 +410,6 @@ void MainWindow::_buildCommonWidgets(void)
}
}
void MainWindow::_buildMissionEditorView(void)
{
if (!_missionEditorView) {
_missionEditorView = new MissionEditor(this);
_missionEditorView->setVisible(false);
}
}
void MainWindow::_buildFlightView(void)
{
if (!_flightView) {
_flightView = new FlightDisplayView(this);
_flightView->setVisible(false);
}
}
void MainWindow::_buildSetupView(void)
{
if (!_setupView) {
_setupView = new SetupView(this);
_setupView->setVisible(false);
}
}
void MainWindow::_buildAnalyzeView(void)
{
if (!_analyzeView) {
_analyzeView = new QGCDataPlot2D(this);
_analyzeView->setVisible(false);
}
}
void MainWindow::_buildSimView(void)
{
if (!_simView) {
_simView = new FlightDisplayView(this);
_simView->setVisible(false);
}
}
/// Shows or hides the specified dock widget, creating if necessary
void MainWindow::_showDockWidget(const QString& name, bool show)
{
......@@ -449,18 +418,18 @@ void MainWindow::_showDockWidget(const QString& name, bool show)
// Which would cause us to end up here.
return;
}
// Create the inner widget if we need to
if (!_mapName2DockWidget[name]->widget()) {
_createInnerDockWidget(name);
}
Q_ASSERT(_mapName2DockWidget.contains(name));
QDockWidget* dockWidget = _mapName2DockWidget[name];
Q_ASSERT(dockWidget);
dockWidget->setVisible(show);
Q_ASSERT(_mapDockWidget2Action.contains(dockWidget));
_mapDockWidget2Action[dockWidget]->setChecked(show);
}
......@@ -470,9 +439,9 @@ void MainWindow::_createInnerDockWidget(const QString& widgetName)
{
Q_ASSERT(_mapName2DockWidget.contains(widgetName)); // QDockWidget should already exist
Q_ASSERT(!_mapName2DockWidget[widgetName]->widget()); // Inner widget should not
QWidget* widget = NULL;
if (widgetName == _mavlinkDockWidgetName) {
widget = new QGCMAVLinkInspector(MAVLinkProtocol::instance(),this);
} else if (widgetName == _customCommandWidgetName) {
......@@ -494,7 +463,7 @@ void MainWindow::_createInnerDockWidget(const QString& widgetName)
} else {
qWarning() << "Attempt to create unknown Inner Dock Widget" << widgetName;
}
if (widget) {
QDockWidget* dockWidget = _mapName2DockWidget[widgetName];
Q_CHECK_PTR(dockWidget);
......@@ -503,6 +472,53 @@ void MainWindow::_createInnerDockWidget(const QString& widgetName)
}
}
void MainWindow::_hideAllDockWidgets(void)
{
foreach(QDockWidget* dockWidget, _mapName2DockWidget) {
dockWidget->setVisible(false);
}
}
void MainWindow::_showDockWidgetAction(bool show)
{
QAction* action = dynamic_cast<QAction*>(QObject::sender());
Q_ASSERT(action);
_showDockWidget(action->data().toString(), show);
}
#endif
void MainWindow::_buildMissionEditorView(void)
{
if (!_missionEditorView) {
_missionEditorView = new MissionEditor(this);
_missionEditorView->setVisible(false);
}
}
void MainWindow::_buildFlightView(void)
{
if (!_flightView) {
_flightView = new FlightDisplayView(this);
_flightView->setVisible(false);
}
}
void MainWindow::_buildSetupView(void)
{
if (!_setupView) {
_setupView = new SetupView(this);
_setupView->setVisible(false);
}
}
void MainWindow::_buildAnalyzeView(void)
{
if (!_analyzeView) {
_analyzeView = new QGCDataPlot2D(this);
_analyzeView->setVisible(false);
}
}
void MainWindow::fullScreenActionItemCallback(bool)
{
_ui.actionNormal->setChecked(false);
......@@ -804,10 +820,10 @@ void MainWindow::_loadCurrentViewState(void)
_centralLayout->setContentsMargins(0, 0, 0, 0);
_currentViewWidget->setVisible(true);
#ifndef __mobile__
// Hide all widgets from previous view
_hideAllDockWidgets();
#ifndef __mobile__
// Restore the widgets for the new view
QString widgetNames = settings.value(_getWindowStateKey() + "WIDGETS", defaultWidgets).toString();
qDebug() << widgetNames;
......@@ -829,21 +845,6 @@ void MainWindow::_loadCurrentViewState(void)
emit repaintCanvas();
}
void MainWindow::_hideAllDockWidgets(void)
{
foreach(QDockWidget* dockWidget, _mapName2DockWidget) {
dockWidget->setVisible(false);
}
}
void MainWindow::_showDockWidgetAction(bool show)
{
QAction* action = dynamic_cast<QAction*>(QObject::sender());
Q_ASSERT(action);
_showDockWidget(action->data().toString(), show);
}
void MainWindow::loadAnalyzeView()
{
if (_currentView != VIEW_ANALYZE)
......
......@@ -41,7 +41,6 @@ This file is part of the QGROUNDCONTROL project
#include "LinkManager.h"
#include "LinkInterface.h"
#include "UASInterface.h"
#include "UASInfoWidget.h"
#include "CameraView.h"
#if (defined QGC_MOUSE_ENABLED_WIN) | (defined QGC_MOUSE_ENABLED_LINUX)
#include "Mouse6dofInput.h"
......@@ -53,16 +52,13 @@ This file is part of the QGROUNDCONTROL project
#include "QGCMAVLinkInspector.h"
#include "QGCMAVLinkLogPlayer.h"
#include "MAVLinkDecoder.h"
#include "QGCUASFileViewMulti.h"
#include "Vehicle.h"
class QGCMAVLinkMessageSender;
class QGCFirmwareUpdate;
class QSplashScreen;
class QGCStatusBar;
class Linecharts;
class QGCDataPlot2D;
class QGCUASFileViewMulti;
/**
* @brief Main Application Window
......@@ -212,19 +208,11 @@ protected:
// Center widgets
QPointer<Linecharts> linechartWidget;
#ifdef QGC_OSG_ENABLED
QPointer<QWidget> q3DWidget;
#endif
QPointer<QGCFirmwareUpdate> firmwareUpdateWidget;
QPointer<MainToolBar> _mainToolBar;
QPointer<QDockWidget> mavlinkInspectorWidget;
QPointer<MAVLinkDecoder> mavlinkDecoder;
QPointer<QDockWidget> mavlinkSenderWidget;
QGCMAVLinkLogPlayer* logPlayer;