1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

Merge branch 'thread/OP-970_Revo_Radio_Warning' into next

This commit is contained in:
Fredrik Arvidsson 2013-05-25 12:05:31 +02:00
commit 917d3ebbd8
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();