zapit/src/bouquets.cpp: decrease channel lock count in deleteBouquet();

add setBouquetLock() with change channel lock count


Origin commit data
------------------
Branch: ni/coolstream
Commit: 27cd2846f2
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2014-10-13 (Mon, 13 Oct 2014)



------------------
This commit was generated by Migit
This commit is contained in:
[CST] Focus
2014-10-13 12:28:17 +04:00
parent 5554be03d0
commit 71c2b90815
4 changed files with 35 additions and 23 deletions

View File

@@ -430,16 +430,6 @@ 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])->bLockCount--;
channels = &(*Bouquets)[selected]->radioChannels;
for(unsigned int i = 0; i < channels->size(); i++)
((*channels)[i])->bLockCount--;
}
g_bouquetManager->deleteBouquet(selected);
Bouquets = &g_bouquetManager->Bouquets;
if (selected >= Bouquets->size())
@@ -528,18 +518,8 @@ void CBEBouquetWidget::switchHideBouquet()
void CBEBouquetWidget::switchLockBouquet()
{
bouquetsChanged = true;
(*Bouquets)[selected]->bLocked = !(*Bouquets)[selected]->bLocked;
g_bouquetManager->setBouquetLock((*Bouquets)[selected], !(*Bouquets)[selected]->bLocked);
paint();
int add = (*Bouquets)[selected]->bLocked * 2 - 1;
ZapitChannelList *channels = &(*Bouquets)[selected]->tvChannels;
for(unsigned int i = 0; i < channels->size(); i++)
((*channels)[i])->bLockCount += add;
channels = &(*Bouquets)[selected]->radioChannels;
for(unsigned int i = 0; i < channels->size(); i++)
((*channels)[i])->bLockCount += add;
}
std::string CBEBouquetWidget::inputName(const char * const defaultName, const neutrino_locale_t caption)