1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed handling channels in the 'Channels' menu in case there are ':@nnn' group separators without names

This commit is contained in:
Klaus Schmidinger 2002-12-22 12:49:10 +01:00
parent da98c3de72
commit de1366fc7e
3 changed files with 26 additions and 10 deletions

View File

@ -494,6 +494,8 @@ Andreas Kool <akool@akool.de>
Guy Roussin <guy.roussin@teledetection.fr>
for suggesting not to display channel group delimiters without text
for reporting a bug in handling channels in the "Channels" menu in case there are
':@nnn' group separators without names
Georg Hitsch <georg@hitsch.at>
for his help in keeping 'channels.conf' up to date

View File

@ -1907,3 +1907,5 @@ Video Disk Recorder Revision History
When reading the 'epg.data' file VDR only interprets the channel IDs, everyting
else is optional and has no meaning to VDR.
- Fixed the 'channels.conf' entries for "Studio Universal" and "Disney Channel".
- Fixed handling channels in the "Channels" menu in case there are ':@nnn' group
separators without names (thanks to Guy Roussin for reporting this one).

26
menu.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: menu.c 1.228 2002/12/01 10:31:55 kls Exp $
* $Id: menu.c 1.229 2002/12/22 12:40:43 kls Exp $
*/
#include "menu.h"
@ -645,6 +645,7 @@ private:
public:
cMenuChannelItem(cChannel *Channel);
virtual void Set(void);
cChannel *Channel(void) { return channel; }
};
cMenuChannelItem::cMenuChannelItem(cChannel *Channel)
@ -669,6 +670,7 @@ void cMenuChannelItem::Set(void)
class cMenuChannels : public cOsdMenu {
private:
cChannel *GetChannel(int Index);
void Propagate(void);
protected:
eOSState Switch(void);
@ -691,6 +693,12 @@ cMenuChannels::cMenuChannels(void)
SetHelp(tr("Edit"), tr("New"), tr("Delete"), tr("Mark"));
}
cChannel *cMenuChannels::GetChannel(int Index)
{
cMenuChannelItem *p = (cMenuChannelItem *)Get(Index);
return p ? (cChannel *)p->Channel() : NULL;
}
void cMenuChannels::Propagate(void)
{
Channels.ReNumber();
@ -703,7 +711,7 @@ void cMenuChannels::Propagate(void)
eOSState cMenuChannels::Switch(void)
{
cChannel *ch = Channels.Get(Current());
cChannel *ch = GetChannel(Current());
if (ch)
cDevice::PrimaryDevice()->SwitchChannel(ch, true);
return osEnd;
@ -713,7 +721,7 @@ eOSState cMenuChannels::Edit(void)
{
if (HasSubMenu() || Count() == 0)
return osContinue;
cChannel *ch = Channels.Get(Current());
cChannel *ch = GetChannel(Current());
if (ch)
return AddSubMenu(new cMenuEditChannel(ch));
return osContinue;
@ -730,7 +738,7 @@ eOSState cMenuChannels::Delete(void)
{
if (Count() > 0) {
int Index = Current();
cChannel *channel = Channels.Get(Index);
cChannel *channel = GetChannel(Current());
int DeletedChannel = channel->Number();
// Check if there is a timer using this channel:
for (cTimer *ti = Timers.First(); ti; ti = Timers.Next(ti)) {
@ -751,12 +759,16 @@ eOSState cMenuChannels::Delete(void)
void cMenuChannels::Move(int From, int To)
{
int FromNumber = Channels.Get(From)->Number();
int ToNumber = Channels.Get(To)->Number();
Channels.Move(From, To);
cChannel *FromChannel = GetChannel(From);
cChannel *ToChannel = GetChannel(To);
if (FromChannel && ToChannel) {
int FromNumber = FromChannel->Number();
int ToNumber = ToChannel->Number();
Channels.Move(FromChannel, ToChannel);
cOsdMenu::Move(From, To);
Propagate();
isyslog("channel %d moved to %d", FromNumber, ToNumber);
}
}
eOSState cMenuChannels::ProcessKey(eKeys Key)