1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-24 16:55:20 +03:00

GVAR popup enable checkboxes in companion

This commit is contained in:
Andre Bernet 2014-04-10 23:48:06 +02:00
parent 4eb279e157
commit da23a6cf6c
2 changed files with 18 additions and 0 deletions

View file

@ -156,6 +156,13 @@ FlightMode::FlightMode(QWidget * parent, ModelData & model, int phaseIdx, Genera
gvValues[i]->setMinimum(-1024);
gvValues[i]->setMaximum(1024);
gvLayout->addWidget(gvValues[i], i, col++, 1, 1);
// Popups
gvPopups[i] = new QCheckBox(ui->gvGB);
gvPopups[i]->setProperty("index", i);
gvPopups[i]->setText(tr("Popup enabled"));
connect(gvPopups[i], SIGNAL(toggled(bool)), this, SLOT(phaseGVPopupToggled(bool)));
gvLayout->addWidget(gvPopups[i], i, col++, 1, 1);
}
}
else {
@ -203,6 +210,7 @@ void FlightMode::update()
gvValues[i]->setDisabled(true);
}
gvValues[i]->setValue(phasegvar->gvars[i]);
gvPopups[i]->setChecked(model.gvars_popups[i]);
}
for (int i=0; i<reCount; i++) {
@ -317,6 +325,13 @@ void FlightMode::phaseGVUse_currentIndexChanged(int index)
}
}
void FlightMode::phaseGVPopupToggled(bool checked)
{
QCheckBox *cb = qobject_cast<QCheckBox*>(sender());
int gvar = cb->property("index").toInt();
model.gvars_popups[gvar] = checked;
}
void FlightMode::phaseREValue_editingFinished()
{
if (!lock) {

View file

@ -7,6 +7,7 @@
#include <QTabWidget>
#include <QSpinBox>
#include <QComboBox>
#include <QCheckBox>
namespace Ui {
class FlightMode;
@ -37,6 +38,7 @@ class FlightMode : public ModelPanel
void GVSource_currentIndexChanged(int index);
void phaseGVValue_editingFinished();
void phaseGVUse_currentIndexChanged(int index);
void phaseGVPopupToggled(bool checked);
void phaseREValue_editingFinished();
void phaseREUse_currentIndexChanged(int index);
@ -49,6 +51,7 @@ class FlightMode : public ModelPanel
QVector<QLabel *> trimsLabel;
QLineEdit * gvNames[C9X_MAX_GVARS];
QSpinBox * gvValues[C9X_MAX_GVARS];
QCheckBox * gvPopups[C9X_MAX_GVARS];
QSpinBox * reValues[C9X_MAX_ENCODERS];
QVector<QComboBox *> trimsUse;
QVector<QSpinBox *> trimsValue;