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