mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 08:21:07 +02:00
gui/channellist.cpp: add channels reinit, if target bouquet was empty (hidden),
or empty after edit (to hide)
Origin commit data
------------------
Branch: ni/coolstream
Commit: 2878b34141
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2014-10-11 (Sat, 11 Oct 2014)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -342,6 +342,7 @@ int CChannelList::doChannelMenu(void)
|
|||||||
t_channel_id channel_id = empty ? 0 : (*chanlist)[selected]->channel_id;
|
t_channel_id channel_id = empty ? 0 : (*chanlist)[selected]->channel_id;
|
||||||
bool tvmode = CZapit::getInstance()->getMode() & CZapitClient::MODE_TV;
|
bool tvmode = CZapit::getInstance()->getMode() & CZapitClient::MODE_TV;
|
||||||
CBouquetList *blist = tvmode ? TVfavList : RADIOfavList;
|
CBouquetList *blist = tvmode ? TVfavList : RADIOfavList;
|
||||||
|
bool fav_found = true;
|
||||||
switch(select) {
|
switch(select) {
|
||||||
case 0: // edit mode
|
case 0: // edit mode
|
||||||
editMode(true);
|
editMode(true);
|
||||||
@@ -351,36 +352,53 @@ int CChannelList::doChannelMenu(void)
|
|||||||
bouquet_id = AllFavBouquetList->exec(false);
|
bouquet_id = AllFavBouquetList->exec(false);
|
||||||
hide();
|
hide();
|
||||||
if(bouquet_id < 0)
|
if(bouquet_id < 0)
|
||||||
return 0;
|
return -1;
|
||||||
|
|
||||||
if (AllFavBouquetList->Bouquets[bouquet_id]->zapitBouquet) {
|
if (AllFavBouquetList->Bouquets[bouquet_id]->zapitBouquet) {
|
||||||
CZapitBouquet *zapitBouquet = AllFavBouquetList->Bouquets[bouquet_id]->zapitBouquet;
|
CZapitBouquet *zapitBouquet = AllFavBouquetList->Bouquets[bouquet_id]->zapitBouquet;
|
||||||
CZapitChannel *ch = zapitBouquet->getChannelByChannelID(channel_id);
|
CZapitChannel *ch = zapitBouquet->getChannelByChannelID(channel_id);
|
||||||
if (ch == NULL) {
|
if (ch == NULL) {
|
||||||
|
fav_found = false;
|
||||||
zapitBouquet->addService((*chanlist)[selected]);
|
zapitBouquet->addService((*chanlist)[selected]);
|
||||||
for (unsigned n = 0; n < blist->Bouquets.size(); n++) {
|
for (unsigned n = 0; n < blist->Bouquets.size(); n++) {
|
||||||
if (blist->Bouquets[n]->zapitBouquet == zapitBouquet) {
|
if (blist->Bouquets[n]->zapitBouquet == zapitBouquet) {
|
||||||
zapitBouquet->getChannels(blist->Bouquets[n]->channelList->channels, tvmode);
|
zapitBouquet->getChannels(blist->Bouquets[n]->channelList->channels, tvmode);
|
||||||
saveChanges();
|
saveChanges();
|
||||||
|
fav_found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!fav_found) {
|
||||||
|
CNeutrinoApp::getInstance()->MarkFavoritesChanged();
|
||||||
|
CNeutrinoApp::getInstance()->MarkChannelsInit();
|
||||||
|
}
|
||||||
ret = 1;
|
ret = 1;
|
||||||
break;
|
break;
|
||||||
case 2: // add to my favorites
|
case 2: // add to my favorites
|
||||||
for (unsigned n = 0; n < blist->Bouquets.size(); n++) {
|
for (unsigned n = 0; n < AllFavBouquetList->Bouquets.size(); n++) {
|
||||||
if (blist->Bouquets[n]->zapitBouquet && blist->Bouquets[n]->zapitBouquet->bFav) {
|
if (AllFavBouquetList->Bouquets[n]->zapitBouquet && AllFavBouquetList->Bouquets[n]->zapitBouquet->bFav) {
|
||||||
CZapitChannel *ch = blist->Bouquets[n]->zapitBouquet->getChannelByChannelID(channel_id);
|
CZapitChannel *ch = AllFavBouquetList->Bouquets[n]->zapitBouquet->getChannelByChannelID(channel_id);
|
||||||
if (ch == NULL) {
|
if (ch == NULL) {
|
||||||
blist->Bouquets[n]->zapitBouquet->addService((*chanlist)[selected]);
|
AllFavBouquetList->Bouquets[n]->zapitBouquet->addService((*chanlist)[selected]);
|
||||||
blist->Bouquets[n]->zapitBouquet->getChannels(blist->Bouquets[n]->channelList->channels, tvmode);
|
fav_found = false;
|
||||||
saveChanges();
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (unsigned n = 0; n < blist->Bouquets.size() && !fav_found; n++) {
|
||||||
|
if (blist->Bouquets[n]->zapitBouquet && blist->Bouquets[n]->zapitBouquet->bFav) {
|
||||||
|
blist->Bouquets[n]->zapitBouquet->getChannels(blist->Bouquets[n]->channelList->channels, tvmode);
|
||||||
|
saveChanges();
|
||||||
|
fav_found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!fav_found) {
|
||||||
|
CNeutrinoApp::getInstance()->MarkFavoritesChanged();
|
||||||
|
CNeutrinoApp::getInstance()->MarkChannelsInit();
|
||||||
|
}
|
||||||
ret = 1;
|
ret = 1;
|
||||||
break;
|
break;
|
||||||
case 3: // reset new
|
case 3: // reset new
|
||||||
@@ -2317,6 +2335,8 @@ void CChannelList::editMode(bool enable)
|
|||||||
channelsChanged = false;
|
channelsChanged = false;
|
||||||
bouquet->zapitBouquet->getChannels(channels, tvmode);
|
bouquet->zapitBouquet->getChannels(channels, tvmode);
|
||||||
saveChanges();
|
saveChanges();
|
||||||
|
if ((*chanlist).empty())
|
||||||
|
CNeutrinoApp::getInstance()->MarkChannelsInit();
|
||||||
}
|
}
|
||||||
if (selected >= chanlist->size())
|
if (selected >= chanlist->size())
|
||||||
selected = chanlist->empty() ? 0 : (chanlist->size() - 1);
|
selected = chanlist->empty() ? 0 : (chanlist->size() - 1);
|
||||||
|
Reference in New Issue
Block a user