[Companion] AutoCheckBox used instead of QCheckBox
This commit is contained in:
@@ -728,7 +728,6 @@ TelemetryPanel::TelemetryPanel(QWidget *parent, ModelData & model, GeneralSettin
|
|||||||
analogs[1] = new TelemetryAnalog(this, model.frsky.channels[1], model, generalSettings, firmware);
|
analogs[1] = new TelemetryAnalog(this, model.frsky.channels[1], model, generalSettings, firmware);
|
||||||
ui->A2Layout->addWidget(analogs[1]);
|
ui->A2Layout->addWidget(analogs[1]);
|
||||||
connect(analogs[1], SIGNAL(modified()), this, SLOT(onAnalogModified()));
|
connect(analogs[1], SIGNAL(modified()), this, SLOT(onAnalogModified()));
|
||||||
ui->ignoreSensorIds->hide();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IS_TARANIS(firmware->getBoard())) {
|
if (IS_TARANIS(firmware->getBoard())) {
|
||||||
@@ -796,10 +795,12 @@ void TelemetryPanel::setup()
|
|||||||
ui->telemetryProtocol->addItem(tr("FrSky D (cable)"), 2);
|
ui->telemetryProtocol->addItem(tr("FrSky D (cable)"), 2);
|
||||||
}
|
}
|
||||||
ui->telemetryProtocol->setCurrentIndex(model->telemetryProtocol);
|
ui->telemetryProtocol->setCurrentIndex(model->telemetryProtocol);
|
||||||
|
ui->ignoreSensorIds->setField(model->frsky.ignoreSensorIds);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ui->telemetryProtocolLabel->hide();
|
ui->telemetryProtocolLabel->hide();
|
||||||
ui->telemetryProtocol->hide();
|
ui->telemetryProtocol->hide();
|
||||||
|
ui->ignoreSensorIds->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
ui->rssiAlarm1SB->setValue(model->frsky.rssiAlarms[0].value);
|
ui->rssiAlarm1SB->setValue(model->frsky.rssiAlarms[0].value);
|
||||||
@@ -871,10 +872,6 @@ void TelemetryPanel::setup()
|
|||||||
ui->variousGB->show();
|
ui->variousGB->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IS_ARM(firmware->getBoard())) {
|
|
||||||
ui->ignoreSensorIds->setChecked(model->frsky.ignoreSensorIds);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(firmware->getCapability(HasMahPersistent))) {
|
if (!(firmware->getCapability(HasMahPersistent))) {
|
||||||
ui->mahCount_label->hide();
|
ui->mahCount_label->hide();
|
||||||
ui->mahCount_SB->hide();
|
ui->mahCount_SB->hide();
|
||||||
@@ -1041,12 +1038,6 @@ void TelemetryPanel::on_mahCount_SB_editingFinished()
|
|||||||
emit modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TelemetryPanel::on_ignoreSensorIds_toggled(bool checked)
|
|
||||||
{
|
|
||||||
model->frsky.ignoreSensorIds = checked;
|
|
||||||
emit modified();
|
|
||||||
}
|
|
||||||
|
|
||||||
void TelemetryPanel::on_mahCount_ChkB_toggled(bool checked)
|
void TelemetryPanel::on_mahCount_ChkB_toggled(bool checked)
|
||||||
{
|
{
|
||||||
model->frsky.mAhPersistent = checked;
|
model->frsky.mAhPersistent = checked;
|
||||||
|
|||||||
@@ -132,7 +132,6 @@ class TelemetryPanel : public ModelPanel
|
|||||||
void on_fasOffset_DSB_editingFinished();
|
void on_fasOffset_DSB_editingFinished();
|
||||||
void on_mahCount_SB_editingFinished();
|
void on_mahCount_SB_editingFinished();
|
||||||
void on_mahCount_ChkB_toggled(bool checked);
|
void on_mahCount_ChkB_toggled(bool checked);
|
||||||
void on_ignoreSensorIds_toggled(bool checked);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::Telemetry *ui;
|
Ui::Telemetry *ui;
|
||||||
|
|||||||
@@ -910,7 +910,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QCheckBox" name="ignoreSensorIds">
|
<widget class="AutoCheckBox" name="ignoreSensorIds">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Disable multi sensor handling</string>
|
<string>Disable multi sensor handling</string>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class AutoCheckBox: public QCheckBox
|
|||||||
{
|
{
|
||||||
lock = true;
|
lock = true;
|
||||||
if (field) {
|
if (field) {
|
||||||
setChecked((int)*field);
|
setChecked(*field);
|
||||||
}
|
}
|
||||||
lock = false;
|
lock = false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user