mirror of
https://github.com/opentx/opentx.git
synced 2025-07-22 07:45:14 +03:00
Fixes #1329
This commit is contained in:
parent
9e1afe8cb0
commit
8d42380abb
4 changed files with 29 additions and 31 deletions
|
@ -349,36 +349,6 @@ void populateBacklightCB(QComboBox *b, const uint8_t value)
|
|||
}
|
||||
}
|
||||
|
||||
void populateAndSwitchCB(QComboBox *b, const RawSwitch & value)
|
||||
{
|
||||
GeneralSettings fakeSettings;
|
||||
|
||||
if (IS_ARM(GetEepromInterface()->getBoard())) {
|
||||
populateSwitchCB(b, value, fakeSettings);
|
||||
}
|
||||
else {
|
||||
RawSwitch item;
|
||||
|
||||
b->clear();
|
||||
|
||||
item = RawSwitch(SWITCH_TYPE_NONE);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
if (item == value) b->setCurrentIndex(b->count()-1);
|
||||
|
||||
for (int i=1; i<=GetCurrentFirmware()->getCapability(SwitchesPositions); i++) {
|
||||
item = RawSwitch(SWITCH_TYPE_SWITCH, i);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
if (item == value) b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
|
||||
for (int i=1; i<=6; i++) {
|
||||
item = RawSwitch(SWITCH_TYPE_VIRTUAL, i);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
if (item == value) b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettings & generalSettings, unsigned long attr)
|
||||
{
|
||||
RawSwitch item;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue