diff --git a/QGCCommon.pri b/QGCCommon.pri
index 4a807431865a650d97f5225da9cd0e7e726a0d1f..2fb1d80163d7cd4f493a828fe8f92b261c4b657f 100644
--- a/QGCCommon.pri
+++ b/QGCCommon.pri
@@ -38,7 +38,6 @@ linux {
equals(ANDROID_TARGET_ARCH, x86) {
CONFIG += Androidx86Build
DEFINES += __androidx86__
- DEFINES += QGC_DISABLE_UVC
message("Android x86 build")
} else {
message("Android Arm build")
@@ -77,9 +76,10 @@ linux {
error("Unsupported Qt version, 5.5.x or greater is required for iOS")
}
message("iOS build")
- CONFIG += iOSBuild MobileBuild app_bundle
+ CONFIG += iOSBuild MobileBuild app_bundle NoSerialBuild
DEFINES += __ios__
DEFINES += QGC_NO_GOOGLE_MAPS
+ DEFINES += NO_SERIAL_LINK
QMAKE_IOS_DEPLOYMENT_TARGET = 8.0
QMAKE_IOS_TARGETED_DEVICE_FAMILY = 1,2 # Universal
QMAKE_LFLAGS += -Wl,-no_pie
diff --git a/qgcresources.qrc b/qgcresources.qrc
index b8ce22efeeeb1d70bfa5e7ee60dc3ec9563cbd55..51a35405d4d1de17c046df4b62d9a3c21feaa2f2 100644
--- a/qgcresources.qrc
+++ b/qgcresources.qrc
@@ -181,6 +181,7 @@
resources/TrashDelete.svg
resources/XDelete.svg
resources/XDeleteBlack.svg
+ resources/waves.svg
resources/icons/qgroundcontrol.ico
diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro
index 3652d75294611c1ab6fdfde76b9bc95f4a4c4906..28a09d033a9cd6edea19934050aa4c25e8a6a1fd 100644
--- a/qgroundcontrol.pro
+++ b/qgroundcontrol.pro
@@ -503,7 +503,7 @@ contains(DEFINES, QGC_ENABLE_BLUETOOTH) {
src/comm/BluetoothLink.h \
}
-!iOSBuild {
+!NoSerialBuild {
HEADERS += \
src/comm/QGCSerialPortInfo.h \
src/comm/SerialLink.h \
@@ -651,7 +651,7 @@ SOURCES += \
src/comm/MockLinkMissionItemHandler.cc \
}
-!iOSBuild {
+!NoSerialBuild {
SOURCES += \
src/comm/QGCSerialPortInfo.cc \
src/comm/SerialLink.cc \
diff --git a/resources/waves.svg b/resources/waves.svg
new file mode 100644
index 0000000000000000000000000000000000000000..fbca7c7819fd882452ada1c52c56db7ddb0f2afa
--- /dev/null
+++ b/resources/waves.svg
@@ -0,0 +1,21 @@
+
+
+
diff --git a/src/FlightDisplay/FlightDisplayView.qml b/src/FlightDisplay/FlightDisplayView.qml
index 85faa00b0efe911bef2aa2ba47cc38282b615ba9..c739d322c1f8c2d8427d653c474f955f05137380 100644
--- a/src/FlightDisplay/FlightDisplayView.qml
+++ b/src/FlightDisplay/FlightDisplayView.qml
@@ -34,7 +34,7 @@ QGCView {
QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
- property bool _mainIsMap: QGroundControl.videoManager.hasVideo ? QGroundControl.loadBoolGlobalSetting(_mainIsMapKey, true) : true
+ property bool _mainIsMap: QGroundControl.videoManager.hasVideo ? QGroundControl.loadBoolGlobalSetting(_mainIsMapKey, QGroundControl.mainViewIsMap) : true
property bool _isPipVisible: QGroundControl.videoManager.hasVideo ? QGroundControl.loadBoolGlobalSetting(_PIPVisibleKey, true) : false
property real _roll: _activeVehicle ? _activeVehicle.roll.value : _defaultRoll
diff --git a/src/FlightDisplay/FlightDisplayViewWidgets.qml b/src/FlightDisplay/FlightDisplayViewWidgets.qml
index c370749550ab2bd8dfd0d2550ac51424ebfcd732..094a3fa25e16acf1fc6aeb647d52116e2bad8fa1 100644
--- a/src/FlightDisplay/FlightDisplayViewWidgets.qml
+++ b/src/FlightDisplay/FlightDisplayViewWidgets.qml
@@ -140,10 +140,10 @@ Item {
}
QGCLabel {
- id: flyLabel
- text: qsTr("Fly")
- color: mapPal.text
- visible: !ScreenTools.isShortScreen
+ id: flyLabel
+ text: qsTr("Fly")
+ color: mapPal.text
+ visible: !ScreenTools.isShortScreen && _mainIsMap
anchors.topMargin: _toolButtonTopMargin
anchors.horizontalCenter: toolColumn.horizontalCenter
anchors.top: parent.top
diff --git a/src/FlightDisplay/VideoManager.cc b/src/FlightDisplay/VideoManager.cc
index 02c325fabffee80638ec6f20bef41ae3002bf4e9..73a200d778829932802dff6763ff6e7508f9adc3 100644
--- a/src/FlightDisplay/VideoManager.cc
+++ b/src/FlightDisplay/VideoManager.cc
@@ -43,9 +43,24 @@ VideoManager::VideoManager(QGCApplication* app)
{
//-- Get saved settings
QSettings settings;
+#if defined(NO_UDP_VIDEO) && defined(QGC_GST_STREAMING)
+ setVideoSource(settings.value(kVideoSourceKey, kRTSPStream).toString());
+#else
setVideoSource(settings.value(kVideoSourceKey, kUDPStream).toString());
- setUdpPort(settings.value(kVideoUDPPortKey, 5600).toUInt());
- setRtspURL(settings.value(kVideoRTSPUrlKey, "rtsp://192.168.42.1:554/live").toString()); //-- Example RTSP URL
+#endif
+ //-- Check if core plugin defines its own video requirements
+ if(qgcApp()->qgcOptions()->definesVideo()) {
+ if(qgcApp()->qgcOptions()->videoUDPPort()) {
+ setUdpPort(qgcApp()->qgcOptions()->videoUDPPort());
+ setVideoSource(kUDPStream);
+ } else {
+ setVideoSource(kRTSPStream);
+ setRtspURL(qgcApp()->qgcOptions()->videoRSTPUrl());
+ }
+ } else {
+ setUdpPort(settings.value(kVideoUDPPortKey, 5600).toUInt());
+ setRtspURL(settings.value(kVideoRTSPUrlKey, "rtsp://192.168.42.1:554/live").toString()); //-- Example RTSP URL
+ }
_init = true;
#if defined(QGC_GST_STREAMING)
_updateVideo();
diff --git a/src/QGCApplication.cc b/src/QGCApplication.cc
index 278c0a06c6247c2a283abfde4653b4befad0909b..9847f4b8e5b9ba0e1b187dff3f1a4fbf48195267 100644
--- a/src/QGCApplication.cc
+++ b/src/QGCApplication.cc
@@ -87,7 +87,7 @@
#include CUSTOMHEADER
#endif
-#ifndef __ios__
+#ifndef NO_SERIAL_LINK
#include "SerialLink.h"
#endif
diff --git a/src/QmlControls/QGroundControlQmlGlobal.cc b/src/QmlControls/QGroundControlQmlGlobal.cc
index c249191bdba2e3cbd4f844c03bf979b098c21964..90a67453b3a663bb4b6748d6c9170fe138881353 100644
--- a/src/QmlControls/QGroundControlQmlGlobal.cc
+++ b/src/QmlControls/QGroundControlQmlGlobal.cc
@@ -353,3 +353,68 @@ QMap& QGroundControlQmlGlobal::nameToMetaDataMap(void) {
return map;
}
+
+bool QGroundControlQmlGlobal::colapseSettings()
+{
+ return qgcApp()->qgcOptions()->colapseSettings();
+}
+
+bool QGroundControlQmlGlobal::mainViewIsMap()
+{
+ return qgcApp()->qgcOptions()->mainViewIsMap();
+}
+
+bool QGroundControlQmlGlobal::enableVirtualJoystick()
+{
+ return qgcApp()->qgcOptions()->enableVirtualJoystick();
+}
+
+bool QGroundControlQmlGlobal::enableAutoConnectOptions()
+{
+ return qgcApp()->qgcOptions()->enableAutoConnectOptions();
+}
+
+bool QGroundControlQmlGlobal::enableVideoSourceOptions()
+{
+ return qgcApp()->qgcOptions()->enableVideoSourceOptions();
+}
+
+bool QGroundControlQmlGlobal::hasCustomSettings()
+{
+ if(qgcApp()->customCorePlugin()) {
+ if(qgcApp()->customCorePlugin()->settingsQML()) {
+ return !qgcApp()->customCorePlugin()->settingsQML()->pageUrl().isEmpty();
+ }
+ }
+ return false;
+}
+
+QString QGroundControlQmlGlobal::customSettingsURL()
+{
+ if(qgcApp()->customCorePlugin()) {
+ if(qgcApp()->customCorePlugin()->settingsQML()) {
+ return qgcApp()->customCorePlugin()->settingsQML()->pageUrl();
+ }
+ }
+ return QString();
+}
+
+QString QGroundControlQmlGlobal::customSettingsTitle()
+{
+ if(qgcApp()->customCorePlugin()) {
+ if(qgcApp()->customCorePlugin()->settingsQML()) {
+ return qgcApp()->customCorePlugin()->settingsQML()->pageTitle();
+ }
+ }
+ return QString();
+}
+
+QString QGroundControlQmlGlobal::customSettingsLogoUrl()
+{
+ if(qgcApp()->customCorePlugin()) {
+ if(qgcApp()->customCorePlugin()->settingsQML()) {
+ return qgcApp()->customCorePlugin()->settingsQML()->pageIconUrl();
+ }
+ }
+ return QString();
+}
diff --git a/src/QmlControls/QGroundControlQmlGlobal.h b/src/QmlControls/QGroundControlQmlGlobal.h
index 8f3ef8777cde8cabe41c893efd0b53e95f63f934..d5664258792823d23020e11a4efb3572d6af9528 100644
--- a/src/QmlControls/QGroundControlQmlGlobal.h
+++ b/src/QmlControls/QGroundControlQmlGlobal.h
@@ -79,7 +79,6 @@ public:
Q_PROPERTY(qreal zOrderMapItems READ zOrderMapItems CONSTANT) ///< z order value for map items, for example: mission item indicators
// Various QGC settings exposed to Qml
- Q_PROPERTY(bool isAdvancedMode READ isAdvancedMode CONSTANT) ///< Global "Advance Mode" preference. Certain UI elements and features are different based on this.
Q_PROPERTY(bool isDarkStyle READ isDarkStyle WRITE setIsDarkStyle NOTIFY isDarkStyleChanged) // TODO: Should be in ScreenTools?
Q_PROPERTY(bool isAudioMuted READ isAudioMuted WRITE setIsAudioMuted NOTIFY isAudioMutedChanged)
Q_PROPERTY(bool isSaveLogPrompt READ isSaveLogPrompt WRITE setIsSaveLogPrompt NOTIFY isSaveLogPromptChanged)
@@ -87,6 +86,20 @@ public:
Q_PROPERTY(bool virtualTabletJoystick READ virtualTabletJoystick WRITE setVirtualTabletJoystick NOTIFY virtualTabletJoystickChanged)
Q_PROPERTY(qreal baseFontPointSize READ baseFontPointSize WRITE setBaseFontPointSize NOTIFY baseFontPointSizeChanged)
+ //-------------------------------------------------------------------------
+ //-- Options that can be set by plugins
+ Q_PROPERTY(bool colapseSettings READ colapseSettings CONSTANT)
+ Q_PROPERTY(bool mainViewIsMap READ mainViewIsMap CONSTANT)
+ Q_PROPERTY(bool enableVirtualJoystick READ enableVirtualJoystick CONSTANT)
+ Q_PROPERTY(bool enableAutoConnectOptions READ enableAutoConnectOptions CONSTANT)
+ Q_PROPERTY(bool enableVideoSourceOptions READ enableVideoSourceOptions CONSTANT)
+
+ Q_PROPERTY(bool hasCustomSettings READ hasCustomSettings CONSTANT)
+ Q_PROPERTY(QString customSettingsURL READ customSettingsURL CONSTANT)
+ Q_PROPERTY(QString customSettingsTitle READ customSettingsTitle CONSTANT)
+ Q_PROPERTY(QString customSettingsLogoUrl READ customSettingsLogoUrl CONSTANT)
+
+ //-------------------------------------------------------------------------
// MavLink Protocol
Q_PROPERTY(bool isVersionCheckEnabled READ isVersionCheckEnabled WRITE setIsVersionCheckEnabled NOTIFY isVersionCheckEnabledChanged)
Q_PROPERTY(int mavlinkSystemID READ mavlinkSystemID WRITE setMavlinkSystemID NOTIFY mavlinkSystemIDChanged)
@@ -185,6 +198,16 @@ public:
bool isVersionCheckEnabled () { return _toolbox->mavlinkProtocol()->versionCheckEnabled(); }
int mavlinkSystemID () { return _toolbox->mavlinkProtocol()->getSystemId(); }
+ bool colapseSettings ();
+ bool mainViewIsMap ();
+ bool enableVirtualJoystick ();
+ bool enableAutoConnectOptions();
+ bool enableVideoSourceOptions();
+ bool hasCustomSettings ();
+ QString customSettingsTitle ();
+ QString customSettingsURL ();
+ QString customSettingsLogoUrl ();
+
QGeoCoordinate lastKnownHomePosition() { return qgcApp()->lastKnownHomePosition(); }
static Fact* offlineEditingFirmwareType (void);
@@ -196,9 +219,6 @@ public:
static Fact* speedUnits (void);
static Fact* batteryPercentRemainingAnnounce(void);
- //-- TODO: Make this into an actual preference.
- bool isAdvancedMode () { return false; }
-
void setIsDarkStyle (bool dark);
void setIsAudioMuted (bool muted);
void setIsSaveLogPrompt (bool prompt);
diff --git a/src/Vehicle/Vehicle.cc b/src/Vehicle/Vehicle.cc
index 4537f0f3576aa73f8f221c942661bb261884009c..90ad8003d1d3906695de74706ae35f64b99e8c46 100644
--- a/src/Vehicle/Vehicle.cc
+++ b/src/Vehicle/Vehicle.cc
@@ -933,7 +933,7 @@ void Vehicle::_sendMessageOnLink(LinkInterface* link, mavlink_message_t message)
/// @return Direct usb connection link to board if one, NULL if none
LinkInterface* Vehicle::priorityLink(void)
{
-#ifndef __ios__
+#ifndef NO_SERIAL_LINK
foreach (LinkInterface* link, _links) {
if (link->isConnected()) {
SerialLink* pSerialLink = qobject_cast(link);
diff --git a/src/VehicleSetup/SetupView.qml b/src/VehicleSetup/SetupView.qml
index 77b6781790a3b921bb61f14d0854d47fd82cd830..89389ee4054a2e9eab37472c9d2644a01b5dd22e 100644
--- a/src/VehicleSetup/SetupView.qml
+++ b/src/VehicleSetup/SetupView.qml
@@ -256,6 +256,33 @@ Rectangle {
visible: !ScreenTools.isShortScreen
}
+ SubMenuButton {
+ imageResource: "/res/gear-white.svg"
+ setupIndicator: false
+ exclusiveGroup: setupButtonGroup
+ text: "General"
+ visible: QGroundControl.colapseSettings
+ onClicked: panelLoader.setSource("GeneralSettings.qml")
+ }
+
+ SubMenuButton {
+ imageResource: QGroundControl.customSettingsLogoUrl
+ setupIndicator: false
+ exclusiveGroup: setupButtonGroup
+ text: QGroundControl.customSettingsTitle
+ visible: QGroundControl.colapseSettings && QGroundControl.hasCustomSettings
+ onClicked: panelLoader.setSource(QGroundControl.customSettingsURL)
+ }
+
+ SubMenuButton {
+ imageResource: "/res/waves.svg"
+ setupIndicator: false
+ exclusiveGroup: setupButtonGroup
+ text: "MAVLink"
+ visible: QGroundControl.colapseSettings
+ onClicked: panelLoader.setSource("MavlinkSettings.qml")
+ }
+
SubMenuButton {
id: summaryButton
imageResource: "/qmlimages/VehicleSummaryIcon.png"
diff --git a/src/comm/LinkConfiguration.cc b/src/comm/LinkConfiguration.cc
index 367051b73b325befa918480a0cf27b327e2f7908..915c20cda6217c6c3fe51a135a4c7e4c95590651 100644
--- a/src/comm/LinkConfiguration.cc
+++ b/src/comm/LinkConfiguration.cc
@@ -15,12 +15,12 @@
*/
#include "LinkConfiguration.h"
-#ifndef __ios__
+#ifndef NO_SERIAL_LINK
#include "SerialLink.h"
#endif
#include "UDPLink.h"
#include "TCPLink.h"
-#ifndef __mobile__
+#if !defined(__mobile__)
#include "LogReplayLink.h"
#endif
#ifdef QGC_ENABLE_BLUETOOTH
@@ -79,7 +79,7 @@ LinkConfiguration* LinkConfiguration::createSettings(int type, const QString& na
{
LinkConfiguration* config = NULL;
switch(type) {
-#ifndef __ios__
+#ifndef NO_SERIAL_LINK
case LinkConfiguration::TypeSerial:
config = new SerialConfiguration(name);
break;
@@ -117,7 +117,7 @@ LinkConfiguration* LinkConfiguration::duplicateSettings(LinkConfiguration* sourc
{
LinkConfiguration* dupe = NULL;
switch(source->type()) {
-#ifndef __ios__
+#ifndef NO_SERIAL_LINK
case TypeSerial:
dupe = new SerialConfiguration(dynamic_cast(source));
break;
diff --git a/src/comm/LinkConfiguration.h b/src/comm/LinkConfiguration.h
index 0158cc4a5d449f376393a16d8fde22da17f937d1..59fa8f36ffc7ec07adbfb3f9bf4eae0f2f879c52 100644
--- a/src/comm/LinkConfiguration.h
+++ b/src/comm/LinkConfiguration.h
@@ -46,7 +46,7 @@ public:
/// The link types supported by QGC
/// Any changes here MUST be reflected in LinkManager::linkTypeStrings()
enum LinkType {
-#ifndef __ios__
+#ifndef NO_SERIAL_LINK
TypeSerial, ///< Serial Link
#endif
TypeUdp, ///< UDP Link
diff --git a/src/comm/LinkManager.cc b/src/comm/LinkManager.cc
index 7aef4cad9f358d5a47461b18ead2c9dfda92ec7f..34a0320fd1e793550f4cf4dbf9ee3100b542dd90 100644
--- a/src/comm/LinkManager.cc
+++ b/src/comm/LinkManager.cc
@@ -21,7 +21,7 @@
#include
#include
-#ifndef __ios__
+#ifndef NO_SERIAL_LINK
#include "QGCSerialPortInfo.h"
#endif
@@ -85,7 +85,7 @@ LinkManager::LinkManager(QGCApplication* app)
_autoconnectRTKGPS = settings.value(_autoconnectRTKGPSKey, true).toBool();
_autoconnectLibrePilot = settings.value(_autoconnectLibrePilotKey, true).toBool();
-#ifndef __ios__
+#ifndef NO_SERIAL_LINK
_activeLinkCheckTimer.setInterval(_activeLinkCheckTimeoutMSecs);
_activeLinkCheckTimer.setSingleShot(false);
connect(&_activeLinkCheckTimer, &QTimer::timeout, this, &LinkManager::_activeLinkCheck);
@@ -113,7 +113,7 @@ LinkInterface* LinkManager::createConnectedLink(LinkConfiguration* config)
Q_ASSERT(config);
LinkInterface* pLink = NULL;
switch(config->type()) {
-#ifndef __ios__
+#ifndef NO_SERIAL_LINK
case LinkConfiguration::TypeSerial:
{
SerialConfiguration* serialConfig = dynamic_cast(config);
@@ -373,7 +373,7 @@ void LinkManager::loadLinkConfigurationList()
LinkConfiguration* pLink = NULL;
bool autoConnect = settings.value(root + "/auto").toBool();
switch((LinkConfiguration::LinkType)type) {
-#ifndef __ios__
+#ifndef NO_SERIAL_LINK
case LinkConfiguration::TypeSerial:
pLink = (LinkConfiguration*)new SerialConfiguration(name);
break;
@@ -443,7 +443,7 @@ void LinkManager::loadLinkConfigurationList()
_configurationsLoaded = true;
}
-#ifndef __ios__
+#ifndef NO_SERIAL_LINK
SerialConfiguration* LinkManager::_autoconnectConfigurationsContainsPort(const QString& portName)
{
QString searchPort = portName.trimmed();
@@ -488,7 +488,7 @@ void LinkManager::_updateAutoConnectLinks(void)
emit linkConfigurationsChanged();
}
-#ifndef __ios__
+#ifndef NO_SERIAL_LINK
QStringList currentPorts;
QList portList = QGCSerialPortInfo::availablePorts();
@@ -633,7 +633,7 @@ void LinkManager::_updateAutoConnectLinks(void)
}
delete pDeleteConfig;
}
-#endif // __ios__
+#endif // NO_SERIAL_LINK
}
void LinkManager::shutdown(void)
@@ -704,7 +704,7 @@ QStringList LinkManager::linkTypeStrings(void) const
static QStringList list;
if(!list.size())
{
-#ifndef __ios__
+#ifndef NO_SERIAL_LINK
list += "Serial";
#endif
list += "UDP";
@@ -727,7 +727,7 @@ void LinkManager::_updateSerialPorts()
{
_commPortList.clear();
_commPortDisplayList.clear();
-#ifndef __ios__
+#ifndef NO_SERIAL_LINK
QList portList = QSerialPortInfo::availablePorts();
foreach (const QSerialPortInfo &info, portList)
{
@@ -758,7 +758,7 @@ QStringList LinkManager::serialPorts(void)
QStringList LinkManager::serialBaudRates(void)
{
-#ifdef __ios__
+#ifdef NO_SERIAL_LINK
QStringList foo;
return foo;
#else
@@ -791,7 +791,7 @@ bool LinkManager::endCreateConfiguration(LinkConfiguration* config)
LinkConfiguration* LinkManager::createConfiguration(int type, const QString& name)
{
-#ifndef __ios__
+#ifndef NO_SERIAL_LINK
if((LinkConfiguration::LinkType)type == LinkConfiguration::TypeSerial)
_updateSerialPorts();
#endif
@@ -801,7 +801,7 @@ LinkConfiguration* LinkManager::createConfiguration(int type, const QString& nam
LinkConfiguration* LinkManager::startConfigurationEditing(LinkConfiguration* config)
{
Q_ASSERT(config != NULL);
-#ifndef __ios__
+#ifndef NO_SERIAL_LINK
if(config->type() == LinkConfiguration::TypeSerial)
_updateSerialPorts();
#endif
@@ -815,7 +815,7 @@ void LinkManager::_fixUnnamed(LinkConfiguration* config)
//-- Check for "Unnamed"
if (config->name() == "Unnamed") {
switch(config->type()) {
-#ifndef __ios__
+#ifndef NO_SERIAL_LINK
case LinkConfiguration::TypeSerial: {
QString tname = dynamic_cast(config)->portName();
#ifdef Q_OS_WIN
@@ -895,7 +895,7 @@ bool LinkManager::isBluetoothAvailable(void)
return qgcApp()->isBluetoothAvailable();
}
-#ifndef __ios__
+#ifndef NO_SERIAL_LINK
void LinkManager::_activeLinkCheck(void)
{
SerialLink* link = NULL;
diff --git a/src/comm/LinkManager.h b/src/comm/LinkManager.h
index 330572033e848d670e3cb33a9abcdfc79c0a58eb..23cddcbdf47a25e56bd5f7cd42df288ab4ec28e0 100644
--- a/src/comm/LinkManager.h
+++ b/src/comm/LinkManager.h
@@ -24,12 +24,12 @@
#include "QGCToolbox.h"
#include "ProtocolInterface.h"
#include "MAVLinkProtocol.h"
-#ifndef __mobile__
+#if !defined(__mobile__)
#include "LogReplayLink.h"
#endif
#include "QmlObjectListModel.h"
-#ifndef __ios__
+#ifndef NO_SERIAL_LINK
#include "SerialLink.h"
#endif
@@ -199,7 +199,7 @@ private slots:
void _linkConnected(void);
void _linkDisconnected(void);
void _linkConnectionRemoved(LinkInterface* link);
-#ifndef __ios__
+#ifndef NO_SERIAL_LINK
void _activeLinkCheck(void);
#endif
@@ -210,7 +210,7 @@ private:
void _fixUnnamed(LinkConfiguration* config);
bool _setAutoconnectWorker(bool& currentAutoconnect, bool newAutoconnect, const char* autoconnectKey);
-#ifndef __ios__
+#ifndef NO_SERIAL_LINK
SerialConfiguration* _autoconnectConfigurationsContainsPort(const QString& portName);
#endif
@@ -237,7 +237,7 @@ private:
bool _autoconnectPX4Flow;
bool _autoconnectRTKGPS;
bool _autoconnectLibrePilot;
-#ifndef __ios__
+#ifndef NO_SERIAL_LINK
QTimer _activeLinkCheckTimer; ///< Timer which checks for a vehicle showing up on a usb direct link
QList _activeLinkCheckList; ///< List of links we are waiting for a vehicle to show up on
static const int _activeLinkCheckTimeoutMSecs = 15000; ///< Amount of time to wait for a heatbeat. Keep in mind ArduPilot stack heartbeat is slow to come.
diff --git a/src/main.cc b/src/main.cc
index eb8319cdf0a17487b6c9566e36d9af33c40cb1b4..80000cd33c10dcb4ef135d18830296df448681b2 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -74,7 +74,7 @@ int WindowsCrtReportHook(int reportType, char* message, int* returnValue)
#endif
-#ifdef __android__
+#if defined(__android__) && !defined(NO_SERIAL_LINK)
#include
#include "qserialport.h"
@@ -151,7 +151,7 @@ int main(int argc, char *argv[])
// that we use these types in signals, and without calling qRegisterMetaType we can't queue
// these signals. In general we don't queue these signals, but we do what the warning says
// anyway to silence the debug output.
-#ifndef __ios__
+#ifndef NO_SERIAL_LINK
qRegisterMetaType();
#endif
#ifdef QGC_ENABLE_BLUETOOTH
diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc
index 840bf7c3aa6f1fe1c1cfa84ce1e5049b0292760f..e313e87aa057f272660e96fd54aa1f7640e16989 100644
--- a/src/uas/UAS.cc
+++ b/src/uas/UAS.cc
@@ -36,7 +36,7 @@
#include "MAVLinkProtocol.h"
#include "QGCMAVLink.h"
#include "LinkManager.h"
-#ifndef __ios__
+#ifndef NO_SERIAL_LINK
#include "SerialLink.h"
#endif
#include "FirmwarePluginManager.h"
diff --git a/src/ui/MainWindow.cc b/src/ui/MainWindow.cc
index 6cd378e1ffeffb050be3ef7b87325019246a8e49..cd40b192776c2ab8e73efa4bd94197813088b5b3 100644
--- a/src/ui/MainWindow.cc
+++ b/src/ui/MainWindow.cc
@@ -54,7 +54,7 @@
#include "AppMessages.h"
#endif
-#ifndef __ios__
+#ifndef NO_SERIAL_LINK
#include "SerialLink.h"
#endif
diff --git a/src/ui/MainWindow.h b/src/ui/MainWindow.h
index 3f7c31d381b0d9c1b7335b7973a74977d794811f..a8851c7e28ee4d046d53d7594612c2a559eab791 100644
--- a/src/ui/MainWindow.h
+++ b/src/ui/MainWindow.h
@@ -33,9 +33,7 @@
#include "UASInterface.h"
#include "LogCompressor.h"
#include "QGCMAVLinkInspector.h"
-#ifndef __mobile__
#include "QGCMAVLinkLogPlayer.h"
-#endif
#include "MAVLinkDecoder.h"
#include "Vehicle.h"
#include "QGCDockWidget.h"
@@ -117,12 +115,10 @@ signals:
#endif //QGC_MOUSE_ENABLED_LINUX
public:
-#ifndef __mobile__
QGCMAVLinkLogPlayer* getLogPlayer()
{
return logPlayer;
}
-#endif
protected:
void connectCommonActions();
@@ -133,9 +129,7 @@ protected:
QSettings settings;
QPointer mavlinkDecoder;
-#ifndef __mobile__
QGCMAVLinkLogPlayer* logPlayer;
-#endif
#ifdef QGC_MOUSE_ENABLED_WIN
/** @brief 3d Mouse support (WIN only) */
Mouse3DInput* mouseInput; ///< 3dConnexion 3dMouse SDK
@@ -164,10 +158,7 @@ protected:
private slots:
void _closeWindow(void) { close(); }
void _vehicleAdded(Vehicle* vehicle);
-
-#ifndef __mobile__
void _showDockWidgetAction(bool show);
-#endif
#ifdef UNITTEST_BUILD
void _showQmlTestWidget(void);
@@ -179,22 +170,17 @@ private:
void _openUrl(const QString& url, const QString& errorMessage);
-#ifndef __mobile__
QMap _mapName2DockWidget;
QMap _mapName2Action;
-#endif
void _storeCurrentViewState(void);
void _loadCurrentViewState(void);
-
-#ifndef __mobile__
bool _createInnerDockWidget(const QString& widgetName);
void _buildCommonWidgets(void);
void _hideAllDockWidgets(void);
void _showDockWidget(const QString &name, bool show);
void _loadVisibleWidgetsSettings(void);
void _storeVisibleWidgetsSettings(void);
-#endif
bool _lowPowerMode; ///< If enabled, QGC reduces the update rates of all widgets
bool _showStatusBar;
diff --git a/src/ui/QGCMAVLinkLogPlayer.cc b/src/ui/QGCMAVLinkLogPlayer.cc
index e3242e1c3f560dc1809cba023be78027f8106fca..22267f376ba0cf3f90a91f90221acefdb55f55f4 100644
--- a/src/ui/QGCMAVLinkLogPlayer.cc
+++ b/src/ui/QGCMAVLinkLogPlayer.cc
@@ -2,7 +2,7 @@
#include
#include "MainWindow.h"
-#ifndef __ios__
+#ifndef NO_SERIAL_LINK
#include "SerialLink.h"
#endif
#include "QGCMAVLinkLogPlayer.h"
@@ -17,7 +17,7 @@ QGCMAVLinkLogPlayer::QGCMAVLinkLogPlayer(QWidget *parent) :
QWidget(parent),
_replayLink(NULL),
_ui(new Ui::QGCMAVLinkLogPlayer)
-{
+{
_ui->setupUi(this);
_ui->horizontalLayout->setAlignment(Qt::AlignTop);
@@ -26,7 +26,7 @@ QGCMAVLinkLogPlayer::QGCMAVLinkLogPlayer(QWidget *parent) :
connect(_ui->playButton, &QPushButton::clicked, this, &QGCMAVLinkLogPlayer::_playPauseToggle);
connect(_ui->positionSlider, &QSlider::valueChanged, this, &QGCMAVLinkLogPlayer::_setPlayheadFromSlider);
connect(_ui->positionSlider, &QSlider::sliderPressed, this, &QGCMAVLinkLogPlayer::_pause);
-
+
#if 0
// Speed slider is removed from 3.0 release. Too broken to fix.
connect(_ui->speedSlider, &QSlider::valueChanged, this, &QGCMAVLinkLogPlayer::_setAccelerationFromSlider);
@@ -36,10 +36,10 @@ QGCMAVLinkLogPlayer::QGCMAVLinkLogPlayer(QWidget *parent) :
#endif
_enablePlaybackControls(false);
-
+
_ui->positionSlider->setMinimum(0);
_ui->positionSlider->setMaximum(100);
-
+
}
QGCMAVLinkLogPlayer::~QGCMAVLinkLogPlayer()
@@ -68,7 +68,7 @@ void QGCMAVLinkLogPlayer::_selectLogFileForPlayback(void)
QGCMessageBox::information(tr("Log Replay"), tr("You must close all connections prior to replaying a log."));
return;
}
-
+
QString logFilename = QGCFileDialog::getOpenFileName(
this,
tr("Load MAVLink Log File"),
@@ -78,21 +78,21 @@ void QGCMAVLinkLogPlayer::_selectLogFileForPlayback(void)
if (logFilename.isEmpty()) {
return;
}
-
+
LinkInterface* createConnectedLink(LinkConfiguration* config);
-
+
LogReplayLinkConfiguration* linkConfig = new LogReplayLinkConfiguration(QString("Log Replay"));
linkConfig->setLogFilename(logFilename);
linkConfig->setName(linkConfig->logFilenameShort());
_ui->logFileNameLabel->setText(linkConfig->logFilenameShort());
_replayLink = (LogReplayLink*)qgcApp()->toolbox()->linkManager()->createConnectedLink(linkConfig);
-
+
connect(_replayLink, &LogReplayLink::logFileStats, this, &QGCMAVLinkLogPlayer::_logFileStats);
connect(_replayLink, &LogReplayLink::playbackStarted, this, &QGCMAVLinkLogPlayer::_playbackStarted);
connect(_replayLink, &LogReplayLink::playbackPaused, this, &QGCMAVLinkLogPlayer::_playbackPaused);
connect(_replayLink, &LogReplayLink::playbackPercentCompleteChanged, this, &QGCMAVLinkLogPlayer::_playbackPercentCompleteChanged);
connect(_replayLink, &LogReplayLink::disconnected, this, &QGCMAVLinkLogPlayer::_replayLinkDisconnected);
-
+
_ui->positionSlider->setValue(0);
#if 0
_ui->speedSlider->setValue(0);
@@ -123,9 +123,9 @@ void QGCMAVLinkLogPlayer::_logFileStats(bool logTimestamped, ///< tru
{
Q_UNUSED(logTimestamped);
Q_UNUSED(binaryBaudRate);
-
+
_logDurationSeconds = logDurationSeconds;
-
+
_ui->logStatsLabel->setText(_secondsToHMS(logDurationSeconds));
}
@@ -174,9 +174,9 @@ void QGCMAVLinkLogPlayer::_setAccelerationFromSlider(int value)
if (_replayLink) {
_replayLink->setAccelerationFactor(value);
}
-
+
// Factor: -100: 0.01x, 0: 1.0x, 100: 100x
-
+
float accelerationFactor;
if (value < 0) {
accelerationFactor = 0.01f;
@@ -189,7 +189,7 @@ void QGCMAVLinkLogPlayer::_setAccelerationFromSlider(int value)
} else {
accelerationFactor = 1.0f;
}
-
+
_ui->speedLabel->setText(QString("Speed: %1X").arg(accelerationFactor, 5, 'f', 2, '0'));
}
#endif
diff --git a/src/ui/preferences/GeneralSettings.qml b/src/ui/preferences/GeneralSettings.qml
index 324c5af6a45138e214a8d3cf4b18f031ffe8eeaa..ff6fbd4436809988450dd512d262831efa5bb945 100644
--- a/src/ui/preferences/GeneralSettings.qml
+++ b/src/ui/preferences/GeneralSettings.qml
@@ -364,6 +364,7 @@ QGCView {
text: qsTr("Virtual Joystick")
checked: QGroundControl.virtualTabletJoystick
onClicked: QGroundControl.virtualTabletJoystick = checked
+ visible: QGroundControl.enableVirtualJoystick
}
//-----------------------------------------------------------------
//-- Map Providers
@@ -433,6 +434,7 @@ QGCView {
height: autoConnectLabel.height
anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter
+ visible: QGroundControl.enableAutoConnectOptions
QGCLabel {
id: autoConnectLabel
text: qsTr("Autoconnect to the following devices:")
@@ -443,6 +445,7 @@ QGCView {
height: autoConnectCol.height + (ScreenTools.defaultFontPixelHeight * 2)
width: qgcView.width * 0.8
color: qgcPal.windowShade
+ visible: QGroundControl.enableAutoConnectOptions
anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter
Column {
@@ -494,6 +497,7 @@ QGCView {
Item {
width: qgcView.width * 0.8
height: videoLabel.height
+ visible: QGroundControl.enableVideoSourceOptions
anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter
QGCLabel {
@@ -506,6 +510,7 @@ QGCView {
height: videoCol.height + (ScreenTools.defaultFontPixelHeight * 2)
width: qgcView.width * 0.8
color: qgcPal.windowShade
+ visible: QGroundControl.enableVideoSourceOptions
anchors.margins: ScreenTools.defaultFontPixelWidth
anchors.horizontalCenter: parent.horizontalCenter
Column {
diff --git a/src/ui/toolbar/MainToolBar.qml b/src/ui/toolbar/MainToolBar.qml
index 84dd088118abde59f38eb244b0e003dee3a320ad..41c6cdb40c417f32b926f269ce49b3f8f86033de 100644
--- a/src/ui/toolbar/MainToolBar.qml
+++ b/src/ui/toolbar/MainToolBar.qml
@@ -338,6 +338,7 @@ Rectangle {
source: "/res/QGCLogoWhite"
logo: true
onClicked: toolBar.showSettingsView()
+ visible: !QGroundControl.colapseSettings
}
QGCToolBarButton {