mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-10-31 15:37:11 -04:00
Simpler #634, always use the first choice when out of bounds
This commit is contained in:
parent
4cd8735014
commit
120d394f01
@ -502,16 +502,12 @@ std::string SDRDevicesDialog::getSelectedChoiceOption(wxPGProperty* prop, const
|
|||||||
if (choiceIndex >= 0 && choiceIndex < arg.options.size()) {
|
if (choiceIndex >= 0 && choiceIndex < arg.options.size()) {
|
||||||
//normal selection
|
//normal selection
|
||||||
optionName = arg.options[choiceIndex];
|
optionName = arg.options[choiceIndex];
|
||||||
} else if (choiceIndex >= arg.options.size()) {
|
} else {
|
||||||
//choose the last one of the list:
|
|
||||||
optionName = arg.options[arg.options.size() - 1];
|
|
||||||
prop->SetChoiceSelection(arg.options.size() - 1);
|
|
||||||
} else if (choiceIndex < 0) {
|
|
||||||
//choose the first one of the list:
|
//choose the first one of the list:
|
||||||
optionName = arg.options[0];
|
optionName = arg.options[0];
|
||||||
prop->SetChoiceSelection(0);
|
prop->SetChoiceSelection(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return optionName;
|
return optionName;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user