You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
902 B
35 lines
902 B
15 years ago
|
#include "MAVLinkSettingsWidget.h"
|
||
|
#include "ui_MAVLinkSettingsWidget.h"
|
||
|
|
||
|
MAVLinkSettingsWidget::MAVLinkSettingsWidget(MAVLinkProtocol* protocol, QWidget *parent) :
|
||
|
QWidget(parent),
|
||
|
protocol(protocol),
|
||
|
m_ui(new Ui::MAVLinkSettingsWidget)
|
||
|
{
|
||
|
m_ui->setupUi(this);
|
||
|
|
||
|
// Connect actions
|
||
|
connect(protocol, SIGNAL(heartbeatChanged(bool)), m_ui->heartbeatCheckBox, SLOT(setChecked(bool)));
|
||
|
connect(m_ui->heartbeatCheckBox, SIGNAL(toggled(bool)), protocol, SLOT(enableHeartbeats(bool)));
|
||
|
|
||
|
// Initialize state
|
||
|
m_ui->heartbeatCheckBox->setChecked(protocol->heartbeatsEnabled());
|
||
|
}
|
||
|
|
||
|
MAVLinkSettingsWidget::~MAVLinkSettingsWidget()
|
||
|
{
|
||
|
delete m_ui;
|
||
|
}
|
||
|
|
||
|
void MAVLinkSettingsWidget::changeEvent(QEvent *e)
|
||
|
{
|
||
|
QWidget::changeEvent(e);
|
||
|
switch (e->type()) {
|
||
|
case QEvent::LanguageChange:
|
||
|
m_ui->retranslateUi(this);
|
||
|
break;
|
||
|
default:
|
||
|
break;
|
||
|
}
|
||
|
}
|