[Companion] Sensor switches support added

+ some refactoring to hide irrelevant switches in the combobox

More refactoring to come:
 - have only one SwitchModel per model instead of one per tab
 - only do the update work if something has changed
This commit is contained in:
Bertrand Songis
2017-07-30 12:12:27 +02:00
parent b814f997f8
commit b55070f939
18 changed files with 290 additions and 111 deletions
+2 -1
View File
@@ -20,6 +20,7 @@
#include "expodialog.h"
#include "ui_expodialog.h"
#include "switchitemmodel.h"
#include "helpers.h"
ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, GeneralSettings & generalSettings,
@@ -61,7 +62,7 @@ ExpoDialog::ExpoDialog(QWidget *parent, ModelData & model, ExpoData *expoData, G
curveGroup = new CurveGroup(ui->curveTypeCB, ui->curveGVarCB, ui->curveValueCB, ui->curveValueSB, ed->curve, model,
firmware->getCapability(HasInputDiff) ? 0 : (HIDE_DIFF | HIDE_NEGATIVE_CURVES));
ui->switchesCB->setModel(Helpers::getRawSwitchItemModel(&generalSettings, Helpers::MixesContext));
ui->switchesCB->setModel(new RawSwitchFilterItemModel(&generalSettings, &model, MixesContext));
ui->switchesCB->setCurrentIndex(ui->switchesCB->findData(ed->swtch.toValue()));
ui->sideCB->setCurrentIndex(ed->mode-1);