From d35835fe8f97f2dd8de7a1f2b12c0e343ddc096e Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 14 Apr 2013 13:13:42 +0200 Subject: [PATCH] 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. --- src/gui/channellist.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 2a0acfa4e..21549ef5f 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -421,7 +421,7 @@ int CChannelList::doChannelMenu(void) return 0; if(!g_bouquetManager->existsChannelInBouquet(bouquet_id, channel_id)) { CZapit::getInstance()->addChannelToBouquet(bouquet_id, channel_id); - return 1; + return 2; } break; case 3: // add to my favorites @@ -441,7 +441,7 @@ int CChannelList::doChannelMenu(void) CServiceManager::getInstance()->SetServicesChanged(true); /* if make_new_list == ON, signal to re-init services */ if(g_settings.make_new_list) - return 1; + return 2; break; case 5: // settings { @@ -604,6 +604,7 @@ int CChannelList::show() uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]); + bool bouquet_changed = false; bool loop=true; while (loop) { g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd, true); @@ -697,10 +698,16 @@ int CChannelList::show() fader.Stop(); int ret = doChannelMenu(); CNeutrinoApp::getInstance()->g_channel_list_changed = (ret != 0); - if (ret) { - res = -3 - ret; /* -5 == add to fav, -5 == all other change */ + if (ret == 1) { + res = -3 - ret; /* -5 == add to fav or bouquet, -4 == all other change */ loop = false; } else { + if (ret > 1) { + bouquet_changed = true; + /* select next entry */ + if (selected + 1 < chanlist.size()) + selected++; + } old_b_id = -1; paintHead(); paint(); @@ -906,6 +913,9 @@ int CChannelList::show() g_settings.channellist_new_zap_mode = new_zap_mode; new_zap_mode = 0; + if (bouquet_changed) + res = -5; /* in neutrino.cpp: -5 == "don't change bouquet after adding a channel to fav" */ + hide(); fader.Stop();