Skip to content

Commit

Permalink
Merge pull request mavlink#2365 from DonLakeFlyer/EvenMoreMBox
Browse files Browse the repository at this point in the history
Remove all message and file dialog code from mobile
  • Loading branch information
DonLakeFlyer committed Dec 6, 2015
2 parents 5e9fb55 + e8c87f8 commit 3c69032
Show file tree
Hide file tree
Showing 20 changed files with 132 additions and 93 deletions.
83 changes: 40 additions & 43 deletions qgroundcontrol.pro
Original file line number Diff line number Diff line change
Expand Up @@ -190,18 +190,8 @@ INCLUDEPATH += \
src/ViewWidgets \

FORMS += \
src/QGCQmlWidgetHolder.ui \
src/ui/MainWindow.ui \
src/ui/MAVLinkSettingsWidget.ui \
src/ui/QGCCommConfiguration.ui \
src/ui/QGCLinkConfiguration.ui \
src/ui/QGCMapRCToParamDialog.ui \
src/ui/QGCPluginHost.ui \
src/ui/QGCTCPLinkConfiguration.ui \
src/ui/QGCUDPLinkConfiguration.ui \
src/ui/SettingsDialog.ui \
src/ui/uas/QGCUnconnectedInfoWidget.ui \
src/ui/uas/UASMessageView.ui \
src/QGCQmlWidgetHolder.ui \

DebugBuild {
FORMS += \
Expand All @@ -215,19 +205,28 @@ FORMS += \

!MobileBuild {
FORMS += \
src/ui/LogReplayLinkConfigurationWidget.ui \
src/ui/QGCMAVLinkLogPlayer.ui \
src/ui/uas/QGCUnconnectedInfoWidget.ui \
src/ui/uas/UASMessageView.ui \
src/ui/Linechart.ui \
src/ui/LogReplayLinkConfigurationWidget.ui \
src/ui/MultiVehicleDockWidget.ui \
src/ui/MAVLinkSettingsWidget.ui \
src/ui/QGCCommConfiguration.ui \
src/ui/QGCDataPlot2D.ui \
src/ui/QGCHilConfiguration.ui \
src/ui/QGCHilFlightGearConfiguration.ui \
src/ui/QGCHilJSBSimConfiguration.ui \
src/ui/QGCHilXPlaneConfiguration.ui \
src/ui/QGCLinkConfiguration.ui \
src/ui/QGCMapRCToParamDialog.ui \
src/ui/QGCMAVLinkInspector.ui \
src/ui/QGCMAVLinkLogPlayer.ui \
src/ui/QGCTCPLinkConfiguration.ui \
src/ui/QGCUDPLinkConfiguration.ui \
src/ui/QGCTabbedInfoView.ui \
src/ui/QGCUASFileView.ui \
src/ui/QGCUASFileViewMulti.ui \
src/ui/SettingsDialog.ui \
src/ui/uas/UASQuickView.ui \
src/ui/uas/UASQuickViewItemSelect.ui \
src/ui/UASInfo.ui \
Expand Down Expand Up @@ -261,11 +260,9 @@ HEADERS += \
src/QGCComboBox.h \
src/QGCConfig.h \
src/QGCDockWidget.h \
src/QGCFileDialog.h \
src/QGCGeo.h \
src/QGCLoggingCategory.h \
src/QGCMapPalette.h \
src/QGCMessageBox.h \
src/QGCPalette.h \
src/QGCQmlWidgetHolder.h \
src/QGCQuickWidget.h \
Expand All @@ -278,23 +275,11 @@ HEADERS += \
src/QmlControls/QGCQGeoCoordinate.h \
src/QmlControls/QGroundControlQmlGlobal.h \
src/QmlControls/QmlObjectListModel.h \
src/uas/FileManager.h \
src/uas/UAS.h \
src/uas/UASInterface.h \
src/uas/UASMessageHandler.h \
src/ui/MainWindow.h \
src/ui/MAVLinkDecoder.h \
src/ui/MAVLinkSettingsWidget.h \
src/ui/QGCCommConfiguration.h \
src/ui/QGCLinkConfiguration.h \
src/ui/QGCMapRCToParamDialog.h \
src/ui/QGCPluginHost.h \
src/ui/QGCTCPLinkConfiguration.h \
src/ui/QGCUDPLinkConfiguration.h \
src/ui/SettingsDialog.h \
src/ui/toolbar/MainToolBarController.h \
src/ui/uas/QGCUnconnectedInfoWidget.h \
src/ui/uas/UASMessageView.h \
src/AutoPilotPlugins/PX4/PX4AirframeLoader.h \
src/QmlControls/QGCImageProvider.h \

Expand Down Expand Up @@ -326,12 +311,13 @@ HEADERS += \
!MobileBuild {
HEADERS += \
src/comm/LogReplayLink.h \
src/ui/LogReplayLinkConfigurationWidget.h \
src/ui/QGCMAVLinkLogPlayer.h \
src/comm/QGCFlightGearLink.h \
src/comm/QGCHilLink.h \
src/comm/QGCJSBSimLink.h \
src/comm/QGCXPlaneLink.h \
src/QGCFileDialog.h \
src/QGCMessageBox.h \
src/uas/FileManager.h \
src/ui/HILDockWidget.h \
src/ui/linechart/ChartPlot.h \
src/ui/linechart/IncrementalPlot.h \
Expand All @@ -340,7 +326,19 @@ HEADERS += \
src/ui/linechart/LinechartWidget.h \
src/ui/linechart/Scrollbar.h \
src/ui/linechart/ScrollZoomer.h \
src/ui/LogReplayLinkConfigurationWidget.h \
src/ui/MAVLinkDecoder.h \
src/ui/MAVLinkSettingsWidget.h \
src/ui/MultiVehicleDockWidget.h \
src/ui/QGCCommConfiguration.h \
src/ui/QGCLinkConfiguration.h \
src/ui/QGCMAVLinkLogPlayer.h \
src/ui/QGCMapRCToParamDialog.h \
src/ui/QGCTCPLinkConfiguration.h \
src/ui/QGCUDPLinkConfiguration.h \
src/ui/SettingsDialog.h \
src/ui/uas/UASMessageView.h \
src/ui/uas/QGCUnconnectedInfoWidget.h \
src/ui/QGCDataPlot2D.h \
src/ui/QGCHilConfiguration.h \
src/ui/QGCHilFlightGearConfiguration.h \
Expand Down Expand Up @@ -386,12 +384,11 @@ SOURCES += \
src/QGCApplication.cc \
src/QGCComboBox.cc \
src/QGCDockWidget.cc \
src/QGCFileDialog.cc \
src/QGCLoggingCategory.cc \
src/QGCMapPalette.cc \
src/QGCPalette.cc \
src/QGCQmlWidgetHolder.cpp \
src/QGCQuickWidget.cc \
src/QGCQmlWidgetHolder.cpp \
src/QGCTemporaryFile.cc \
src/QGCToolbox.cc \
src/QGCGeo.cc \
Expand All @@ -401,22 +398,10 @@ SOURCES += \
src/QmlControls/QGCQGeoCoordinate.cc \
src/QmlControls/QGroundControlQmlGlobal.cc \
src/QmlControls/QmlObjectListModel.cc \
src/uas/FileManager.cc \
src/uas/UAS.cc \
src/uas/UASMessageHandler.cc \
src/ui/MainWindow.cc \
src/ui/MAVLinkDecoder.cc \
src/ui/MAVLinkSettingsWidget.cc \
src/ui/QGCCommConfiguration.cc \
src/ui/QGCLinkConfiguration.cc \
src/ui/QGCMapRCToParamDialog.cpp \
src/ui/QGCPluginHost.cc \
src/ui/QGCTCPLinkConfiguration.cc \
src/ui/QGCUDPLinkConfiguration.cc \
src/ui/SettingsDialog.cc \
src/ui/toolbar/MainToolBarController.cc \
src/ui/uas/QGCUnconnectedInfoWidget.cc \
src/ui/uas/UASMessageView.cc \
src/AutoPilotPlugins/PX4/PX4AirframeLoader.cc \
src/QmlControls/QGCImageProvider.cc \

Expand All @@ -442,7 +427,19 @@ MobileBuild {

!MobileBuild {
SOURCES += \
src/ui/uas/UASMessageView.cc \
src/uas/FileManager.cc \
src/ui/uas/QGCUnconnectedInfoWidget.cc \
src/ui/SettingsDialog.cc \
src/ui/QGCTCPLinkConfiguration.cc \
src/ui/QGCUDPLinkConfiguration.cc \
src/ui/MAVLinkDecoder.cc \
src/ui/MAVLinkSettingsWidget.cc \
src/ui/QGCCommConfiguration.cc \
src/ui/QGCLinkConfiguration.cc \
src/ui/QGCMapRCToParamDialog.cpp \
src/comm/LogReplayLink.cc \
src/QGCFileDialog.cc \
src/ui/LogReplayLinkConfigurationWidget.cc \
src/ui/QGCMAVLinkLogPlayer.cc \
src/comm/QGCFlightGearLink.cc \
Expand Down
1 change: 0 additions & 1 deletion src/FactSystem/ParameterLoader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "QGCApplication.h"
#include "QGCLoggingCategory.h"
#include "QGCApplication.h"
#include "QGCMessageBox.h"
#include "UASMessageHandler.h"
#include "FirmwarePlugin.h"
#include "UAS.h"
Expand Down
1 change: 1 addition & 0 deletions src/MissionEditor/MissionEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,7 @@ QGCView {

Row {
spacing: ScreenTools.defaultFontPixelWidth
visible: !ScreenTools.isMobile

QGCButton {
text: "Save to file..."
Expand Down
9 changes: 8 additions & 1 deletion src/MissionManager/MissionController.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ This file is part of the QGROUNDCONTROL project
#include "MissionController.h"
#include "MultiVehicleManager.h"
#include "MissionManager.h"
#include "QGCFileDialog.h"
#include "CoordinateVector.h"
#include "FirmwarePlugin.h"
#include "QGCApplication.h"

#ifndef __mobile__
#include "QGCFileDialog.h"
#endif

QGC_LOGGING_CATEGORY(MissionControllerLog, "MissionControllerLog")

const char* MissionController::_settingsGroup = "MissionController";
Expand Down Expand Up @@ -206,6 +209,7 @@ void MissionController::removeMissionItem(int index)

void MissionController::loadMissionFromFile(void)
{
#ifndef __mobile__
QString errorString;
QString filename = QGCFileDialog::getOpenFileName(NULL, "Select Mission File to load");

Expand Down Expand Up @@ -252,10 +256,12 @@ void MissionController::loadMissionFromFile(void)
}

_initAllMissionItems();
#endif
}

void MissionController::saveMissionToFile(void)
{
#ifndef __mobile__
QString errorString;
QString filename = QGCFileDialog::getSaveFileName(NULL, "Select file to save mission to");

Expand All @@ -278,6 +284,7 @@ void MissionController::saveMissionToFile(void)
}

_missionItems->setDirty(false);
#endif
}

void MissionController::_calcPrevWaypointValues(bool homePositionValid, double homeAlt, MissionItem* currentItem, MissionItem* prevItem, double* azimuth, double* distance, double* altDifference)
Expand Down
18 changes: 15 additions & 3 deletions src/QGCApplication.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,13 @@
#include "MainWindow.h"
#include "GAudioOutput.h"
#include "CmdLineOptParser.h"
#include "QGCMessageBox.h"
#include "MainWindow.h"
#include "UDPLink.h"
#include "LinkManager.h"
#include "HomePositionManager.h"
#include "UASMessageHandler.h"
#include "AutoPilotPluginManager.h"
#include "QGCTemporaryFile.h"
#include "QGCFileDialog.h"
#include "QGCPalette.h"
#include "QGCMapPalette.h"
#include "QGCLoggingCategory.h"
Expand Down Expand Up @@ -99,6 +97,8 @@
#endif

#ifndef __mobile__
#include "QGCFileDialog.h"
#include "QGCMessageBox.h"
#include "FirmwareUpgradeController.h"
#include "JoystickConfigController.h"
#endif
Expand Down Expand Up @@ -450,6 +450,7 @@ bool QGCApplication::_initForNormalAppBoot(void)
MainWindow* mainWindow = MainWindow::_create();
Q_CHECK_PTR(mainWindow);

#ifndef __mobile__
// If we made it this far and we still don't have a location. Either the specfied location was invalid
// or we coudn't create a default location. Either way, we need to let the user know and prompt for a new
/// settings.
Expand All @@ -459,7 +460,6 @@ bool QGCApplication::_initForNormalAppBoot(void)
mainWindow->showSettings();
}

#ifndef __mobile__
// Now that main window is up check for lost log files
connect(this, &QGCApplication::checkForLostLogFiles, toolbox()->mavlinkProtocol(), &MAVLinkProtocol::checkForLostLogFiles);
emit checkForLostLogFiles();
Expand Down Expand Up @@ -593,14 +593,25 @@ void QGCApplication::informationMessageBoxOnMainThread(const QString& title, con

void QGCApplication::warningMessageBoxOnMainThread(const QString& title, const QString& msg)
{
#ifdef __mobile__
Q_UNUSED(title)
showMessage(msg);
#else
QGCMessageBox::warning(title, msg);
#endif
}

void QGCApplication::criticalMessageBoxOnMainThread(const QString& title, const QString& msg)
{
#ifdef __mobile__
Q_UNUSED(title)
showMessage(msg);
#else
QGCMessageBox::critical(title, msg);
#endif
}

#ifndef __mobile__
void QGCApplication::saveTempFlightDataLogOnMainThread(QString tempLogfile)
{
bool saveError;
Expand Down Expand Up @@ -628,6 +639,7 @@ void QGCApplication::saveTempFlightDataLogOnMainThread(QString tempLogfile)
} while(saveError); // if the file could not be overwritten, ask for new file
QFile::remove(tempLogfile);
}
#endif

void QGCApplication::setStyle(bool styleIsDark)
{
Expand Down
2 changes: 2 additions & 0 deletions src/QGCApplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,10 @@ public slots:
/// You can connect to this slot to show a critical message box from a different thread.
void criticalMessageBoxOnMainThread(const QString& title, const QString& msg);

#ifndef __mobile__
/// Save the specified Flight Data Log
void saveTempFlightDataLogOnMainThread(QString tempLogfile);
#endif

signals:
/// Signals that the style has changed
Expand Down
4 changes: 4 additions & 0 deletions src/QGCFileDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
#ifndef QGCFILEDIALOG_H
#define QGCFILEDIALOG_H

#ifdef __mobile__
#error Should not be included in mobile builds
#endif

#include <QFileDialog>

/// @file
Expand Down
4 changes: 4 additions & 0 deletions src/QGCMessageBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
#ifndef QGCMESSAGEBOX_H
#define QGCMESSAGEBOX_H

#ifdef __mobile__
#error Should not be included in mobile builds
#endif

#include <QMessageBox>

#include "MainWindow.h"
Expand Down
2 changes: 1 addition & 1 deletion src/QGCQuickWidget.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

#include "QGCQuickWidget.h"
#include "AutoPilotPluginManager.h"
#include "QGCMessageBox.h"
#include "MultiVehicleManager.h"
#include "JoystickManager.h"
#include "QGCApplication.h"

#include <QQmlContext>
#include <QQmlEngine>
Expand Down
7 changes: 5 additions & 2 deletions src/QmlControls/ParameterEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -121,19 +121,22 @@ QGCView {
text: "Search..."
onTriggered: showDialog(searchDialogComponent, "Parameter Search", 50, StandardButton.Reset | StandardButton.Apply)
}
MenuSeparator { }
MenuSeparator { visible: !ScreenTools.isMobile }
MenuItem {
text: "Load from file..."
onTriggered: controller.loadFromFile()
visible: !ScreenTools.isMobile
}
MenuItem {
text: "Save to file..."
onTriggered: controller.saveToFile()
visible: !ScreenTools.isMobile
}
MenuSeparator { }
MenuSeparator { visible: !ScreenTools.isMobile }
MenuItem {
text: "Clear RC to Param"
onTriggered: controller.clearRCToParam()
visible: !ScreenTools.isMobile
}
}
}
Expand Down
Loading

0 comments on commit 3c69032

Please sign in to comment.