[Companion] Fix Special/Global Functions action selector being reset for all lines when one line is deleted/cut/pasted (closes #4825).

This commit is contained in:
Max Paperno
2017-04-23 21:10:17 -04:00
parent 591522c25a
commit f9b7f567c3
+2 -4
View File
@@ -599,9 +599,8 @@ void CustomFunctionsPanel::fswPaste()
CustomFunctionData *fsw = &functions[selectedFunction];
memcpy(fsw, fswData.constData(), sizeof(CustomFunctionData));
lock = true;
fswtchSwtch[selectedFunction]->setModel(rawSwitchItemModel);
fswtchSwtch[selectedFunction]->setCurrentIndex(fswtchSwtch[selectedFunction]->findData(functions[selectedFunction].swtch.toValue()));
populateFuncCB(fswtchFunc[selectedFunction], functions[selectedFunction].func);
fswtchFunc[selectedFunction]->setCurrentIndex(fswtchFunc[selectedFunction]->findData(functions[selectedFunction].func));
populateGVmodeCB(fswtchGVmode[selectedFunction], functions[selectedFunction].adjustMode);
populateFuncParamCB(fswtchParamT[selectedFunction], functions[selectedFunction].func, functions[selectedFunction].param, functions[selectedFunction].adjustMode);
refreshCustomFunction(selectedFunction);
@@ -615,9 +614,8 @@ void CustomFunctionsPanel::fswDelete()
functions[selectedFunction].clear();
// TODO update switch and func
lock = true;
fswtchSwtch[selectedFunction]->setModel(rawSwitchItemModel);
fswtchSwtch[selectedFunction]->setCurrentIndex(fswtchSwtch[selectedFunction]->findData(functions[selectedFunction].swtch.toValue()));
populateFuncCB(fswtchFunc[selectedFunction], functions[selectedFunction].func);
fswtchFunc[selectedFunction]->setCurrentIndex(fswtchFunc[selectedFunction]->findData(functions[selectedFunction].func));
refreshCustomFunction(selectedFunction);
lock = false;
emit modified();