diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 46ef39ce6..f77c7a533 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -125,15 +125,16 @@ void CBouquetList::adjustToChannel( int nChannelNr) void CBouquetList::adjustToChannelID(t_channel_id channel_id) { +printf("CBouquetList::adjustToChannelID [%s] to %llx, selected %d size %d\n", name.c_str(), channel_id, selected, Bouquets.size()); if(selected < Bouquets.size()) { int nChannelPos = Bouquets[selected]->channelList->hasChannelID(channel_id); if(nChannelPos > -1) { -printf("CBouquetList::adjustToChannelID to %llx -> not needed\n", channel_id); +printf("CBouquetList::adjustToChannelID [%s] to %llx -> not needed\n", name.c_str(), channel_id); Bouquets[selected]->channelList->setSelected(nChannelPos); return; } } -printf("CBouquetList::adjustToChannelID to %llx\n", channel_id); +printf("CBouquetList::adjustToChannelID [%s] to %llx\n", name.c_str(), channel_id); for (uint32_t i=0; i < Bouquets.size(); i++) { if(i == selected) continue; @@ -238,6 +239,7 @@ int CBouquetList::doMenu() break; } } + return -1; } else { menu->addItem(new CMenuForwarder(LOCALE_BOUQUETEDITOR_DELETE, true, NULL, selector, cnt, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE), old_selected == i ++); ret = menu->exec(NULL, ""); @@ -259,6 +261,7 @@ int CBouquetList::doMenu() break; } } + return -1; } return 0; } @@ -338,10 +341,10 @@ int CBouquetList::show(bool bShowChannelList) continue; //FIXME msgs not forwarded to neutrino !! else if ( msg == CRCInput::RC_setup) { int ret = doMenu(); - if(ret) { + if(ret > 0) { res = -4; loop = false; - } else + } else if(ret < 0) paint(); } else if ( msg == (neutrino_msg_t) g_settings.key_list_start ) { diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 70b1d58b9..33c4fb774 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -310,6 +310,13 @@ int CChannelList::doChannelMenu(void) int result; char cnt[5]; t_channel_id channel_id; + bool enabled = true; + + if(old_b_id >= (int) bouquetList->Bouquets.size() || !bouquetList->Bouquets[old_b_id]->zapitBouquet) { + enabled = false; + if(old_selected < 2)//FIXME take care if some items added before 0, 1 + old_selected = 2; + } if(!bouquetList || g_settings.minimode) return 0; @@ -318,9 +325,9 @@ int CChannelList::doChannelMenu(void) CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select); sprintf(cnt, "%d", i); - menu->addItem(new CMenuForwarder(LOCALE_BOUQUETEDITOR_DELETE, true, NULL, selector, cnt, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED), old_selected == i++); + menu->addItem(new CMenuForwarder(LOCALE_BOUQUETEDITOR_DELETE, enabled, NULL, selector, cnt, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED), old_selected == i++); sprintf(cnt, "%d", i); - menu->addItem(new CMenuForwarder(LOCALE_BOUQUETEDITOR_MOVE, true, NULL, selector, cnt, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN), old_selected == i++); + menu->addItem(new CMenuForwarder(LOCALE_BOUQUETEDITOR_MOVE, enabled, NULL, selector, cnt, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN), old_selected == i++); sprintf(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++); sprintf(cnt, "%d", i); @@ -351,7 +358,6 @@ int CChannelList::doChannelMenu(void) case 1: // move old_bouquet_id = bouquetList->getActiveBouquetNumber(); old_bouquet_id = g_bouquetManager->existsBouquet(bouquetList->Bouquets[old_bouquet_id]->channelList->getName()); - do { new_bouquet_id = bouquetList->exec(false); } while(new_bouquet_id == -3); @@ -882,7 +888,11 @@ int CChannelList::hasChannel(int nChannelNr) int CChannelList::hasChannelID(t_channel_id channel_id) { - for (uint32_t i=0;ichannel_id == channel_id) return i; } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 1d3c853cc..c1945f5f3 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3175,6 +3175,7 @@ _repeat: return messages_return::handled; } else if( msg == NeutrinoMessages::EVT_SERVICESCHANGED ) { +printf("NeutrinoMessages::EVT_SERVICESCHANGED\n");fflush(stdout); channelsInit(); channelList->adjustToChannelID(live_channel_id);//FIXME what if deleted ? if(old_b_id >= 0) { @@ -3184,6 +3185,7 @@ _repeat: } } else if( msg == NeutrinoMessages::EVT_BOUQUETSCHANGED ) { +printf("NeutrinoMessages::EVT_BOUQUETSCHANGED\n");fflush(stdout); channelsInit(); channelList->adjustToChannelID(live_channel_id);//FIXME what if deleted ? return messages_return::handled;