channellist: improve add-to-bouquet and remove-new-flag workflow

When adding the current channel to a bouquet or favorites or when
removing the "new" flag from a channel, don't immediately reload the
channels but wait for closing of the channellist.
Additionally, select the next channel after one of the add-to-bouquet or
remove-new-flag actions.
This commit is contained in:
Stefan Seyfried
2013-04-14 13:13:42 +02:00
committed by [CST] Focus
parent bb560fbf47
commit 9eda015afe

View File

@@ -425,7 +425,7 @@ int CChannelList::doChannelMenu(void)
return 0; return 0;
if(!g_bouquetManager->existsChannelInBouquet(bouquet_id, channel_id)) { if(!g_bouquetManager->existsChannelInBouquet(bouquet_id, channel_id)) {
CZapit::getInstance()->addChannelToBouquet(bouquet_id, channel_id); CZapit::getInstance()->addChannelToBouquet(bouquet_id, channel_id);
return 1; return 2;
} }
break; break;
case 3: // add to my favorites case 3: // add to my favorites
@@ -445,7 +445,7 @@ int CChannelList::doChannelMenu(void)
CServiceManager::getInstance()->SetServicesChanged(true); CServiceManager::getInstance()->SetServicesChanged(true);
/* if make_new_list == ON, signal to re-init services */ /* if make_new_list == ON, signal to re-init services */
if(g_settings.make_new_list) if(g_settings.make_new_list)
return 1; return 2;
break; break;
case 5: // settings case 5: // settings
{ {
@@ -607,6 +607,7 @@ int CChannelList::show()
uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]); uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]);
bool bouquet_changed = false;
bool loop=true; bool loop=true;
while (loop) { while (loop) {
g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd, true); g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd, true);
@@ -700,10 +701,16 @@ int CChannelList::show()
fader.Stop(); fader.Stop();
int ret = doChannelMenu(); int ret = doChannelMenu();
CNeutrinoApp::getInstance()->g_channel_list_changed = (ret != 0); CNeutrinoApp::getInstance()->g_channel_list_changed = (ret != 0);
if (ret) { if (ret == 1) {
res = -3 - ret; /* -5 == add to fav, -5 == all other change */ res = -3 - ret; /* -5 == add to fav or bouquet, -4 == all other change */
loop = false; loop = false;
} else { } else {
if (ret > 1) {
bouquet_changed = true;
/* select next entry */
if (selected + 1 < chanlist.size())
selected++;
}
old_b_id = -1; old_b_id = -1;
paintHead(); paintHead();
paint(); paint();
@@ -923,6 +930,9 @@ int CChannelList::show()
g_settings.channellist_new_zap_mode = new_zap_mode; g_settings.channellist_new_zap_mode = new_zap_mode;
new_zap_mode = 0; new_zap_mode = 0;
if (bouquet_changed)
res = -5; /* in neutrino.cpp: -5 == "don't change bouquet after adding a channel to fav" */
hide(); hide();
fader.Stop(); fader.Stop();