mirror of
https://github.com/opentx/opentx.git
synced 2025-07-23 08:15:17 +03:00
Fixes #1331
This commit is contained in:
parent
405391033d
commit
e4b5f98d58
1 changed files with 6 additions and 14 deletions
|
@ -479,8 +479,7 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, const GeneralSettin
|
||||||
|
|
||||||
void populateGVCB(QComboBox *b, int value)
|
void populateGVCB(QComboBox *b, int value)
|
||||||
{
|
{
|
||||||
int selected=0;
|
bool selected = false;
|
||||||
int nullitem;
|
|
||||||
|
|
||||||
b->clear();
|
b->clear();
|
||||||
|
|
||||||
|
@ -490,29 +489,22 @@ void populateGVCB(QComboBox *b, int value)
|
||||||
b->addItem(QObject::tr("-GV%1").arg(-i), gval);
|
b->addItem(QObject::tr("-GV%1").arg(-i), gval);
|
||||||
if (value == gval) {
|
if (value == gval) {
|
||||||
b->setCurrentIndex(b->count()-1);
|
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++) {
|
for (int i=1; i<=pgvars; i++) {
|
||||||
int16_t gval = (int16_t)(10000+i);
|
int16_t gval = (int16_t)(10000+i);
|
||||||
b->addItem(QObject::tr("GV%1").arg(i), gval);
|
b->addItem(QObject::tr("GV%1").arg(i), gval);
|
||||||
if (value == gval) {
|
if (value == gval) {
|
||||||
b->setCurrentIndex(b->count()-1);
|
b->setCurrentIndex(b->count()-1);
|
||||||
selected=1;
|
selected = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selected==0)
|
if (!selected) {
|
||||||
b->setCurrentIndex(nullitem);
|
b->setCurrentIndex(pgvars);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void populateSourceCB(QComboBox *b, const RawSource & source, const ModelData & model, unsigned int flags)
|
void populateSourceCB(QComboBox *b, const RawSource & source, const ModelData & model, unsigned int flags)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue