mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 08:21:07 +02:00
Fixes for delete/move menu entry from different channel lists; Change list mode, if current list dont have channel, for ex. zap from history or with pzapit
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@415 e54a6e83-5905-42d5-8d5c-058d10e6a962
Origin commit data
------------------
Branch: ni/coolstream
Commit: eabc0f1644
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2010-02-25 (Thu, 25 Feb 2010)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -79,8 +79,10 @@ CBouquetList::~CBouquetList()
|
||||
|
||||
CBouquet* CBouquetList::addBouquet(CZapitBouquet * zapitBouquet)
|
||||
{
|
||||
CBouquet* tmp = addBouquet(zapitBouquet->Name.c_str(), -1, zapitBouquet->bLocked);
|
||||
int BouquetKey= Bouquets.size();//FIXME not used ?
|
||||
CBouquet* tmp = new CBouquet(BouquetKey, zapitBouquet->bFav ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) : zapitBouquet->Name.c_str(), zapitBouquet->bLocked);
|
||||
tmp->zapitBouquet = zapitBouquet;
|
||||
Bouquets.push_back(tmp);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
@@ -89,7 +91,7 @@ CBouquet* CBouquetList::addBouquet(const char * const pname, int BouquetKey, boo
|
||||
if ( BouquetKey==-1 )
|
||||
BouquetKey= Bouquets.size();
|
||||
|
||||
CBouquet* tmp = new CBouquet( BouquetKey, pname, locked );
|
||||
CBouquet* tmp = new CBouquet( BouquetKey, pname, locked, true);
|
||||
Bouquets.push_back(tmp);
|
||||
return(tmp);
|
||||
}
|
||||
@@ -123,7 +125,17 @@ void CBouquetList::adjustToChannel( int nChannelNr)
|
||||
}
|
||||
}
|
||||
|
||||
void CBouquetList::adjustToChannelID(t_channel_id channel_id)
|
||||
bool CBouquetList::hasChannelID(t_channel_id channel_id)
|
||||
{
|
||||
for (uint32_t i = 0; i < Bouquets.size(); i++) {
|
||||
int nChannelPos = Bouquets[i]->channelList->hasChannelID(channel_id);
|
||||
if (nChannelPos > -1)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CBouquetList::adjustToChannelID(t_channel_id channel_id)
|
||||
{
|
||||
printf("CBouquetList::adjustToChannelID [%s] to %llx, selected %d size %d\n", name.c_str(), channel_id, selected, Bouquets.size());
|
||||
if(selected < Bouquets.size()) {
|
||||
@@ -131,7 +143,7 @@ printf("CBouquetList::adjustToChannelID [%s] to %llx, selected %d size %d\n", na
|
||||
if(nChannelPos > -1) {
|
||||
printf("CBouquetList::adjustToChannelID [%s] to %llx -> not needed\n", name.c_str(), channel_id);
|
||||
Bouquets[selected]->channelList->setSelected(nChannelPos);
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
printf("CBouquetList::adjustToChannelID [%s] to %llx\n", name.c_str(), channel_id);
|
||||
@@ -142,9 +154,10 @@ printf("CBouquetList::adjustToChannelID [%s] to %llx\n", name.c_str(), channel_i
|
||||
if (nChannelPos > -1) {
|
||||
selected = i;
|
||||
Bouquets[i]->channelList->setSelected(nChannelPos);
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/* used in channellist to switch bouquets up/down */
|
||||
int CBouquetList::showChannelList( int nBouquet)
|
||||
|
@@ -59,12 +59,12 @@ class CBouquet
|
||||
CChannelList* channelList;
|
||||
CZapitBouquet * zapitBouquet;
|
||||
|
||||
CBouquet(const int Unique_key, const char * const Name, const bool locked)
|
||||
CBouquet(const int Unique_key, const char * const Name, const bool locked, bool vlist = false)
|
||||
{
|
||||
zapitBouquet = NULL;
|
||||
unique_key = Unique_key;
|
||||
bLocked = locked;
|
||||
channelList = new CChannelList(Name);
|
||||
channelList = new CChannelList(Name, false, vlist);
|
||||
}
|
||||
|
||||
~CBouquet()
|
||||
@@ -115,8 +115,9 @@ class CBouquetList
|
||||
int show(bool bShowChannelList = true);
|
||||
int showChannelList(int nBouquet = -1);
|
||||
void adjustToChannel(int nChannelNr);
|
||||
void adjustToChannelID(t_channel_id channel_id);
|
||||
bool adjustToChannelID(t_channel_id channel_id);
|
||||
int exec( bool bShowChannelList);
|
||||
bool hasChannelID(t_channel_id channel_id);
|
||||
};
|
||||
|
||||
|
||||
|
@@ -312,15 +312,16 @@ int CChannelList::doChannelMenu(void)
|
||||
t_channel_id channel_id;
|
||||
bool enabled = true;
|
||||
|
||||
if(old_b_id >= (int) bouquetList->Bouquets.size() || !bouquetList->Bouquets[old_b_id]->zapitBouquet) {
|
||||
if(!bouquetList || g_settings.minimode)
|
||||
return 0;
|
||||
|
||||
if(vlist)
|
||||
{
|
||||
enabled = false;
|
||||
if(old_selected < 2)//FIXME take care if some items added before 0, 1
|
||||
old_selected = 2;
|
||||
}
|
||||
|
||||
if(!bouquetList || g_settings.minimode)
|
||||
return 0;
|
||||
|
||||
CMenuWidget* menu = new CMenuWidget(LOCALE_CHANNELLIST_EDIT, NEUTRINO_ICON_SETTINGS);
|
||||
CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select);
|
||||
|
||||
@@ -417,12 +418,6 @@ int CChannelList::exec()
|
||||
displayNext = 0; // always start with current events
|
||||
int nNewChannel = show();
|
||||
if ( nNewChannel > -1) {
|
||||
#if 0
|
||||
if(this != CNeutrinoApp::getInstance ()->channelList)
|
||||
CNeutrinoApp::getInstance ()->channelList->adjustToChannelID(chanlist[nNewChannel]->channel_id, false);
|
||||
zapTo(nNewChannel);
|
||||
#endif
|
||||
//channelList->zapTo(bouquetList->Bouquets[bouquetList->getActiveBouquetNumber()]->channelList->getKey(nNewChannel)-1);
|
||||
CNeutrinoApp::getInstance ()->channelList->zapTo(getKey(nNewChannel)-1);
|
||||
}
|
||||
|
||||
@@ -843,7 +838,7 @@ bool CChannelList::adjustToChannelID(const t_channel_id channel_id, bool bToo)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
printf("CChannelList::adjustToChannelID me %x list size %d channel_id %llx\n", (int) this, chanlist.size(), channel_id);fflush(stdout);
|
||||
printf("CChannelList::adjustToChannelID me %x [%s] list size %d channel_id %llx\n", (int) this, getName(), chanlist.size(), channel_id);fflush(stdout);
|
||||
for (i = 0; i < chanlist.size(); i++) {
|
||||
if(chanlist[i] == NULL) {
|
||||
printf("CChannelList::adjustToChannelID REPORT BUG !! ******************************** %d is NULL !!\n", i);
|
||||
@@ -855,18 +850,35 @@ printf("CChannelList::adjustToChannelID me %x list size %d channel_id %llx\n", (
|
||||
|
||||
tuned = i;
|
||||
if (bToo && (bouquetList != NULL)) {
|
||||
int old_mode = g_settings.channel_mode;
|
||||
int new_mode = old_mode;
|
||||
bool has_channel;
|
||||
if(CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_tv) {
|
||||
TVbouquetList->adjustToChannelID(channel_id);
|
||||
TVsatList->adjustToChannelID(channel_id);
|
||||
TVfavList->adjustToChannelID(channel_id);
|
||||
TVallList->adjustToChannelID(channel_id);
|
||||
has_channel = TVfavList->adjustToChannelID(channel_id);
|
||||
if(!has_channel && old_mode == LIST_MODE_FAV)
|
||||
new_mode = LIST_MODE_PROV;
|
||||
has_channel = TVbouquetList->adjustToChannelID(channel_id);
|
||||
if(!has_channel && old_mode == LIST_MODE_PROV)
|
||||
new_mode = LIST_MODE_SAT;
|
||||
has_channel = TVsatList->adjustToChannelID(channel_id);
|
||||
if(!has_channel && old_mode == LIST_MODE_SAT)
|
||||
new_mode = LIST_MODE_ALL;
|
||||
has_channel = TVallList->adjustToChannelID(channel_id);
|
||||
}
|
||||
else if(CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_radio) {
|
||||
RADIObouquetList->adjustToChannelID(channel_id);
|
||||
RADIOsatList->adjustToChannelID(channel_id);
|
||||
RADIOfavList->adjustToChannelID(channel_id);
|
||||
RADIOallList->adjustToChannelID(channel_id);
|
||||
has_channel = RADIOfavList->adjustToChannelID(channel_id);
|
||||
if(!has_channel && old_mode == LIST_MODE_FAV)
|
||||
new_mode = LIST_MODE_PROV;
|
||||
has_channel = RADIObouquetList->adjustToChannelID(channel_id);
|
||||
if(!has_channel && old_mode == LIST_MODE_PROV)
|
||||
new_mode = LIST_MODE_SAT;
|
||||
has_channel = RADIOsatList->adjustToChannelID(channel_id);
|
||||
if(!has_channel && old_mode == LIST_MODE_SAT)
|
||||
new_mode = LIST_MODE_ALL;
|
||||
has_channel = RADIOallList->adjustToChannelID(channel_id);
|
||||
}
|
||||
if(old_mode != new_mode)
|
||||
CNeutrinoApp::getInstance()->SetChannelMode(new_mode);
|
||||
}
|
||||
//printf("CChannelList::adjustToChannelID me %x to %llx bToo %s OK: %d\n", (int) this, channel_id, bToo ? "yes" : "no", i);fflush(stdout);
|
||||
return true;
|
||||
@@ -945,23 +957,7 @@ printf("**************************** CChannelList::zapTo me %x %s tuned %d new %
|
||||
//g_RCInput->postMsg( NeutrinoMessages::SHOW_INFOBAR, 0 );
|
||||
|
||||
if (bouquetList != NULL) {
|
||||
//bouquetList->adjustToChannel( getActiveChannelNumber());
|
||||
//bouquetList->adjustToChannelID(chan->channel_id);
|
||||
#if 0
|
||||
if(CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_tv) {
|
||||
TVbouquetList->adjustToChannelID(chan->channel_id);
|
||||
TVsatList->adjustToChannelID(chan->channel_id);
|
||||
TVfavList->adjustToChannelID(chan->channel_id);
|
||||
TVallList->adjustToChannelID(chan->channel_id);
|
||||
}
|
||||
else if(CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_radio) {
|
||||
RADIObouquetList->adjustToChannelID(chan->channel_id);
|
||||
RADIOsatList->adjustToChannelID(chan->channel_id);
|
||||
RADIOfavList->adjustToChannelID(chan->channel_id);
|
||||
RADIOallList->adjustToChannelID(chan->channel_id);
|
||||
}
|
||||
#endif
|
||||
CNeutrinoApp::getInstance()->channelList->adjustToChannelID(chan->channel_id);
|
||||
CNeutrinoApp::getInstance()->channelList->adjustToChannelID(chan->channel_id);
|
||||
}
|
||||
g_RCInput->postMsg( NeutrinoMessages::SHOW_INFOBAR, 0 );
|
||||
}
|
||||
@@ -1659,20 +1655,6 @@ struct button_label CChannelListButtons[NUM_LIST_BUTTONS] =
|
||||
{ NEUTRINO_ICON_BUTTON_RED, LOCALE_INFOVIEWER_EVENTLIST},
|
||||
{ NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_INFOVIEWER_NEXT},
|
||||
{ NEUTRINO_ICON_BUTTON_BLUE, LOCALE_BOUQUETLIST_HEAD}
|
||||
#if 0
|
||||
{ NEUTRINO_ICON_BUTTON_GREEN, LOCALE_BOUQUETEDITOR_DELETE},
|
||||
{ NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_BOUQUETEDITOR_MOVE},
|
||||
{ NEUTRINO_ICON_BUTTON_BLUE, LOCALE_EXTRA_ADD_TO_BOUQUET}
|
||||
#endif
|
||||
};
|
||||
|
||||
#define NUM_VLIST_BUTTONS 3
|
||||
const struct button_label CChannelVListButtons[NUM_VLIST_BUTTONS] =
|
||||
{
|
||||
{ NEUTRINO_ICON_BUTTON_RED, LOCALE_INFOVIEWER_EVENTLIST},
|
||||
{ NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_INFOVIEWER_NEXT},
|
||||
{ NEUTRINO_ICON_BUTTON_BLUE, LOCALE_BOUQUETLIST_HEAD}
|
||||
//{ NEUTRINO_ICON_BUTTON_BLUE, LOCALE_EXTRA_ADD_TO_BOUQUET}
|
||||
};
|
||||
|
||||
void CChannelList::paintHead()
|
||||
@@ -1692,7 +1674,7 @@ void CChannelList::paintHead()
|
||||
|
||||
frameBuffer->paintBoxRel(x, y + (height - buttonHeight), width, buttonHeight - 1, COL_MENUHEAD_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); //round
|
||||
::paintButtons(frameBuffer, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL], g_Locale, x + 10, y + (height - buttonHeight) + 3, ButtonWidth,
|
||||
vlist ? NUM_VLIST_BUTTONS : NUM_LIST_BUTTONS, vlist ? CChannelVListButtons : CChannelListButtons);
|
||||
NUM_LIST_BUTTONS, CChannelListButtons);
|
||||
|
||||
frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_HELP, x+ width- 30, y+ 5 );
|
||||
if (bouquetList != NULL)
|
||||
|
@@ -64,7 +64,6 @@ class CChannelList
|
||||
int buttonHeight;
|
||||
|
||||
std::string name;
|
||||
//std::vector<CChannel*> chanlist;
|
||||
std::vector<CZapitChannel*> chanlist;
|
||||
CZapProtection* zapProtection;
|
||||
|
||||
@@ -89,10 +88,10 @@ class CChannelList
|
||||
public:
|
||||
CChannelList(const char * const Name, bool historyMode = false, bool _vlist = false );
|
||||
~CChannelList();
|
||||
//void addChannel(int key, int number, const std::string& name, const t_satellite_position satellitePosition, t_channel_id ids = 0); // UTF-8
|
||||
|
||||
void addChannel(CZapitChannel* chan, int num = 0);
|
||||
void putChannel(CZapitChannel* chan);
|
||||
//void addChannel(CZapitChannel* channel, int key, int number, bool locked = false);
|
||||
|
||||
CZapitChannel* getChannel(int number);
|
||||
CZapitChannel* getChannel(t_channel_id channel_id);
|
||||
CZapitChannel* getChannelFromIndex( uint32_t index) { if (chanlist.size() > index) return chanlist[index]; else return NULL;};
|
||||
@@ -105,8 +104,6 @@ class CChannelList
|
||||
int getActiveChannelNumber (void) const;
|
||||
t_channel_id getActiveChannel_ChannelID(void) const;
|
||||
|
||||
/* CChannel * getChannelFromChannelID(const t_channel_id channel_id); */
|
||||
|
||||
void zapTo(int pos, bool forceStoreToLastChannels = false);
|
||||
void virtual_zap_mode(bool up);
|
||||
bool zapTo_ChannelID(const t_channel_id channel_id);
|
||||
|
@@ -1680,8 +1680,8 @@ void CNeutrinoApp::channelsInit(bool /*bOnly*/)
|
||||
if(TVchannelList) delete TVchannelList;
|
||||
if(RADIOchannelList) delete RADIOchannelList;
|
||||
|
||||
TVchannelList = new CChannelList(g_Locale->getText(LOCALE_CHANNELLIST_HEAD));
|
||||
RADIOchannelList = new CChannelList(g_Locale->getText(LOCALE_CHANNELLIST_HEAD));
|
||||
TVchannelList = new CChannelList(g_Locale->getText(LOCALE_CHANNELLIST_HEAD), false, true);
|
||||
RADIOchannelList = new CChannelList(g_Locale->getText(LOCALE_CHANNELLIST_HEAD), false, true);
|
||||
|
||||
TVbouquetList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_PROVS));
|
||||
TVbouquetList->orgChannelList = TVchannelList;
|
||||
@@ -1700,10 +1700,9 @@ void CNeutrinoApp::channelsInit(bool /*bOnly*/)
|
||||
uint32_t i;
|
||||
i = 1;
|
||||
|
||||
//CBouquet* tmp = TVfavList->addBouquet("HD");//FIXME locale
|
||||
CBouquet* hdBouquet;
|
||||
if(g_settings.make_hd_list)
|
||||
hdBouquet = new CBouquet(0, (char *) "HD", 0);
|
||||
hdBouquet = new CBouquet(0, (char *) "HD", false);
|
||||
|
||||
int tvi = 0, ri = 0, hi = 0;
|
||||
for (tallchans_iterator it = allchans.begin(); it != allchans.end(); it++) {
|
||||
@@ -1733,13 +1732,15 @@ void CNeutrinoApp::channelsInit(bool /*bOnly*/)
|
||||
|
||||
TVallList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_HEAD));
|
||||
tmp = TVallList->addBouquet(g_Locale->getText(LOCALE_CHANNELLIST_HEAD));
|
||||
*(tmp->channelList) = *TVchannelList;
|
||||
//*(tmp->channelList) = *TVchannelList;
|
||||
tmp->channelList = new CChannelList(*TVchannelList);
|
||||
tmp->channelList->SortAlpha();
|
||||
TVallList->orgChannelList = TVchannelList;
|
||||
|
||||
RADIOallList = new CBouquetList(g_Locale->getText(LOCALE_CHANNELLIST_HEAD));
|
||||
tmp = RADIOallList->addBouquet(g_Locale->getText(LOCALE_CHANNELLIST_HEAD));
|
||||
*(tmp->channelList) = *RADIOchannelList;
|
||||
//*(tmp->channelList) = *RADIOchannelList;
|
||||
tmp->channelList = new CChannelList(*RADIOchannelList);
|
||||
tmp->channelList->SortAlpha();
|
||||
RADIOallList->orgChannelList = RADIOchannelList;
|
||||
|
||||
@@ -1779,16 +1780,15 @@ void CNeutrinoApp::channelsInit(bool /*bOnly*/)
|
||||
//if (!g_bouquetManager->Bouquets[i]->bHidden && (g_bouquetManager->Bouquets[i]->bUser || !g_bouquetManager->Bouquets[i]->tvChannels.empty() ))
|
||||
if (!g_bouquetManager->Bouquets[i]->bHidden && !g_bouquetManager->Bouquets[i]->tvChannels.empty())
|
||||
{
|
||||
CBouquet* _tmp;
|
||||
if(g_bouquetManager->Bouquets[i]->bUser)
|
||||
_tmp = TVfavList->addBouquet(g_bouquetManager->Bouquets[i]);
|
||||
tmp = TVfavList->addBouquet(g_bouquetManager->Bouquets[i]);
|
||||
else
|
||||
_tmp = TVbouquetList->addBouquet(g_bouquetManager->Bouquets[i]);
|
||||
tmp = TVbouquetList->addBouquet(g_bouquetManager->Bouquets[i]);
|
||||
|
||||
ZapitChannelList* channels = &(g_bouquetManager->Bouquets[i]->tvChannels);
|
||||
_tmp->channelList->setSize(channels->size());
|
||||
tmp->channelList->setSize(channels->size());
|
||||
for(int j = 0; j < (int) channels->size(); j++) {
|
||||
_tmp->channelList->addChannel((*channels)[j]);
|
||||
tmp->channelList->addChannel((*channels)[j]);
|
||||
}
|
||||
bnum++;
|
||||
}
|
||||
@@ -1803,16 +1803,15 @@ void CNeutrinoApp::channelsInit(bool /*bOnly*/)
|
||||
//if (!g_bouquetManager->Bouquets[i]->bHidden && (g_bouquetManager->Bouquets[i]->bUser || !g_bouquetManager->Bouquets[i]->radioChannels.empty() ))
|
||||
if (!g_bouquetManager->Bouquets[i]->bHidden && !g_bouquetManager->Bouquets[i]->radioChannels.empty() )
|
||||
{
|
||||
CBouquet* _tmp;
|
||||
if(g_bouquetManager->Bouquets[i]->bUser)
|
||||
_tmp = RADIOfavList->addBouquet(g_bouquetManager->Bouquets[i]->Name.c_str(), i, g_bouquetManager->Bouquets[i]->bLocked);
|
||||
tmp = RADIOfavList->addBouquet(g_bouquetManager->Bouquets[i]);
|
||||
else
|
||||
_tmp = RADIObouquetList->addBouquet(g_bouquetManager->Bouquets[i]->Name.c_str(), i, g_bouquetManager->Bouquets[i]->bLocked);
|
||||
tmp = RADIObouquetList->addBouquet(g_bouquetManager->Bouquets[i]);
|
||||
|
||||
ZapitChannelList* channels = &(g_bouquetManager->Bouquets[i]->radioChannels);
|
||||
_tmp->channelList->setSize(channels->size());
|
||||
tmp->channelList->setSize(channels->size());
|
||||
for(int j = 0; j < (int) channels->size(); j++) {
|
||||
_tmp->channelList->addChannel((*channels)[j]);
|
||||
tmp->channelList->addChannel((*channels)[j]);
|
||||
}
|
||||
bnum++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user