[color] Fix subType editing & set default channel start + range on change
Resolves #567
This commit is contained in:
committed by
Raphael Coeffic
parent
07d0a66368
commit
742336450e
@@ -810,12 +810,23 @@ class ModuleWindow : public FormGroup {
|
|||||||
|
|
||||||
// Module parameters
|
// Module parameters
|
||||||
if (isModuleXJT(moduleIdx)) {
|
if (isModuleXJT(moduleIdx)) {
|
||||||
auto xjtChoice = new Choice(
|
rfChoice = new Choice(
|
||||||
this, grid.getFieldSlot(2, 1), STR_XJT_ACCST_RF_PROTOCOLS,
|
this, grid.getFieldSlot(2, 1), STR_XJT_ACCST_RF_PROTOCOLS,
|
||||||
MODULE_SUBTYPE_PXX1_OFF, MODULE_SUBTYPE_PXX1_ACCST_LR12,
|
MODULE_SUBTYPE_PXX1_OFF, MODULE_SUBTYPE_PXX1_LAST,
|
||||||
GET_SET_DEFAULT(g_model.moduleData[moduleIdx].rfProtocol));
|
GET_DEFAULT(g_model.moduleData[moduleIdx].subType),
|
||||||
xjtChoice->setAvailableHandler(
|
[=](int32_t newValue) {
|
||||||
|
g_model.moduleData[moduleIdx].subType = newValue;
|
||||||
|
g_model.moduleData[moduleIdx].channelsStart = 0;
|
||||||
|
g_model.moduleData[moduleIdx].channelsCount =
|
||||||
|
defaultModuleChannels_M8(moduleIdx);
|
||||||
|
SET_DIRTY();
|
||||||
|
update();
|
||||||
|
rfChoice->setFocus(SET_FOCUS_DEFAULT);
|
||||||
|
});
|
||||||
|
|
||||||
|
rfChoice->setAvailableHandler(
|
||||||
[](int index) { return index != MODULE_SUBTYPE_PXX1_OFF; });
|
[](int index) { return index != MODULE_SUBTYPE_PXX1_OFF; });
|
||||||
|
|
||||||
} else if (isModuleDSM2(moduleIdx)) {
|
} else if (isModuleDSM2(moduleIdx)) {
|
||||||
new Choice(this, grid.getFieldSlot(2, 1), STR_DSM_PROTOCOLS,
|
new Choice(this, grid.getFieldSlot(2, 1), STR_DSM_PROTOCOLS,
|
||||||
DSM2_PROTO_LP45, DSM2_PROTO_DSMX,
|
DSM2_PROTO_LP45, DSM2_PROTO_DSMX,
|
||||||
|
|||||||
Reference in New Issue
Block a user