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

OP-970 Fixes a problem with the Radio/Modem warning dialog showing up on board connection.

This commit is contained in:
Fredrik Arvidsson 2013-05-25 12:04:50 +02:00
parent 3c55485d88
commit d492d3e14e
2 changed files with 8 additions and 2 deletions

View File

@ -35,7 +35,7 @@
#include <QMessageBox> #include <QMessageBox>
ConfigRevoHWWidget::ConfigRevoHWWidget(QWidget *parent) : ConfigTaskWidget(parent) ConfigRevoHWWidget::ConfigRevoHWWidget(QWidget *parent) : ConfigTaskWidget(parent), m_refreshing(true)
{ {
m_ui = new Ui_RevoHWWidget(); m_ui = new Ui_RevoHWWidget();
m_ui->setupUi(this); m_ui->setupUi(this);
@ -76,6 +76,7 @@ ConfigRevoHWWidget::ConfigRevoHWWidget(QWidget *parent) : ConfigTaskWidget(paren
populateWidgets(); populateWidgets();
refreshWidgetsValues(); refreshWidgetsValues();
forceConnectedState(); forceConnectedState();
m_refreshing = false;
} }
ConfigRevoHWWidget::~ConfigRevoHWWidget() ConfigRevoHWWidget::~ConfigRevoHWWidget()
@ -99,12 +100,14 @@ void ConfigRevoHWWidget::setupCustomCombos()
void ConfigRevoHWWidget::refreshWidgetsValues(UAVObject *obj) void ConfigRevoHWWidget::refreshWidgetsValues(UAVObject *obj)
{ {
m_refreshing = true;
ConfigTaskWidget::refreshWidgetsValues(obj); ConfigTaskWidget::refreshWidgetsValues(obj);
usbVCPPortChanged(0); usbVCPPortChanged(0);
mainPortChanged(0); mainPortChanged(0);
flexiPortChanged(0); flexiPortChanged(0);
modemPortChanged(0); modemPortChanged(0);
m_refreshing = false;
} }
void ConfigRevoHWWidget::updateObjectsFromWidgets() void ConfigRevoHWWidget::updateObjectsFromWidgets()
@ -292,7 +295,9 @@ void ConfigRevoHWWidget::modemPortChanged(int index)
m_ui->cbTxPower->setVisible(true); m_ui->cbTxPower->setVisible(true);
m_ui->lblInitFreq->setVisible(true); m_ui->lblInitFreq->setVisible(true);
m_ui->leInitFreq->setVisible(true); m_ui->leInitFreq->setVisible(true);
if(!m_refreshing) {
QMessageBox::warning(this, tr("Warning"), tr("Activating the Radio requires an antenna be attached or modem damage will occur.")); QMessageBox::warning(this, tr("Warning"), tr("Activating the Radio requires an antenna be attached or modem damage will occur."));
}
} else { } else {
m_ui->lblTxPower->setVisible(false); m_ui->lblTxPower->setVisible(false);
m_ui->cbTxPower->setVisible(false); m_ui->cbTxPower->setVisible(false);

View File

@ -44,6 +44,7 @@ public:
~ConfigRevoHWWidget(); ~ConfigRevoHWWidget();
private: private:
bool m_refreshing;
Ui_RevoHWWidget *m_ui; Ui_RevoHWWidget *m_ui;
void setupCustomCombos(); void setupCustomCombos();