GF enabled checkbox was missing (Fix #2558)

Number of GF in setup panel was not aligned with the radio
This commit is contained in:
Andre Bernet
2015-07-24 21:54:46 +02:00
parent 69cbb06470
commit 9b002b94ca
6 changed files with 25 additions and 2 deletions
+1
View File
@@ -1312,6 +1312,7 @@ enum Capability {
LCDWidth,
GetThrSwitch,
HasDisplayText,
GlobalFunctions,
VirtualInputs,
TrainerInputs,
RtcTime,
@@ -731,6 +731,8 @@ int OpenTxFirmware::getCapability(const Capability capability)
return (IS_TARANIS(board) ? SWITCH_SF1 : SWITCH_THR) ;
case HasDisplayText:
return IS_ARM(board) ? 1 : 0;
case GlobalFunctions:
return IS_ARM(board) ? 64 : 0;
case VirtualInputs:
return IS_TARANIS(board) ? 32 : 0;
case TrainerInputs:
+3 -2
View File
@@ -61,7 +61,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model,
addEmptyLabel(gridLayout, 5 );
lock = true;
int num_fsw = firmware->getCapability(CustomFunctions);
int num_fsw = model ? firmware->getCapability(CustomFunctions) : firmware->getCapability(GlobalFunctions);
if (!firmware->getCapability(VoicesAsNumbers)) {
tracksSet = getFilesSet(getSoundsPath(generalSettings), QStringList() << "*.wav" << "*.WAV", firmware->getCapability(VoicesMaxLength));
@@ -514,7 +514,8 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
void CustomFunctionsPanel::update()
{
lock = true;
for (int i=0; i<firmware->getCapability(CustomFunctions); i++) {
int num_fsw = model ? firmware->getCapability(CustomFunctions) : firmware->getCapability(GlobalFunctions);
for (int i=0; i<num_fsw; i++) {
if (!initialized) {
populateSwitchCB(fswtchSwtch[i], functions[i].swtch, generalSettings, model ? SpecialFunctionsContext : GlobalFunctionsContext);
populateFuncCB(fswtchFunc[i], functions[i].func);
+11
View File
@@ -517,6 +517,10 @@ SetupPanel::SetupPanel(QWidget *parent, ModelData & model, GeneralSettings & gen
if (!firmware->getCapability(HasDisplayText)) {
ui->displayText->hide();
}
if (!firmware->getCapability(GlobalFunctions)) {
ui->gfEnabled->hide();
}
// Beep Center checkboxes
prevFocus = ui->trimsDisplay;
@@ -774,6 +778,7 @@ void SetupPanel::update()
ui->extendedLimits->setChecked(model->extendedLimits);
ui->extendedTrims->setChecked(model->extendedTrims);
ui->displayText->setChecked(model->displayChecklist);
ui->gfEnabled->setChecked(!model->noGlobalFunctions);
updateBeepCenter();
updateStartupSwitches();
@@ -915,6 +920,12 @@ void SetupPanel::on_displayText_toggled(bool checked)
emit modified();
}
void SetupPanel::on_gfEnabled_toggled(bool checked)
{
model->noGlobalFunctions = !checked;
emit modified();
}
void SetupPanel::on_throttleTrim_toggled(bool checked)
{
model->thrTrim = checked;
+1
View File
@@ -101,6 +101,7 @@ class SetupPanel : public ModelPanel
void on_throttleWarning_toggled(bool checked);
void on_throttleReverse_toggled(bool checked);
void on_displayText_toggled(bool checked);
void on_gfEnabled_toggled(bool checked);
void on_image_currentIndexChanged(int index);
void on_trimIncrement_currentIndexChanged(int index);
void onBeepCenterToggled(bool checked);
+7
View File
@@ -215,6 +215,13 @@ If this is checked the throttle will be reversed. Idle will be forward, trim wi
</item>
</widget>
</item>
<item row="1" column="4">
<widget class="QCheckBox" name="gfEnabled">
<property name="text">
<string>Global Functions</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="5" column="0">