zapit/bouquets: count locked bouquets a channels is in, and honor lock in all bouquets

Origin commit data
------------------
Branch: ni/coolstream
Commit: abe03ad749
Author: martii <m4rtii@gmx.de>
Date: 2014-05-25 (Sun, 25 May 2014)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
martii
2014-05-25 15:22:31 +02:00
committed by Jacek Jendrzej
parent 104bcad13a
commit ce7cb28d85
6 changed files with 30 additions and 7 deletions

View File

@@ -430,6 +430,16 @@ void CBEBouquetWidget::deleteBouquet()
if (ShowMsg(LOCALE_FILEBROWSER_DELETE, (*Bouquets)[selected]->bFav ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) : (*Bouquets)[selected]->Name, CMessageBox::mbrNo, CMessageBox::mbYes|CMessageBox::mbNo)!=CMessageBox::mbrYes)
return;
if ((*Bouquets)[selected]->bLocked) {
ZapitChannelList *channels = &(*Bouquets)[selected]->tvChannels;
for(unsigned int i = 0; i < channels->size(); i++)
((*channels)[i])->bAlwaysLocked--;
channels = &(*Bouquets)[selected]->radioChannels;
for(unsigned int i = 0; i < channels->size(); i++)
((*channels)[i])->bAlwaysLocked--;
}
g_bouquetManager->deleteBouquet(selected);
Bouquets = &g_bouquetManager->Bouquets;
if (selected >= Bouquets->size())
@@ -520,6 +530,16 @@ void CBEBouquetWidget::switchLockBouquet()
bouquetsChanged = true;
(*Bouquets)[selected]->bLocked = !(*Bouquets)[selected]->bLocked;
paint();
int add = (*Bouquets)[selected]->bLocked ? +1 : -1;
ZapitChannelList *channels = &(*Bouquets)[selected]->tvChannels;
for(unsigned int i = 0; i < channels->size(); i++)
((*channels)[i])->bAlwaysLocked += add;
channels = &(*Bouquets)[selected]->radioChannels;
for(unsigned int i = 0; i < channels->size(); i++)
((*channels)[i])->bAlwaysLocked += add;
}
std::string CBEBouquetWidget::inputName(const char * const defaultName, const neutrino_locale_t caption)

View File

@@ -352,7 +352,7 @@ int CChannelList::doChannelMenu(void)
* a channel could be added/removed to/from an unlocked bouquet and so made
* accessible. */
if (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_CHANGETOLOCKED &&
chanlist[selected]->bAlwaysLocked != g_settings.parentallock_defaultlocked)
!!chanlist[selected]->bAlwaysLocked != g_settings.parentallock_defaultlocked)
unlocked = (chanlist[selected]->last_unlocked_time + 3600 > time_monotonic());
snprintf(cnt, sizeof(cnt), "%d", i);
@@ -1083,7 +1083,7 @@ int CChannelList::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data)
chanlist[selected]->last_unlocked_EPGid = g_RemoteControl->current_EPGid;
else
{
/* data >= 0x100: pre locked bouquet -> remember unlock time */
/* data >= 0x100: pre-locked bouquet -> remember unlock time */
chanlist[selected]->last_unlocked_time = time_monotonic();
int bnum = bouquetList->getActiveBouquetNumber();
if (bnum >= 0)
@@ -1298,7 +1298,7 @@ void CChannelList::zapToChannel(CZapitChannel *channel, bool force)
}
selected_chid = channel->getChannelID();
g_RemoteControl->zapTo_ChannelID(selected_chid, channel->getName(), (channel->bAlwaysLocked == g_settings.parentallock_defaultlocked));
g_RemoteControl->zapTo_ChannelID(selected_chid, channel->getName(), (!!channel->bAlwaysLocked == g_settings.parentallock_defaultlocked));
CNeutrinoApp::getInstance()->channelList->adjustToChannelID(channel->getChannelID());
}
if(new_zap_mode != 2 /* not active */) {