Truth is: nobody know how it work

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@409 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
focus
2010-02-24 20:56:56 +00:00
parent 99c889144c
commit dbbdfdfb64
3 changed files with 23 additions and 8 deletions

View File

@@ -125,15 +125,16 @@ void CBouquetList::adjustToChannel( int nChannelNr)
void CBouquetList::adjustToChannelID(t_channel_id channel_id) 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()) { if(selected < Bouquets.size()) {
int nChannelPos = Bouquets[selected]->channelList->hasChannelID(channel_id); int nChannelPos = Bouquets[selected]->channelList->hasChannelID(channel_id);
if(nChannelPos > -1) { 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); Bouquets[selected]->channelList->setSelected(nChannelPos);
return; 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++) { for (uint32_t i=0; i < Bouquets.size(); i++) {
if(i == selected) if(i == selected)
continue; continue;
@@ -238,6 +239,7 @@ int CBouquetList::doMenu()
break; break;
} }
} }
return -1;
} else { } else {
menu->addItem(new CMenuForwarder(LOCALE_BOUQUETEDITOR_DELETE, true, NULL, selector, cnt, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE), old_selected == i ++); 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, ""); ret = menu->exec(NULL, "");
@@ -259,6 +261,7 @@ int CBouquetList::doMenu()
break; break;
} }
} }
return -1;
} }
return 0; return 0;
} }
@@ -338,10 +341,10 @@ int CBouquetList::show(bool bShowChannelList)
continue; //FIXME msgs not forwarded to neutrino !! continue; //FIXME msgs not forwarded to neutrino !!
else if ( msg == CRCInput::RC_setup) { else if ( msg == CRCInput::RC_setup) {
int ret = doMenu(); int ret = doMenu();
if(ret) { if(ret > 0) {
res = -4; res = -4;
loop = false; loop = false;
} else } else if(ret < 0)
paint(); paint();
} }
else if ( msg == (neutrino_msg_t) g_settings.key_list_start ) { else if ( msg == (neutrino_msg_t) g_settings.key_list_start ) {

View File

@@ -310,6 +310,13 @@ int CChannelList::doChannelMenu(void)
int result; int result;
char cnt[5]; char cnt[5];
t_channel_id channel_id; 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) if(!bouquetList || g_settings.minimode)
return 0; return 0;
@@ -318,9 +325,9 @@ int CChannelList::doChannelMenu(void)
CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select); CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select);
sprintf(cnt, "%d", i); 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); 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); 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++); 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); sprintf(cnt, "%d", i);
@@ -351,7 +358,6 @@ int CChannelList::doChannelMenu(void)
case 1: // move case 1: // move
old_bouquet_id = bouquetList->getActiveBouquetNumber(); old_bouquet_id = bouquetList->getActiveBouquetNumber();
old_bouquet_id = g_bouquetManager->existsBouquet(bouquetList->Bouquets[old_bouquet_id]->channelList->getName()); old_bouquet_id = g_bouquetManager->existsBouquet(bouquetList->Bouquets[old_bouquet_id]->channelList->getName());
do { do {
new_bouquet_id = bouquetList->exec(false); new_bouquet_id = bouquetList->exec(false);
} while(new_bouquet_id == -3); } while(new_bouquet_id == -3);
@@ -882,7 +888,11 @@ int CChannelList::hasChannel(int nChannelNr)
int CChannelList::hasChannelID(t_channel_id channel_id) int CChannelList::hasChannelID(t_channel_id channel_id)
{ {
for (uint32_t i=0;i<chanlist.size();i++) { for (uint32_t i=0; i < chanlist.size();i++) {
if(chanlist[i] == NULL) {
printf("CChannelList::hasChannelID REPORT BUG !! ******************************** %d is NULL !!\n", i);
continue;
}
if (chanlist[i]->channel_id == channel_id) if (chanlist[i]->channel_id == channel_id)
return i; return i;
} }

View File

@@ -3175,6 +3175,7 @@ _repeat:
return messages_return::handled; return messages_return::handled;
} }
else if( msg == NeutrinoMessages::EVT_SERVICESCHANGED ) { else if( msg == NeutrinoMessages::EVT_SERVICESCHANGED ) {
printf("NeutrinoMessages::EVT_SERVICESCHANGED\n");fflush(stdout);
channelsInit(); channelsInit();
channelList->adjustToChannelID(live_channel_id);//FIXME what if deleted ? channelList->adjustToChannelID(live_channel_id);//FIXME what if deleted ?
if(old_b_id >= 0) { if(old_b_id >= 0) {
@@ -3184,6 +3185,7 @@ _repeat:
} }
} }
else if( msg == NeutrinoMessages::EVT_BOUQUETSCHANGED ) { else if( msg == NeutrinoMessages::EVT_BOUQUETSCHANGED ) {
printf("NeutrinoMessages::EVT_BOUQUETSCHANGED\n");fflush(stdout);
channelsInit(); channelsInit();
channelList->adjustToChannelID(live_channel_id);//FIXME what if deleted ? channelList->adjustToChannelID(live_channel_id);//FIXME what if deleted ?
return messages_return::handled; return messages_return::handled;