diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 61cf8d6c0..9c877629d 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -312,6 +312,7 @@ int CChannelList::doChannelMenu(void) static int old_selected = 0; char cnt[5]; bool enabled = true; + bool unlocked = true; if(g_settings.minimode) return 0; @@ -328,14 +329,21 @@ int CChannelList::doChannelMenu(void) menu->enableSaveScreen(true); CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select); + /* Allow bouquet manipulation only if the bouquet is unlocked. Without this, + * a channel could be added/removed to/from an unlocked bouquet and so made + * accessible. */ + if (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_CHANGETOLOCKED && + chanlist[selected]->bAlwaysLocked != g_settings.parentallock_defaultlocked) + unlocked = (chanlist[selected]->last_unlocked_time + 3600 > time_monotonic()); + snprintf(cnt, sizeof(cnt), "%d", i); - menu->addItem(new CMenuForwarder(LOCALE_BOUQUETEDITOR_DELETE, enabled, NULL, selector, cnt, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED), old_selected == i++); + menu->addItem(new CMenuForwarder(LOCALE_BOUQUETEDITOR_DELETE, enabled && unlocked, NULL, selector, cnt, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED), old_selected == i++); snprintf(cnt, sizeof(cnt), "%d", i); - menu->addItem(new CMenuForwarder(LOCALE_BOUQUETEDITOR_MOVE, enabled, NULL, selector, cnt, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN), old_selected == i++); + menu->addItem(new CMenuForwarder(LOCALE_BOUQUETEDITOR_MOVE, enabled && unlocked, NULL, selector, cnt, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN), old_selected == i++); snprintf(cnt, sizeof(cnt), "%d", i); - menu->addItem(new CMenuForwarder(LOCALE_EXTRA_ADD_TO_BOUQUET, true, NULL, selector, cnt, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW), old_selected == i++); + menu->addItem(new CMenuForwarder(LOCALE_EXTRA_ADD_TO_BOUQUET, unlocked, NULL, selector, cnt, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW), old_selected == i++); snprintf(cnt, sizeof(cnt), "%d", i); - menu->addItem(new CMenuForwarder(LOCALE_FAVORITES_MENUEADD, true, NULL, selector, cnt, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE), old_selected == i++); + menu->addItem(new CMenuForwarder(LOCALE_FAVORITES_MENUEADD, unlocked, NULL, selector, cnt, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE), old_selected == i++); snprintf(cnt, sizeof(cnt), "%d", i); bool reset_enabled = chanlist[selected]->flags & CZapitChannel::NEW; menu->addItem(new CMenuForwarder(LOCALE_CHANNELLIST_RESET_FLAGS, reset_enabled, NULL, selector, cnt, CRCInput::convertDigitToKey(shortcut++)), old_selected == i++);