From eb59d7381f21151f7a68147ad6b00c583001e3ed Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Sun, 7 May 2017 22:01:12 +0200 Subject: [PATCH] LP-505 Check customID and coordID changes - Use isEmpty() --- .../src/plugins/config/configoplinkwidget.cpp | 16 ++++++++++++++-- .../gcs/src/plugins/config/configoplinkwidget.h | 2 ++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ground/gcs/src/plugins/config/configoplinkwidget.cpp b/ground/gcs/src/plugins/config/configoplinkwidget.cpp index cee73e36a..438b88dc8 100644 --- a/ground/gcs/src/plugins/config/configoplinkwidget.cpp +++ b/ground/gcs/src/plugins/config/configoplinkwidget.cpp @@ -120,6 +120,8 @@ ConfigOPLinkWidget::ConfigOPLinkWidget(QWidget *parent) : ConfigTaskWidget(paren // Connect the selection changed signals. connect(m_oplink->Protocol, SIGNAL(currentIndexChanged(int)), this, SLOT(protocolChanged())); connect(m_oplink->LinkType, SIGNAL(currentIndexChanged(int)), this, SLOT(linkTypeChanged())); + connect(m_oplink->CustomDeviceID, SIGNAL(textChanged(QString)), this, SLOT(customIDChanged())); + connect(m_oplink->CoordID, SIGNAL(textChanged(QString)), this, SLOT(coordIDChanged())); connect(m_oplink->RFBand, SIGNAL(currentIndexChanged(int)), this, SLOT(rfBandChanged())); connect(m_oplink->MinimumChannel, SIGNAL(valueChanged(int)), this, SLOT(minChannelChanged())); connect(m_oplink->MaximumChannel, SIGNAL(valueChanged(int)), this, SLOT(maxChannelChanged())); @@ -266,8 +268,8 @@ void ConfigOPLinkWidget::updateSettings() bool is_flexi_telem = isComboboxOptionSelected(m_oplink->FlexiPort, OPLinkSettings::FLEXIPORT_TELEMETRY); bool is_vcp_main = isComboboxOptionSelected(m_oplink->VCPBridge, OPLinkSettings::VCPBRIDGE_MAIN); bool is_vcp_flexi = isComboboxOptionSelected(m_oplink->VCPBridge, OPLinkSettings::VCPBRIDGE_FLEXI); - bool is_custom_id = (m_oplink->CustomDeviceID->text() != ""); - bool is_bound = (m_oplink->CoordID->text() != ""); + bool is_custom_id = !m_oplink->CustomDeviceID->text().isEmpty(); + bool is_bound = !m_oplink->CoordID->text().isEmpty(); bool is_stream_main = isComboboxOptionSelected(m_oplink->RadioPriStream, OPLinkSettings::RADIOPRISTREAM_MAIN) || isComboboxOptionSelected(m_oplink->RadioAuxStream, OPLinkSettings::RADIOAUXSTREAM_MAIN); @@ -321,6 +323,16 @@ void ConfigOPLinkWidget::linkTypeChanged() updateSettings(); } +void ConfigOPLinkWidget::customIDChanged() +{ + updateSettings(); +} + +void ConfigOPLinkWidget::coordIDChanged() +{ + updateSettings(); +} + void ConfigOPLinkWidget::minChannelChanged() { channelChanged(false); diff --git a/ground/gcs/src/plugins/config/configoplinkwidget.h b/ground/gcs/src/plugins/config/configoplinkwidget.h index 74a4f58c1..156b8a3bb 100644 --- a/ground/gcs/src/plugins/config/configoplinkwidget.h +++ b/ground/gcs/src/plugins/config/configoplinkwidget.h @@ -70,6 +70,8 @@ private slots: void protocolChanged(); void linkTypeChanged(); + void customIDChanged(); + void coordIDChanged(); void minChannelChanged(); void maxChannelChanged();