diff --git a/companion/src/contributorsdialog.cpp b/companion/src/contributorsdialog.cpp index 8f3066b79..54d32f9f7 100644 --- a/companion/src/contributorsdialog.cpp +++ b/companion/src/contributorsdialog.cpp @@ -8,7 +8,8 @@ contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnu { ui->setupUi(this); switch (contest) { - case 0: { + case 0: + { QFile file(":/DONATIONS.txt"); QString str; str.append(""); @@ -20,7 +21,7 @@ contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnu str.append(""+tr("People who have contributed to this project")+""); str.append(""); str.append(""); - if(file.open( QIODevice::ReadOnly | QIODevice::Text ) ) { + if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { int columns=6; float cwidth=100.0/columns; while (!file.atEnd()) { @@ -66,26 +67,29 @@ contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnu } } str.append(""); - str.append(""); - str.append(""); + str.append(""); + str.append(""); str.append("
 
"+tr("Honors go to Rafal Tomczak (RadioClone) and Thomas Husterer (th9x) \nof course. Also to Erez Raviv (er9x) and it's fantastic eePe, from which\nOpenTX Companion was forked out.")+"
"+tr("Thank you all !!!")+"
" + tr("Honors go to Rafal Tomczak (RadioClone), Thomas Husterer (th9x) and Erez Raviv (er9x and eePe)") + "
" + tr("Thank you all !!!") + "
"); str.append(""); ui->textEditor->setHtml(str); - ui->textEditor->scroll(0,0); - this->setWindowTitle(tr("Contributors")); - } + ui->textEditor->scroll(0, 0); + setWindowTitle(tr("Contributors")); break; + } - case 1:{ + case 1: + { QFile file(":/releasenotes.txt"); if(file.open( QIODevice::ReadOnly | QIODevice::Text ) ) { ui->textEditor->setHtml(file.readAll()); } ui->textEditor->scroll(0,0); - this->setWindowTitle(tr("Companion Release Notes")); - } + setWindowTitle(tr("Companion Release Notes")); break; - case 2:{ + } + + case 2: + { if (!rnurl.isEmpty()) { this->setWindowTitle(tr("OpenTX Release Notes")); manager = new QNetworkAccessManager(this); @@ -94,7 +98,8 @@ contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnu QNetworkRequest request(url); request.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::AlwaysNetwork); manager->get(request); - } else { + } + else { QTimer::singleShot(0, this, SLOT(forceClose())); } break; @@ -104,7 +109,7 @@ contributorsDialog::contributorsDialog(QWidget *parent, int contest, QString rnu void contributorsDialog::showEvent ( QShowEvent * ) { - ui->textEditor->scroll(0,0); + ui->textEditor->scroll(0, 0); } contributorsDialog::~contributorsDialog() @@ -117,6 +122,7 @@ void contributorsDialog::replyFinished(QNetworkReply * reply) ui->textEditor->setHtml(reply->readAll()); } -void contributorsDialog::forceClose() { +void contributorsDialog::forceClose() +{ accept();; } diff --git a/companion/src/eeprominterface.cpp b/companion/src/eeprominterface.cpp index 5ff32e0da..c52b8f058 100644 --- a/companion/src/eeprominterface.cpp +++ b/companion/src/eeprominterface.cpp @@ -287,7 +287,12 @@ QString RawSource::toString() if (index<0) { return QObject::tr("----"); } - switch(type) { + switch (type) { + case SOURCE_TYPE_VIRTUAL_INPUT: + if (model && strlen(model->inputNames[index]) > 0) + return QString(model->inputNames[index]); + else + return QObject::tr("Virtual Input %1").arg(index+1); case SOURCE_TYPE_STICK: return AnalogString(index); case SOURCE_TYPE_TRIM: diff --git a/companion/src/eeprominterface.h b/companion/src/eeprominterface.h index e01e89bd9..1b8ec876f 100644 --- a/companion/src/eeprominterface.h +++ b/companion/src/eeprominterface.h @@ -286,19 +286,22 @@ class RawSource { public: RawSource(): type(SOURCE_TYPE_NONE), - index(0) + index(0), + model(NULL) { } - RawSource(int value): + RawSource(int value, const ModelData * model=NULL): type(RawSourceType(abs(value)/65536)), - index(value >= 0 ? abs(value)%65536 : -(abs(value)%65536)) + index(value >= 0 ? abs(value)%65536 : -(abs(value)%65536)), + model(model) { } - RawSource(RawSourceType type, int index=0): + RawSource(RawSourceType type, int index=0, const ModelData * model=NULL): type(type), - index(index) + index(index), + model(model) { } @@ -322,6 +325,7 @@ class RawSource { RawSourceType type; int index; + const ModelData * model; }; enum RawSwitchType { diff --git a/companion/src/helpers.cpp b/companion/src/helpers.cpp index a45c6f27c..1ac6c4dea 100644 --- a/companion/src/helpers.cpp +++ b/companion/src/helpers.cpp @@ -399,7 +399,7 @@ void populateFuncParamArmTCB(QComboBox *b, ModelData * g_model, char * value, QS } } -void populateFuncParamCB(QComboBox *b, uint function, unsigned int value, unsigned int adjustmode) +void populateFuncParamCB(QComboBox *b, const ModelData & model, uint function, unsigned int value, unsigned int adjustmode) { QStringList qs; b->clear(); @@ -423,18 +423,18 @@ void populateFuncParamCB(QComboBox *b, uint function, unsigned int value, unsign b->setCurrentIndex(value); } else if (function==FuncVolume) { - populateSourceCB(b, RawSource(value), POPULATE_SOURCES|POPULATE_TRIMS); + populateSourceCB(b, RawSource(value), model, POPULATE_SOURCES|POPULATE_TRIMS); } else if (function==FuncPlayValue) { - populateSourceCB(b, RawSource(value), POPULATE_SOURCES|POPULATE_SWITCHES|POPULATE_GVARS|POPULATE_TRIMS|POPULATE_TELEMETRYEXT); + populateSourceCB(b, RawSource(value), model, POPULATE_SOURCES|POPULATE_VIRTUAL_INPUTS|POPULATE_SWITCHES|POPULATE_GVARS|POPULATE_TRIMS|POPULATE_TELEMETRYEXT); } else if (function>=FuncAdjustGV1 && function<=FuncAdjustGVLast) { switch (adjustmode) { case 1: - populateSourceCB(b, RawSource(value), POPULATE_SOURCES|POPULATE_TRIMS|POPULATE_SWITCHES); + populateSourceCB(b, RawSource(value), model, POPULATE_SOURCES|POPULATE_TRIMS|POPULATE_SWITCHES); break; case 2: - populateSourceCB(b, RawSource(value), POPULATE_GVARS); + populateSourceCB(b, RawSource(value), model, POPULATE_GVARS); break; case 3: b->clear(); @@ -998,8 +998,7 @@ void populateGVCB(QComboBox *b, int value) b->setCurrentIndex(nullitem); } - -void populateSourceCB(QComboBox *b, const RawSource &source, unsigned int flags) +void populateSourceCB(QComboBox *b, const RawSource & source, const ModelData & model, unsigned int flags) { RawSource item; @@ -1009,7 +1008,18 @@ void populateSourceCB(QComboBox *b, const RawSource &source, unsigned int flags) item = RawSource(SOURCE_TYPE_NONE); b->addItem(item.toString(), item.toValue()); if (item == source) b->setCurrentIndex(b->count()-1); + } + if (flags & POPULATE_VIRTUAL_INPUTS) { + int virtualInputs = GetEepromInterface()->getCapability(VirtualInputs); + for (int i=0; iaddItem(item.toString(), item.toValue()); + if (item == source) b->setCurrentIndex(b->count()-1); + } + } + + if (flags & POPULATE_SOURCES) { for (int i=0; i<4+GetEepromInterface()->getCapability(Pots); i++) { item = RawSource(SOURCE_TYPE_STICK, i); b->addItem(item.toString(), item.toValue()); diff --git a/companion/src/helpers.h b/companion/src/helpers.h index 99669e64c..f62e9b39e 100644 --- a/companion/src/helpers.h +++ b/companion/src/helpers.h @@ -87,7 +87,7 @@ void populateFuncCB(QComboBox *b, unsigned int value); void populateRepeatCB(QComboBox *b, unsigned int value); void populateGVmodeCB(QComboBox *b, unsigned int value); QString FuncParam(uint function, int value, QString paramT="",unsigned int adjustmode=0); -void populateFuncParamCB(QComboBox *b, uint function, unsigned int value, unsigned int adjustmode=0); +void populateFuncParamCB(QComboBox *b, const ModelData & model, uint function, unsigned int value, unsigned int adjustmode=0); void populateFuncParamArmTCB(QComboBox *b, ModelData * g_model, char * value, QStringList & paramsList); void populatePhasesCB(QComboBox *b, int value); void populateTrimUseCB(QComboBox *b, unsigned int phase); @@ -98,19 +98,20 @@ QString getCustomSwitchStr(CustomSwData * customSw, const ModelData & model); QString getProtocolStr(const int proto); QString getPhasesStr(unsigned int phases, ModelData & model); -#define POPULATE_SOURCES 1 -#define POPULATE_TRIMS 2 -#define POPULATE_SWITCHES 4 -#define POPULATE_GVARS 8 -#define POPULATE_TELEMETRY 16 -#define POPULATE_TELEMETRYEXT 32 +#define POPULATE_SOURCES 1 +#define POPULATE_TRIMS 2 +#define POPULATE_SWITCHES 4 +#define POPULATE_GVARS 8 +#define POPULATE_TELEMETRY 16 +#define POPULATE_TELEMETRYEXT 32 +#define POPULATE_VIRTUAL_INPUTS 64 #define GVARS_VARIANT 0x0001 #define FRSKY_VARIANT 0x0002 // void populateGVarCB(QComboBox *b, int value, int min, int max,int pgvars=5); //TODO: Clean Up void populateGVCB(QComboBox *b, int value); -void populateSourceCB(QComboBox *b, const RawSource &source, unsigned int flags); +void populateSourceCB(QComboBox *b, const RawSource &source, const ModelData & model, unsigned int flags); void populateCSWCB(QComboBox *b, int value); QString getTimerMode(int tm); QString getTimerModeB(int tm); diff --git a/companion/src/mainwindow.cpp b/companion/src/mainwindow.cpp index 653e86433..b26829384 100644 --- a/companion/src/mainwindow.cpp +++ b/companion/src/mainwindow.cpp @@ -1537,7 +1537,7 @@ void MainWindow::about() QString aboutStr = "

"; aboutStr.append(tr("OpenTX Home Page: %1").arg("http://www.open-tx.org")); aboutStr.append("

"); - aboutStr.append(tr("The OpenTX Companion project was originally forked from companion9x and eePe").arg("http://code.google.com/p/companion9x").arg("http://code.google.com/p/eepe")); + aboutStr.append(tr("The OpenTX Companion project was originally forked from eePe").arg("http://code.google.com/p/eepe")); aboutStr.append("

"); aboutStr.append(tr("If you've found this program useful, please support by donating").arg(DONATE_STR)); aboutStr.append("

"); diff --git a/companion/src/modeledit/customfunctions.cpp b/companion/src/modeledit/customfunctions.cpp index 3c0c3a1f7..e6b1908bf 100644 --- a/companion/src/modeledit/customfunctions.cpp +++ b/companion/src/modeledit/customfunctions.cpp @@ -110,7 +110,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model, fswtchParamT[i] = new QComboBox(this); fswtchParamT[i]->setProperty("index", i); paramLayout->addWidget(fswtchParamT[i]); - populateFuncParamCB(fswtchParamT[i], func, model.funcSw[i].param, model.funcSw[i].adjustMode); + populateFuncParamCB(fswtchParamT[i], model, func, model.funcSw[i].param, model.funcSw[i].adjustMode); connect(fswtchParamT[i], SIGNAL(currentIndexChanged(int)), this, SLOT(customFunctionEdited())); fswtchParamArmT[i] = new QComboBox(this); @@ -295,20 +295,24 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified) fswtchParam[i]->setMaximum(125); fswtchParam[i]->setValue(model.funcSw[i].param); widgetsMask |= CUSTOM_FUNCTION_NUMERIC_PARAM; - } else { + } + else { if (modified) model.funcSw[i].param = fswtchParamT[i]->itemData(fswtchParamT[i]->currentIndex()).toInt(); - populateFuncParamCB(fswtchParamT[i], index, model.funcSw[i].param, model.funcSw[i].adjustMode); + populateFuncParamCB(fswtchParamT[i], model, index, model.funcSw[i].param, model.funcSw[i].adjustMode); widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM; } - } else if (index==FuncReset) { + } + else if (index==FuncReset) { if (modified) model.funcSw[i].param = (uint8_t)fswtchParamT[i]->currentIndex(); - populateFuncParamCB(fswtchParamT[i], index, model.funcSw[i].param); + populateFuncParamCB(fswtchParamT[i], model, index, model.funcSw[i].param); widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM; - } else if (index==FuncVolume) { + } + else if (index==FuncVolume) { if (modified) model.funcSw[i].param = fswtchParamT[i]->itemData(fswtchParamT[i]->currentIndex()).toInt(); - populateFuncParamCB(fswtchParamT[i], index, model.funcSw[i].param); + populateFuncParamCB(fswtchParamT[i], model, index, model.funcSw[i].param); widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM + CUSTOM_FUNCTION_ENABLE; - } else if (index==FuncPlaySound || index==FuncPlayHaptic || index==FuncPlayValue || index==FuncPlayPrompt || index==FuncPlayBoth || index==FuncBackgroundMusic) { + } + else if (index==FuncPlaySound || index==FuncPlayHaptic || index==FuncPlayValue || index==FuncPlayPrompt || index==FuncPlayBoth || index==FuncBackgroundMusic) { if (modified) model.funcSw[i].repeatParam = fswtchRepeat[i]->itemData(fswtchRepeat[i]->currentIndex()).toInt(); if (index != FuncBackgroundMusic) { if (GetEepromInterface()->getCapability(HasFuncRepeat)) { @@ -317,7 +321,7 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified) } if (index==FuncPlayValue) { if (modified) model.funcSw[i].param = fswtchParamT[i]->itemData(fswtchParamT[i]->currentIndex()).toInt(); - populateFuncParamCB(fswtchParamT[i], index, model.funcSw[i].param); + populateFuncParamCB(fswtchParamT[i], model, index, model.funcSw[i].param); widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM + CUSTOM_FUNCTION_REPEAT; } else if (index==FuncPlayPrompt || index==FuncPlayBoth) { if (GetEepromInterface()->getCapability(VoicesAsNumbers)) { @@ -374,16 +378,19 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified) } } } - } else if (index==FuncPlaySound) { + } + else if (index==FuncPlaySound) { if (modified) model.funcSw[i].param = (uint8_t)fswtchParamT[i]->currentIndex(); - populateFuncParamCB(fswtchParamT[i], index, model.funcSw[i].param); - widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM; - } else if (index==FuncPlayHaptic) { - if (modified) model.funcSw[i].param = (uint8_t)fswtchParamT[i]->currentIndex(); - populateFuncParamCB(fswtchParamT[i], index, model.funcSw[i].param); + populateFuncParamCB(fswtchParamT[i], model, index, model.funcSw[i].param); widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM; } - } else if (model.funcSw[i].swtch.type!=SWITCH_TYPE_NONE) { + else if (index==FuncPlayHaptic) { + if (modified) model.funcSw[i].param = (uint8_t)fswtchParamT[i]->currentIndex(); + populateFuncParamCB(fswtchParamT[i], model, index, model.funcSw[i].param); + widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM; + } + } + else if (model.funcSw[i].swtch.type!=SWITCH_TYPE_NONE) { if (modified) model.funcSw[i].param = fswtchParam[i]->value(); fswtchParam[i]->setDecimals(0); fswtchParam[i]->setSingleStep(1); diff --git a/companion/src/modeledit/customswitches.cpp b/companion/src/modeledit/customswitches.cpp index e666764cf..008f5cfe8 100644 --- a/companion/src/modeledit/customswitches.cpp +++ b/companion/src/modeledit/customswitches.cpp @@ -254,7 +254,7 @@ void CustomSwitchesPanel::setSwitchWidgetVisibility(int i) cswitchSource2[i]->setVisible(false); cswitchValue[i]->setVisible(false); cswitchOffset[i]->setVisible(true); - populateSourceCB(cswitchSource1[i], source, POPULATE_SOURCES | POPULATE_TRIMS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (GetEepromInterface()->getCapability(GvarsInCS) ? POPULATE_GVARS : 0)); + populateSourceCB(cswitchSource1[i], source, model, POPULATE_SOURCES | POPULATE_VIRTUAL_INPUTS | POPULATE_TRIMS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (GetEepromInterface()->getCapability(GvarsInCS) ? POPULATE_GVARS : 0)); cswitchOffset[i]->setDecimals(source.getDecimals(model)); cswitchOffset[i]->setSingleStep(source.getStep(model)); if (model.customSw[i].func>CS_FN_ELESS && model.customSw[i].funcsetVisible(true); cswitchValue[i]->setVisible(false); cswitchOffset[i]->setVisible(false); - populateSourceCB(cswitchSource1[i], RawSource(model.customSw[i].val1), POPULATE_SOURCES | POPULATE_TRIMS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (GetEepromInterface()->getCapability(GvarsInCS) ? POPULATE_GVARS : 0)); - populateSourceCB(cswitchSource2[i], RawSource(model.customSw[i].val2), POPULATE_SOURCES | POPULATE_TRIMS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (GetEepromInterface()->getCapability(GvarsInCS) ? POPULATE_GVARS : 0)); + populateSourceCB(cswitchSource1[i], RawSource(model.customSw[i].val1), model, POPULATE_SOURCES | POPULATE_VIRTUAL_INPUTS | POPULATE_TRIMS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (GetEepromInterface()->getCapability(GvarsInCS) ? POPULATE_GVARS : 0)); + populateSourceCB(cswitchSource2[i], RawSource(model.customSw[i].val2), model, POPULATE_SOURCES | POPULATE_TRIMS | POPULATE_VIRTUAL_INPUTS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (GetEepromInterface()->getCapability(GvarsInCS) ? POPULATE_GVARS : 0)); break; case CS_FAMILY_TIMERS: cswitchSource1[i]->setVisible(false); diff --git a/companion/src/modeledit/expodialog.cpp b/companion/src/modeledit/expodialog.cpp index 2dc60593b..00387720a 100644 --- a/companion/src/modeledit/expodialog.cpp +++ b/companion/src/modeledit/expodialog.cpp @@ -48,7 +48,7 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, i ui->sideLabel->hide(); ui->sideCB->hide(); ui->inputName->setMaxLength(4); - populateSourceCB(ui->sourceCB, ed->srcRaw, POPULATE_SOURCES | POPULATE_SWITCHES | POPULATE_TRIMS | (GetEepromInterface()->getCapability(GvarsAsSources) ? POPULATE_GVARS : 0)); + populateSourceCB(ui->sourceCB, ed->srcRaw, model, POPULATE_SOURCES | POPULATE_SWITCHES | POPULATE_TRIMS | (GetEepromInterface()->getCapability(GvarsAsSources) ? POPULATE_GVARS : 0)); ui->sourceCB->removeItem(0); } else { diff --git a/companion/src/modeledit/heli.cpp b/companion/src/modeledit/heli.cpp index 6c584658a..a6a97a1b9 100644 --- a/companion/src/modeledit/heli.cpp +++ b/companion/src/modeledit/heli.cpp @@ -26,7 +26,7 @@ void HeliPanel::update() lock = true; ui->swashTypeCB->setCurrentIndex(model.swashRingData.type); - populateSourceCB(ui->swashCollectiveCB, model.swashRingData.collectiveSource, POPULATE_SOURCES | POPULATE_SWITCHES | POPULATE_TRIMS); + populateSourceCB(ui->swashCollectiveCB, model.swashRingData.collectiveSource, model, POPULATE_SOURCES | POPULATE_SWITCHES | POPULATE_TRIMS); ui->swashRingValSB->setValue(model.swashRingData.value); ui->swashInvertELE->setChecked(model.swashRingData.invertELE); ui->swashInvertAIL->setChecked(model.swashRingData.invertAIL); diff --git a/companion/src/modeledit/mixerdialog.cpp b/companion/src/modeledit/mixerdialog.cpp index 5b34c7406..85a9c4a90 100644 --- a/companion/src/modeledit/mixerdialog.cpp +++ b/companion/src/modeledit/mixerdialog.cpp @@ -3,9 +3,10 @@ #include "eeprominterface.h" #include "helpers.h" -MixerDialog::MixerDialog(QWidget *parent, MixData *mixdata, int stickMode) : +MixerDialog::MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, int stickMode) : QDialog(parent), ui(new Ui::MixerDialog), + model(model), md(mixdata), lock(false) { @@ -19,7 +20,7 @@ MixerDialog::MixerDialog(QWidget *parent, MixData *mixdata, int stickMode) : else this->setWindowTitle(tr("DEST -> CH%1%2").arg(md->destCh/10).arg(md->destCh%10)); - populateSourceCB(ui->sourceCB, md->srcRaw, POPULATE_SOURCES | POPULATE_SWITCHES | POPULATE_TRIMS | (GetEepromInterface()->getCapability(GvarsAsSources) ? POPULATE_GVARS : 0)); + populateSourceCB(ui->sourceCB, md->srcRaw, model, POPULATE_SOURCES | POPULATE_VIRTUAL_INPUTS | POPULATE_SWITCHES | POPULATE_TRIMS | (GetEepromInterface()->getCapability(GvarsAsSources) ? POPULATE_GVARS : 0)); ui->sourceCB->removeItem(0); int limit = GetEepromInterface()->getCapability(OffsetWeight); @@ -145,16 +146,18 @@ void MixerDialog::valuesChanged() if (!lock) { lock = true; QCheckBox * cb_fp[] = {ui->cb_FP0,ui->cb_FP1,ui->cb_FP2,ui->cb_FP3,ui->cb_FP4,ui->cb_FP5,ui->cb_FP6,ui->cb_FP7,ui->cb_FP8 }; - md->srcRaw = RawSource(ui->sourceCB->itemData(ui->sourceCB->currentIndex()).toInt()); + md->srcRaw = RawSource(ui->sourceCB->itemData(ui->sourceCB->currentIndex()).toInt(), &model); if ((ui->sourceCB->itemData(ui->sourceCB->currentIndex()).toInt()-65536)<4) { if (!GetEepromInterface()->getCapability(MixesWithoutExpo)) { ui->MixDR_CB->hide(); ui->label_MixDR->hide(); - } else { + } + else { ui->MixDR_CB->setVisible(true); ui->label_MixDR->setVisible(true); } - } else { + } + else { ui->MixDR_CB->setHidden(true); ui->label_MixDR->setHidden(true); } diff --git a/companion/src/modeledit/mixerdialog.h b/companion/src/modeledit/mixerdialog.h index df2046e0f..437d9ca21 100644 --- a/companion/src/modeledit/mixerdialog.h +++ b/companion/src/modeledit/mixerdialog.h @@ -14,7 +14,7 @@ namespace Ui { class MixerDialog : public QDialog { Q_OBJECT public: - MixerDialog(QWidget *parent, MixData *mixdata, int stickMode); + MixerDialog(QWidget *parent, ModelData & model, MixData *mixdata, int stickMode); ~MixerDialog(); protected: @@ -26,6 +26,7 @@ class MixerDialog : public QDialog { private: Ui::MixerDialog *ui; + ModelData & model; MixData *md; bool lock; GVarGroup * gvWeightGroup; diff --git a/companion/src/modeledit/mixes.cpp b/companion/src/modeledit/mixes.cpp index 7edb50351..5e1fb7769 100644 --- a/companion/src/modeledit/mixes.cpp +++ b/companion/src/modeledit/mixes.cpp @@ -204,7 +204,7 @@ void MixesPanel::gm_openMix(int index) emit modified(); update(); - MixerDialog *g = new MixerDialog(this, &mixd, generalSettings.stickMode); + MixerDialog *g = new MixerDialog(this, model, &mixd, generalSettings.stickMode); if(g->exec()) { model.mixData[index] = mixd; emit modified();