1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-19 04:52:12 +01:00

LP-505 Check customID and coordID changes - Use isEmpty()

This commit is contained in:
Laurent Lalanne 2017-05-07 22:01:12 +02:00
parent d3280b0bbf
commit eb59d7381f
2 changed files with 16 additions and 2 deletions

View File

@ -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);

View File

@ -70,6 +70,8 @@ private slots:
void protocolChanged();
void linkTypeChanged();
void customIDChanged();
void coordIDChanged();
void minChannelChanged();
void maxChannelChanged();