chore(cpn): move global variables from flight/drive modes tab to own tab (#6624)
This commit is contained in:
@@ -145,14 +145,6 @@ ui(new Ui::GeneralSetup)
|
||||
ui->faimode_CB->setChecked(generalSettings.fai);
|
||||
}
|
||||
|
||||
if (!firmware->getCapability(RotaryEncoderNavigation)) {
|
||||
ui->rotEncMode_CB->hide();
|
||||
ui->rotEncMode_label->hide();
|
||||
}
|
||||
else {
|
||||
populateRotEncModeCB();
|
||||
}
|
||||
|
||||
if (!firmware->getCapability(HasPxxCountry)) {
|
||||
ui->countrycode_label->hide();
|
||||
ui->countrycode_CB->hide();
|
||||
@@ -260,15 +252,6 @@ ui(new Ui::GeneralSetup)
|
||||
ui->hapticmodeCB->setDisabled(true);
|
||||
}
|
||||
|
||||
int reCount = firmware->getCapability(RotaryEncoders);
|
||||
if (reCount == 0) {
|
||||
ui->re_label->hide();
|
||||
ui->re_CB->hide();
|
||||
}
|
||||
else {
|
||||
populateRotEncCB(reCount);
|
||||
}
|
||||
|
||||
if (Boards::getCapability(firmware->getBoard(), Board::HasColorLcd)) {
|
||||
ui->backlightautoSB->setMinimum(5);
|
||||
}
|
||||
@@ -505,18 +488,6 @@ void GeneralSetupPanel::updateVarioPitchRange()
|
||||
ui->varioPMax_SB->setMinimum(700 + (generalSettings.varioPitch * 10) + 1000 - 800);
|
||||
}
|
||||
|
||||
void GeneralSetupPanel::populateRotEncCB(int reCount)
|
||||
{
|
||||
QString strings[] = { tr("No"), tr("RotEnc A"), tr("Rot Enc B"), tr("Rot Enc C"), tr("Rot Enc D"), tr("Rot Enc E")};
|
||||
QComboBox * b = ui->re_CB;
|
||||
|
||||
b->clear();
|
||||
for (int i = 0; i <= reCount; i++) {
|
||||
b->addItem(strings[i]);
|
||||
}
|
||||
b->setCurrentIndex(generalSettings.reNavigation);
|
||||
}
|
||||
|
||||
int pwrDelayFromYaml(int delay)
|
||||
{
|
||||
static int8_t vals[] = { 1, 4, 3, 2, 0 };
|
||||
@@ -631,31 +602,6 @@ void GeneralSetupPanel::on_faimode_CB_stateChanged(int)
|
||||
}
|
||||
}
|
||||
|
||||
void GeneralSetupPanel::populateRotEncModeCB()
|
||||
{
|
||||
QComboBox * b = ui->rotEncMode_CB;
|
||||
QString strings[] = { tr("Normal"), tr("Inverted"), tr("Vertical Inverted, Horizontal Normal"), tr("Vertical Inverted, Horizontal Alternate"), tr("Normal, Edit Inverted") };
|
||||
int itemCount = 5;
|
||||
|
||||
if (Boards::getCapability(firmware->getBoard(), Board::HasColorLcd)) {
|
||||
itemCount = 2;
|
||||
}
|
||||
|
||||
b->clear();
|
||||
for (int i = 0; i < itemCount; i++) {
|
||||
b->addItem(strings[i], 0);
|
||||
}
|
||||
b->setCurrentIndex(generalSettings.rotEncMode);
|
||||
}
|
||||
|
||||
void GeneralSetupPanel::on_rotEncMode_CB_currentIndexChanged(int index)
|
||||
{
|
||||
if (!lock) {
|
||||
generalSettings.rotEncMode = index;
|
||||
emit modified();
|
||||
}
|
||||
}
|
||||
|
||||
void GeneralSetupPanel::on_speakerPitchSB_editingFinished()
|
||||
{
|
||||
if (!lock) {
|
||||
@@ -835,14 +781,6 @@ void GeneralSetupPanel::on_vBatMaxDSB_editingFinished()
|
||||
}
|
||||
}
|
||||
|
||||
void GeneralSetupPanel::on_re_CB_currentIndexChanged(int index)
|
||||
{
|
||||
if (!lock) {
|
||||
generalSettings.reNavigation = ui->re_CB->currentIndex();
|
||||
emit modified();
|
||||
}
|
||||
}
|
||||
|
||||
void GeneralSetupPanel::on_countrycode_CB_currentIndexChanged(int index)
|
||||
{
|
||||
if (!lock) {
|
||||
|
||||
Reference in New Issue
Block a user