Add BT mode handling (#5926)

Enable BT for Xlite and X7
This commit is contained in:
3djc
2018-06-02 18:15:37 +02:00
committed by Bertrand Songis
parent e3f2664440
commit a87722b078
5 changed files with 24 additions and 10 deletions
+4 -4
View File
@@ -157,8 +157,8 @@ HardwarePanel::HardwarePanel(QWidget * parent, GeneralSettings & generalSettings
ui->txCurrentCalibrationLabel->hide();
}
if (IS_TARANIS_X9E(board) || IS_HORUS(board)) {
ui->bluetoothEnable->setChecked(generalSettings.bluetoothEnable);
if (IS_TARANIS_X7(board) || IS_TARANIS_XLITE(board)|| IS_TARANIS_X9E(board) || IS_HORUS(board)) {
ui->bluetoothMode->setCurrentIndex(generalSettings.bluetoothMode);
ui->bluetoothName->setField(generalSettings.bluetoothName, 10, this);
}
else {
@@ -238,9 +238,9 @@ void HardwarePanel::on_txCurrentCalibration_editingFinished()
}
}
void HardwarePanel::on_bluetoothEnable_stateChanged(int)
void HardwarePanel::on_bluetoothMode_stateChanged(int index)
{
generalSettings.bluetoothEnable = ui->bluetoothEnable->isChecked();
generalSettings.bluetoothMode = index;
emit modified();
}
+1 -1
View File
@@ -48,7 +48,7 @@ class HardwarePanel : public GeneralPanel
void on_txCurrentCalibration_editingFinished();
void on_txVoltageCalibration_editingFinished();
void on_bluetoothEnable_stateChanged(int);
void on_bluetoothMode_stateChanged(int);
void on_filterEnable_stateChanged();
void on_serialPortMode_currentIndexChanged(int index);
+18 -3
View File
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>470</width>
<height>1095</height>
<height>1419</height>
</rect>
</property>
<property name="sizePolicy">
@@ -1099,10 +1099,25 @@
<number>0</number>
</property>
<item>
<widget class="QCheckBox" name="bluetoothEnable">
<property name="text">
<widget class="QComboBox" name="bluetoothMode">
<property name="text" stdset="0">
<string/>
</property>
<item>
<property name="text">
<string>OFF</string>
</property>
</item>
<item>
<property name="text">
<string>Telemetry</string>
</property>
</item>
<item>
<property name="text">
<string>Trainer</string>
</property>
</item>
</widget>
</item>
<item>