1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-21 15:25:17 +03:00
This commit is contained in:
bsongis 2014-06-20 16:16:16 +02:00
parent 405391033d
commit e4b5f98d58

View file

@ -479,8 +479,7 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin
void populateGVCB(QComboBox *b, int value)
{
int selected=0;
int nullitem;
bool selected = false;
b->clear();
@ -490,29 +489,22 @@ void populateGVCB(QComboBox *b, int value)
b->addItem(QObject::tr("-GV%1").arg(-i), gval);
if (value == gval) {
b->setCurrentIndex(b->count()-1);
selected=1;
selected = true;
}
}
b->addItem("---", 0);
nullitem=b->count()-1;
if (value == 0) {
b->setCurrentIndex(b->count()-1);
selected=1;
}
for (int i=1; i<=pgvars; i++) {
int16_t gval = (int16_t)(10000+i);
b->addItem(QObject::tr("GV%1").arg(i), gval);
if (value == gval) {
b->setCurrentIndex(b->count()-1);
selected=1;
selected = true;
}
}
if (selected==0)
b->setCurrentIndex(nullitem);
if (!selected) {
b->setCurrentIndex(pgvars);
}
}
void populateSourceCB(QComboBox *b, const RawSource & source, const ModelData & model, unsigned int flags)