From c3238ee38c6c4a5a5db1159912772c336e6ca579 Mon Sep 17 00:00:00 2001 From: 3djc Date: Sat, 10 Dec 2016 19:33:13 +0100 Subject: [PATCH] Port #4116 to Next (#4118) Fixes #4103: SF repeat parameter was not reset when changing function type --- companion/src/modeledit/customfunctions.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/companion/src/modeledit/customfunctions.cpp b/companion/src/modeledit/customfunctions.cpp index 71222dc93..6a2e71a01 100644 --- a/companion/src/modeledit/customfunctions.cpp +++ b/companion/src/modeledit/customfunctions.cpp @@ -67,7 +67,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData * model, mediaPlayerCurrent(-1), mediaPlayer(NULL) { - Stopwatch s1("CustomFunctionsPanel - populate"); + Stopwatch s1("CustomFunctionsPanel - populate"); lock = true; int num_fsw = model ? firmware->getCapability(CustomFunctions) : firmware->getCapability(GlobalFunctions); @@ -337,8 +337,11 @@ void CustomFunctionsPanel::functionEdited() if (!lock) { lock = true; int index = sender()->property("index").toInt(); - fswtchParamArmT[index]->setCurrentIndex(0); - refreshCustomFunction(index, true); + RawSwitch swtch = functions[index].swtch; + functions[index].clear(); + functions[index].swtch = swtch; + functions[index].func = (AssignFunc)fswtchFunc[index]->itemData(fswtchFunc[index]->currentIndex()).toInt(); + refreshCustomFunction(index); emit modified(); lock = false; }