mirror of
https://github.com/opentx/opentx.git
synced 2025-07-21 07:15:12 +03:00
Firmware options refactoring. It allows
FirmwareInterface::getCapability() to know which options are enabled in the preferences. The Heli tab and the GVars are displayed according to these options.
This commit is contained in:
parent
571b498a82
commit
e6391f04c4
22 changed files with 489 additions and 650 deletions
|
@ -140,20 +140,6 @@ void populatePhasesCB(QComboBox *b, int value)
|
|||
b->setCurrentIndex(value + GetCurrentFirmware()->getCapability(FlightModes));
|
||||
}
|
||||
|
||||
bool gvarsEnabled()
|
||||
{
|
||||
int gvars=0;
|
||||
if (GetCurrentFirmware()->getCapability(HasVariants)) {
|
||||
if ((GetCurrentFirmwareVariant() & GVARS_VARIANT)) {
|
||||
gvars=1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
gvars=1;
|
||||
}
|
||||
return gvars;
|
||||
}
|
||||
|
||||
GVarGroup::GVarGroup(QCheckBox *weightGV, QSpinBox *weightSB, QComboBox *weightCB, int & weight, const int deflt, const int mini, const int maxi, const unsigned int flags):
|
||||
QObject(),
|
||||
weightGV(weightGV),
|
||||
|
@ -165,7 +151,7 @@ GVarGroup::GVarGroup(QCheckBox *weightGV, QSpinBox *weightSB, QComboBox *weightC
|
|||
{
|
||||
lock = true;
|
||||
|
||||
if (gvarsEnabled()) {
|
||||
if (GetCurrentFirmware()->getCapability(Gvars)) {
|
||||
populateGVCB(weightCB, weight);
|
||||
connect(weightGV, SIGNAL(stateChanged(int)), this, SLOT(gvarCBChanged(int)));
|
||||
connect(weightCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue