From b16a3a1f48d0f9243bf3ddcba926d0e4b8ce6094 Mon Sep 17 00:00:00 2001 From: brad112358 Date: Thu, 29 Oct 2020 15:38:21 -0500 Subject: [PATCH] Allow use of AutoConnect and HighLatency options for most link types. (#9117) * Allow use of AutoConnect and HighLatency options for most link types. * Remove isAutoConnectAllowed and isHighLatencyAllowed methods and assocated Q_PROPERTYs from LinkConfiguration class. Allow user to configure these properties on all link types. --- src/comm/LinkConfiguration.h | 16 ---------------- src/comm/SerialLink.h | 1 - src/comm/TCPLink.h | 1 - src/comm/UDPLink.h | 2 -- src/ui/preferences/LinkSettings.qml | 2 -- 5 files changed, 22 deletions(-) diff --git a/src/comm/LinkConfiguration.h b/src/comm/LinkConfiguration.h index 0299fafe5..416523687 100644 --- a/src/comm/LinkConfiguration.h +++ b/src/comm/LinkConfiguration.h @@ -30,11 +30,9 @@ public: Q_PROPERTY(LinkType linkType READ type CONSTANT) Q_PROPERTY(bool dynamic READ isDynamic WRITE setDynamic NOTIFY dynamicChanged) Q_PROPERTY(bool autoConnect READ isAutoConnect WRITE setAutoConnect NOTIFY autoConnectChanged) - Q_PROPERTY(bool autoConnectAllowed READ isAutoConnectAllowed CONSTANT) Q_PROPERTY(QString settingsURL READ settingsURL CONSTANT) Q_PROPERTY(QString settingsTitle READ settingsTitle CONSTANT) Q_PROPERTY(bool highLatency READ isHighLatency WRITE setHighLatency NOTIFY highLatencyChanged) - Q_PROPERTY(bool highLatencyAllowed READ isHighLatencyAllowed CONSTANT) // Property accessors @@ -90,20 +88,6 @@ public: /// Virtual Methods - /*! - * - * Is Auto Connect allowed for this type? - * @return True if this type can be set as an Auto Connect configuration - */ - virtual bool isAutoConnectAllowed() { return false; } - - /*! - * - * Is High Latency allowed for this type? - * @return True if this type can be set as an High Latency configuration - */ - virtual bool isHighLatencyAllowed() { return false; } - /*! * @brief Connection type * diff --git a/src/comm/SerialLink.h b/src/comm/SerialLink.h index b62758cf5..d5d5e748f 100644 --- a/src/comm/SerialLink.h +++ b/src/comm/SerialLink.h @@ -76,7 +76,6 @@ public: /// From LinkConfiguration LinkType type () { return LinkConfiguration::TypeSerial; } void copyFrom (LinkConfiguration* source); - bool isHighLatencyAllowed () { return true; } void loadSettings (QSettings& settings, const QString& root); void saveSettings (QSettings& settings, const QString& root); void updateSettings (); diff --git a/src/comm/TCPLink.h b/src/comm/TCPLink.h index 543a4956f..93544ee07 100644 --- a/src/comm/TCPLink.h +++ b/src/comm/TCPLink.h @@ -52,7 +52,6 @@ public: //LinkConfiguration overrides LinkType type (void) override { return LinkConfiguration::TypeTcp; } void copyFrom (LinkConfiguration* source) override; - bool isHighLatencyAllowed(void) override { return true; } void loadSettings (QSettings& settings, const QString& root) override; void saveSettings (QSettings& settings, const QString& root) override; QString settingsURL (void) override { return "TcpSettings.qml"; } diff --git a/src/comm/UDPLink.h b/src/comm/UDPLink.h index 97f47fea0..6995a9953 100644 --- a/src/comm/UDPLink.h +++ b/src/comm/UDPLink.h @@ -75,8 +75,6 @@ public: void copyFrom (LinkConfiguration* source) override; void loadSettings (QSettings& settings, const QString& root) override; void saveSettings (QSettings& settings, const QString& root) override; - bool isAutoConnectAllowed (void) override { return true; } - bool isHighLatencyAllowed (void) override { return true; } QString settingsURL (void) override { return "UdpSettings.qml"; } QString settingsTitle (void) override { return tr("UDP Link Settings"); } diff --git a/src/ui/preferences/LinkSettings.qml b/src/ui/preferences/LinkSettings.qml index 02e468e6b..7e9c93c57 100644 --- a/src/ui/preferences/LinkSettings.qml +++ b/src/ui/preferences/LinkSettings.qml @@ -300,7 +300,6 @@ Rectangle { QGCCheckBox { text: qsTr("Automatically Connect on Start") checked: false - enabled: editConfig ? editConfig.autoConnectAllowed : false onCheckedChanged: { if(editConfig) { editConfig.autoConnect = checked @@ -314,7 +313,6 @@ Rectangle { QGCCheckBox { text: qsTr("High Latency") checked: false - enabled: editConfig ? editConfig.highLatencyAllowed : false onCheckedChanged: { if(editConfig) { editConfig.highLatency = checked -- 2.22.0