FM refresh
This commit is contained in:
@@ -58,7 +58,7 @@ FlightModePanel::FlightModePanel(QWidget * parent, ModelData & model, int phaseI
|
|||||||
// Flight mode switch
|
// Flight mode switch
|
||||||
if (phaseIdx > 0) {
|
if (phaseIdx > 0) {
|
||||||
ui->swtch->setModel(switchModel);
|
ui->swtch->setModel(switchModel);
|
||||||
connect(ui->swtch, SIGNAL(activated(int)), this, SLOT(phaseSwitchChanged(int)));
|
connect(ui->swtch, SIGNAL(currentIndexChanged(int)), this, SLOT(phaseSwitch_currentIndexChanged(int)));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ui->swtch->hide();
|
ui->swtch->hide();
|
||||||
@@ -393,15 +393,14 @@ void FlightModePanel::phaseName_editingFinished()
|
|||||||
emit modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FlightModePanel::phaseSwitchChanged(int index)
|
void FlightModePanel::phaseSwitch_currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
if (!lock) {
|
if (!lock) {
|
||||||
bool ok;
|
bool ok;
|
||||||
const RawSwitch rs(ui->swtch->itemData(index).toInt(&ok));
|
const RawSwitch rs(ui->swtch->itemData(index).toInt(&ok));
|
||||||
if (ok && phase.swtch.toValue() != rs.toValue()) {
|
if (ok && phase.swtch.toValue() != rs.toValue()) {
|
||||||
phase.swtch = rs;
|
phase.swtch = rs;
|
||||||
if (!rs.isSet())
|
emit phaseSwitchChanged();
|
||||||
emit phaseNoSwitchSet();
|
|
||||||
emit modified();
|
emit modified();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1386,15 +1385,13 @@ FlightModesPanel::FlightModesPanel(QWidget * parent, ModelData & model, GeneralS
|
|||||||
for (int i = 0; i < modesCount; i++) {
|
for (int i = 0; i < modesCount; i++) {
|
||||||
FlightModePanel * tab = new FlightModePanel(tabWidget, model, i, generalSettings, firmware, rawSwitchFilteredModel);
|
FlightModePanel * tab = new FlightModePanel(tabWidget, model, i, generalSettings, firmware, rawSwitchFilteredModel);
|
||||||
tab->setProperty("index", i);
|
tab->setProperty("index", i);
|
||||||
connect(tab, &FlightModePanel::modified, this, &FlightModesPanel::modified);
|
connect(tab, &FlightModePanel::modified, this, &FlightModesPanel::modified);
|
||||||
connect(tab, &FlightModePanel::phaseDataChanged, this, &FlightModesPanel::onPhaseNameChanged);
|
connect(tab, &FlightModePanel::phaseDataChanged, this, &FlightModesPanel::onPhaseNameChanged);
|
||||||
connect(tab, &FlightModePanel::phaseDataChanged, this, &FlightModesPanel::update);
|
connect(tab, &FlightModePanel::phaseNameChanged, this, &FlightModesPanel::onPhaseNameChanged);
|
||||||
connect(tab, &FlightModePanel::phaseDataChanged, this, &FlightModesPanel::refreshDataModels);
|
connect(tab, &FlightModePanel::phaseSwitchChanged, this, &FlightModesPanel::refreshDataModels);
|
||||||
connect(tab, &FlightModePanel::phaseNameChanged, this, &FlightModesPanel::onPhaseNameChanged);
|
connect(tab, &FlightModePanel::gvNameChanged, this, &FlightModesPanel::refreshDataModels);
|
||||||
connect(tab, &FlightModePanel::phaseNoSwitchSet, this, &FlightModesPanel::refreshDataModels);
|
|
||||||
connect(tab, &FlightModePanel::gvNameChanged, this, &FlightModesPanel::refreshDataModels);
|
|
||||||
|
|
||||||
connect(this, &FlightModesPanel::updated, tab, &FlightModePanel::update);
|
connect(this, &FlightModesPanel::updated, tab, &FlightModePanel::update);
|
||||||
tabWidget->addTab(tab, getTabName(i));
|
tabWidget->addTab(tab, getTabName(i));
|
||||||
panels << tab;
|
panels << tab;
|
||||||
}
|
}
|
||||||
@@ -1426,6 +1423,7 @@ void FlightModesPanel::onPhaseNameChanged()
|
|||||||
{
|
{
|
||||||
int index = sender()->property("index").toInt();
|
int index = sender()->property("index").toInt();
|
||||||
tabWidget->setTabText(index, getTabName(index));
|
tabWidget->setTabText(index, getTabName(index));
|
||||||
|
refreshDataModels();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FlightModesPanel::update()
|
void FlightModesPanel::update()
|
||||||
|
|||||||
@@ -50,11 +50,11 @@ class FlightModePanel : public ModelPanel
|
|||||||
void gvNameChanged();
|
void gvNameChanged();
|
||||||
void phaseDataChanged();
|
void phaseDataChanged();
|
||||||
void phaseNameChanged();
|
void phaseNameChanged();
|
||||||
void phaseNoSwitchSet();
|
void phaseSwitchChanged();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void phaseName_editingFinished();
|
void phaseName_editingFinished();
|
||||||
void phaseSwitchChanged(int index);
|
void phaseSwitch_currentIndexChanged(int index);
|
||||||
void phaseFadeIn_editingFinished();
|
void phaseFadeIn_editingFinished();
|
||||||
void phaseFadeOut_editingFinished();
|
void phaseFadeOut_editingFinished();
|
||||||
void phaseTrimUse_currentIndexChanged(int index);
|
void phaseTrimUse_currentIndexChanged(int index);
|
||||||
|
|||||||
Reference in New Issue
Block a user