Input name saved only when clicking OK (Fixes #750)
This commit is contained in:
@@ -3,11 +3,12 @@
|
|||||||
#include "eeprominterface.h"
|
#include "eeprominterface.h"
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
|
|
||||||
ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, int stickMode) :
|
ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, int stickMode, char * inputName) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
ui(new Ui::ExpoDialog),
|
ui(new Ui::ExpoDialog),
|
||||||
model(model),
|
model(model),
|
||||||
ed(expoData)
|
ed(expoData),
|
||||||
|
inputName(inputName)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
QLabel * lb_fp[] = {ui->lb_FP0,ui->lb_FP1,ui->lb_FP2,ui->lb_FP3,ui->lb_FP4,ui->lb_FP5,ui->lb_FP6,ui->lb_FP7,ui->lb_FP8 };
|
QLabel * lb_fp[] = {ui->lb_FP0,ui->lb_FP1,ui->lb_FP2,ui->lb_FP3,ui->lb_FP4,ui->lb_FP5,ui->lb_FP6,ui->lb_FP7,ui->lb_FP8 };
|
||||||
@@ -76,7 +77,7 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, i
|
|||||||
}
|
}
|
||||||
|
|
||||||
ui->inputName->setValidator(new QRegExpValidator(rx, this));
|
ui->inputName->setValidator(new QRegExpValidator(rx, this));
|
||||||
ui->inputName->setText(model.inputNames[ed->chn]);
|
ui->inputName->setText(inputName);
|
||||||
|
|
||||||
ui->lineName->setValidator(new QRegExpValidator(rx, this));
|
ui->lineName->setValidator(new QRegExpValidator(rx, this));
|
||||||
ui->lineName->setText(ed->name);
|
ui->lineName->setText(ed->name);
|
||||||
@@ -139,7 +140,7 @@ void ExpoDialog::valuesChanged()
|
|||||||
ed->mode = ui->sideCB->currentIndex() + 1;
|
ed->mode = ui->sideCB->currentIndex() + 1;
|
||||||
|
|
||||||
strcpy(ed->name, ui->lineName->text().toAscii().data());
|
strcpy(ed->name, ui->lineName->text().toAscii().data());
|
||||||
strcpy(model.inputNames[ed->chn], ui->inputName->text().toAscii().data());
|
strcpy(inputName, ui->inputName->text().toAscii().data());
|
||||||
|
|
||||||
ed->phases=0;
|
ed->phases=0;
|
||||||
for (int i=8; i>=0 ; i--) {
|
for (int i=8; i>=0 ; i--) {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace Ui {
|
|||||||
class ExpoDialog : public QDialog {
|
class ExpoDialog : public QDialog {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expodata, int stickMode);
|
ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expodata, int stickMode, char * inputName);
|
||||||
~ExpoDialog();
|
~ExpoDialog();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@@ -28,6 +28,7 @@ class ExpoDialog : public QDialog {
|
|||||||
Ui::ExpoDialog * ui;
|
Ui::ExpoDialog * ui;
|
||||||
ModelData & model;
|
ModelData & model;
|
||||||
ExpoData * ed;
|
ExpoData * ed;
|
||||||
|
char * inputName;
|
||||||
GVarGroup * gvGroup;
|
GVarGroup * gvGroup;
|
||||||
CurveGroup * curveGroup;
|
CurveGroup * curveGroup;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -169,12 +169,18 @@ void InputsPanel::gm_openExpo(int index)
|
|||||||
if(index<0 || index>=C9X_MAX_EXPOS) return;
|
if(index<0 || index>=C9X_MAX_EXPOS) return;
|
||||||
|
|
||||||
ExpoData mixd(model.expoData[index]);
|
ExpoData mixd(model.expoData[index]);
|
||||||
|
char inputName[4+1];
|
||||||
emit modified();
|
emit modified();
|
||||||
update();
|
update();
|
||||||
|
|
||||||
ExpoDialog *g = new ExpoDialog(this, model, &mixd, generalSettings.stickMode);
|
if (GetEepromInterface()->getCapability(VirtualInputs))
|
||||||
|
strcpy(inputName, model.inputNames[mixd.chn]);
|
||||||
|
|
||||||
|
ExpoDialog *g = new ExpoDialog(this, model, &mixd, generalSettings.stickMode, inputName);
|
||||||
if (g->exec()) {
|
if (g->exec()) {
|
||||||
model.expoData[index] = mixd;
|
model.expoData[index] = mixd;
|
||||||
|
if (GetEepromInterface()->getCapability(VirtualInputs))
|
||||||
|
strcpy(model.inputNames[mixd.chn], inputName);
|
||||||
emit modified();
|
emit modified();
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user