Issue #817 fixed

This commit is contained in:
bsongis
2014-03-20 11:42:04 +01:00
parent 50d8aeeddd
commit c26117971c
+7 -6
View File
@@ -4515,7 +4515,7 @@ void onLogicalSwitchesMenu(const char *result)
*cs = clipboard.data.csw; *cs = clipboard.data.csw;
eeDirty(EE_MODEL); eeDirty(EE_MODEL);
} }
else if (result == STR_DELETE) { else if (result == STR_CLEAR) {
memset(cs, 0, sizeof(LogicalSwitchData)); memset(cs, 0, sizeof(LogicalSwitchData));
eeDirty(EE_MODEL); eeDirty(EE_MODEL);
} }
@@ -4543,10 +4543,12 @@ void menuModelLogicalSwitches(uint8_t event)
if (sub>=0 && horz<0 && event==EVT_KEY_LONG(KEY_ENTER) && !READ_ONLY()) { if (sub>=0 && horz<0 && event==EVT_KEY_LONG(KEY_ENTER) && !READ_ONLY()) {
killEvents(event); killEvents(event);
LogicalSwitchData * cs = cswAddress(sub); LogicalSwitchData * cs = cswAddress(sub);
if (cs->func) MENU_ADD_ITEM(STR_COPY); if (cs->func)
MENU_ADD_ITEM(STR_COPY);
if (clipboard.type == CLIPBOARD_TYPE_CUSTOM_SWITCH) if (clipboard.type == CLIPBOARD_TYPE_CUSTOM_SWITCH)
MENU_ADD_ITEM(STR_PASTE); MENU_ADD_ITEM(STR_PASTE);
if (cs->func || cs->v1 || cs->v2 || cs->delay || cs->duration || cs->andsw) MENU_ADD_ITEM(STR_DELETE); if (cs->func || cs->v1 || cs->v2 || cs->delay || cs->duration || cs->andsw)
MENU_ADD_ITEM(STR_CLEAR);
menuHandler = onLogicalSwitchesMenu; menuHandler = onLogicalSwitchesMenu;
} }
#endif #endif
@@ -4874,10 +4876,9 @@ void menuModelCustomFunctions(uint8_t event)
MENU_ADD_ITEM(STR_PASTE); MENU_ADD_ITEM(STR_PASTE);
if (!CFN_EMPTY(sd) && CFN_EMPTY(&g_model.funcSw[NUM_CFN-1])) if (!CFN_EMPTY(sd) && CFN_EMPTY(&g_model.funcSw[NUM_CFN-1]))
MENU_ADD_ITEM(STR_INSERT); MENU_ADD_ITEM(STR_INSERT);
if (CFN_EMPTY(sd)) if (!CFN_EMPTY(sd))
MENU_ADD_ITEM(STR_DELETE);
else
MENU_ADD_ITEM(STR_CLEAR); MENU_ADD_ITEM(STR_CLEAR);
MENU_ADD_ITEM(STR_DELETE);
menuHandler = onCustomFunctionsMenu; menuHandler = onCustomFunctionsMenu;
} }
#endif #endif