feat(radio): optional key lock feature (#7383)
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#include "autocombobox.h"
|
||||
#include "namevalidator.h"
|
||||
#include "helpers.h"
|
||||
#include "boardjson.h"
|
||||
|
||||
constexpr char FIM_HATSMODE[] {"Hats Mode"};
|
||||
constexpr char FIM_STICKMODE[] {"Stick Mode"};
|
||||
@@ -474,6 +475,17 @@ void GeneralSetupPanel::setValues()
|
||||
ui->startSoundCB->setChecked(!generalSettings.dontPlayHello);
|
||||
ui->modelQuickSelect_CB->setChecked(generalSettings.modelQuickSelect);
|
||||
ui->chkOneLogPerDay->setChecked(generalSettings.oneLogPerDay);
|
||||
{
|
||||
BoardJson* bj = Boards::getBoardJson(board);
|
||||
bool hasCombo = bj && bj->hasKeyLockCombo();
|
||||
ui->chkKeyLockEnabled->setChecked(hasCombo && generalSettings.keyLockEnabled);
|
||||
ui->chkKeyLockEnabled->setEnabled(hasCombo);
|
||||
ui->label_keyLockEnabled->setEnabled(hasCombo);
|
||||
if (!hasCombo) {
|
||||
ui->chkKeyLockEnabled->setToolTip(tr("Not available on this radio (no key combo defined)"));
|
||||
ui->label_keyLockEnabled->setToolTip(tr("Not available on this radio (no key combo defined)"));
|
||||
}
|
||||
}
|
||||
|
||||
if (Boards::getCapability(board, Board::HasColorLcd)) {
|
||||
ui->modelSelectLayout_CB->setCurrentIndex(generalSettings.modelSelectLayout);
|
||||
@@ -951,3 +963,11 @@ void GeneralSetupPanel::on_chkOneLogPerDay_stateChanged(int)
|
||||
emit modified();
|
||||
}
|
||||
}
|
||||
|
||||
void GeneralSetupPanel::on_chkKeyLockEnabled_stateChanged(int)
|
||||
{
|
||||
if (!lock) {
|
||||
generalSettings.keyLockEnabled = ui->chkKeyLockEnabled->isChecked();
|
||||
emit modified();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,6 +103,7 @@ class GeneralSetupPanel : public GeneralPanel
|
||||
|
||||
void on_pwrOffIfInactiveSB_editingFinished();
|
||||
void on_chkOneLogPerDay_stateChanged(int);
|
||||
void on_chkKeyLockEnabled_stateChanged(int);
|
||||
|
||||
private:
|
||||
Ui::GeneralSetup *ui;
|
||||
|
||||
@@ -1326,6 +1326,20 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="30" column="0">
|
||||
<widget class="QLabel" name="label_keyLockEnabled">
|
||||
<property name="text">
|
||||
<string>Key lock</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="30" column="1">
|
||||
<widget class="QCheckBox" name="chkKeyLockEnabled">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
|
||||
Reference in New Issue
Block a user