From 3ba532cb19650861014183a5ad00079c127b87e2 Mon Sep 17 00:00:00 2001 From: bsongis Date: Sat, 24 May 2014 09:02:44 +0200 Subject: [PATCH] Fixes #1135 --- companion/src/helpers.cpp | 42 -------------------- companion/src/helpers.h | 1 - companion/src/modeledit/logicalswitches.cpp | 44 +++++++++++++++++++++ companion/src/modeledit/logicalswitches.h | 1 + 4 files changed, 45 insertions(+), 43 deletions(-) diff --git a/companion/src/helpers.cpp b/companion/src/helpers.cpp index 9c41d703e..48fd7a1bc 100644 --- a/companion/src/helpers.cpp +++ b/companion/src/helpers.cpp @@ -669,48 +669,6 @@ void populateSourceCB(QComboBox *b, const RawSource & source, const ModelData & b->setMaxVisibleItems(10); } -void populateCSWCB(QComboBox *b, int value) -{ - int order[] = { - LS_FN_OFF, - LS_FN_VEQUAL, // added at the end to avoid everything renumbered - LS_FN_VALMOSTEQUAL, // added at the end to avoid everything renumbered - LS_FN_VPOS, - LS_FN_VNEG, - // LS_FN_RANGE, - LS_FN_APOS, - LS_FN_ANEG, - LS_FN_AND, - LS_FN_OR, - LS_FN_XOR, - LS_FN_STAY, - LS_FN_EQUAL, - LS_FN_NEQUAL, - LS_FN_GREATER, - LS_FN_LESS, - LS_FN_EGREATER, - LS_FN_ELESS, - LS_FN_DPOS, - LS_FN_DAPOS, - LS_FN_TIMER, - LS_FN_STICKY - }; - - b->clear(); - for (int i=0; igetBoard())) { - if (func == LS_FN_VEQUAL || func == LS_FN_STAY) - continue; - } - b->addItem(LogicalSwitchData(func).funcToString(), func); - if (value == func) { - b->setCurrentIndex(b->count()-1); - } - } - b->setMaxVisibleItems(10); -} - QString image2qstring(QImage image) { if (image.isNull()) diff --git a/companion/src/helpers.h b/companion/src/helpers.h index d7233744f..a41a281c3 100644 --- a/companion/src/helpers.h +++ b/companion/src/helpers.h @@ -106,7 +106,6 @@ QString getPhasesStr(unsigned int phases, ModelData & model); // 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, const ModelData & model, unsigned int flags); -void populateCSWCB(QComboBox *b, int value); QString getPhaseName(int val, const char * phasename=NULL); QString getInputStr(ModelData & model, int index); QString image2qstring(QImage image); diff --git a/companion/src/modeledit/logicalswitches.cpp b/companion/src/modeledit/logicalswitches.cpp index 49d988946..ddbf381b5 100644 --- a/companion/src/modeledit/logicalswitches.cpp +++ b/companion/src/modeledit/logicalswitches.cpp @@ -323,6 +323,50 @@ void LogicalSwitchesPanel::setSwitchWidgetVisibility(int i) lock = false; } +void LogicalSwitchesPanel::populateCSWCB(QComboBox *b, int value) +{ + int order[] = { + LS_FN_OFF, + LS_FN_VEQUAL, // added at the end to avoid everything renumbered + LS_FN_VALMOSTEQUAL, // added at the end to avoid everything renumbered + LS_FN_VPOS, + LS_FN_VNEG, + // LS_FN_RANGE, + LS_FN_APOS, + LS_FN_ANEG, + LS_FN_AND, + LS_FN_OR, + LS_FN_XOR, + LS_FN_STAY, + LS_FN_EQUAL, + LS_FN_NEQUAL, + LS_FN_GREATER, + LS_FN_LESS, + LS_FN_EGREATER, + LS_FN_ELESS, + LS_FN_DPOS, + LS_FN_DAPOS, + LS_FN_TIMER, + LS_FN_STICKY + }; + + b->clear(); + for (int i=0; igetBoard())) { + if (func == LS_FN_VEQUAL || func == LS_FN_STAY) + continue; + } + b->addItem(LogicalSwitchData(func).funcToString(), func); + if (value == func) { + b->setCurrentIndex(b->count()-1); + } + } + b->setMaxVisibleItems(10); +} + void LogicalSwitchesPanel::updateLine(int i) { lock = true; diff --git a/companion/src/modeledit/logicalswitches.h b/companion/src/modeledit/logicalswitches.h index 0741e087a..3108711df 100644 --- a/companion/src/modeledit/logicalswitches.h +++ b/companion/src/modeledit/logicalswitches.h @@ -41,6 +41,7 @@ class LogicalSwitchesPanel : public ModelPanel void setSwitchWidgetVisibility(int i); int selectedSwitch; + void populateCSWCB(QComboBox *b, int value); void updateLine(int index); void updateTimerParam(QDoubleSpinBox *sb, int timer, bool allowZero=false);