mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Fixed deleting channels in case the current channel's number changes
This commit is contained in:
parent
39162a98f0
commit
e892171736
@ -446,6 +446,8 @@ Mirko D
|
|||||||
for suggesting to allow defining key macros for all non-modeless keys
|
for suggesting to allow defining key macros for all non-modeless keys
|
||||||
for reporting a bug in entering '0' in a cMenuEditIntItem
|
for reporting a bug in entering '0' in a cMenuEditIntItem
|
||||||
for reporting that moving channels sometimes stopped the current replay session
|
for reporting that moving channels sometimes stopped the current replay session
|
||||||
|
for reporting a problem with deleting channels in case the current channel's
|
||||||
|
number changes
|
||||||
|
|
||||||
Michael Rakowski <mrak@gmx.de>
|
Michael Rakowski <mrak@gmx.de>
|
||||||
for translating OSD texts to the Polish language
|
for translating OSD texts to the Polish language
|
||||||
|
2
HISTORY
2
HISTORY
@ -4743,3 +4743,5 @@ Video Disk Recorder Revision History
|
|||||||
- Improved the repeat function for LIRC remote controls (thanks to Joerg Riechardt).
|
- Improved the repeat function for LIRC remote controls (thanks to Joerg Riechardt).
|
||||||
- Fixed moving channels, which sometimes stopped the current replay session
|
- Fixed moving channels, which sometimes stopped the current replay session
|
||||||
(reported by Mirko Dölle).
|
(reported by Mirko Dölle).
|
||||||
|
- Fixed deleting channels in case the current channel's number changes (reported
|
||||||
|
by Mirko Dölle).
|
||||||
|
13
channels.c
13
channels.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: channels.c 1.51 2006/04/17 12:18:57 kls Exp $
|
* $Id: channels.c 1.52 2006/05/28 10:14:18 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "channels.h"
|
#include "channels.h"
|
||||||
@ -925,6 +925,17 @@ int cChannels::GetNextNormal(int Idx)
|
|||||||
return channel ? Idx : -1;
|
return channel ? Idx : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if APIVERSNUM != 10400
|
||||||
|
#warning ******* API version changed - activate new code
|
||||||
|
int cChannels::GetPrevNormal(int Idx)
|
||||||
|
{
|
||||||
|
cChannel *channel = Get(--Idx);
|
||||||
|
while (channel && channel->GroupSep())
|
||||||
|
channel = Get(--Idx);
|
||||||
|
return channel ? Idx : -1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void cChannels::ReNumber( void )
|
void cChannels::ReNumber( void )
|
||||||
{
|
{
|
||||||
channelsHashSid.Clear();
|
channelsHashSid.Clear();
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: channels.h 1.40 2006/02/28 13:52:49 kls Exp $
|
* $Id: channels.h 1.41 2006/05/28 10:13:21 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __CHANNELS_H
|
#ifndef __CHANNELS_H
|
||||||
@ -233,6 +233,10 @@ public:
|
|||||||
int GetNextGroup(int Idx); // Get next channel group
|
int GetNextGroup(int Idx); // Get next channel group
|
||||||
int GetPrevGroup(int Idx); // Get previous channel group
|
int GetPrevGroup(int Idx); // Get previous channel group
|
||||||
int GetNextNormal(int Idx); // Get next normal channel (not group)
|
int GetNextNormal(int Idx); // Get next normal channel (not group)
|
||||||
|
#if APIVERSNUM != 10400
|
||||||
|
#warning ******* API version changed - activate new code
|
||||||
|
int GetPrevNormal(int Idx); // Get previous normal channel (not group)
|
||||||
|
#endif
|
||||||
void ReNumber(void); // Recalculate 'number' based on channel type
|
void ReNumber(void); // Recalculate 'number' based on channel type
|
||||||
cChannel *GetByNumber(int Number, int SkipGap = 0);
|
cChannel *GetByNumber(int Number, int SkipGap = 0);
|
||||||
cChannel *GetByServiceID(int Source, int Transponder, unsigned short ServiceID);
|
cChannel *GetByServiceID(int Source, int Transponder, unsigned short ServiceID);
|
||||||
|
32
menu.c
32
menu.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: menu.c 1.437 2006/05/28 09:17:25 kls Exp $
|
* $Id: menu.c 1.438 2006/05/28 10:47:40 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "menu.h"
|
#include "menu.h"
|
||||||
@ -499,6 +499,8 @@ eOSState cMenuChannels::New(void)
|
|||||||
eOSState cMenuChannels::Delete(void)
|
eOSState cMenuChannels::Delete(void)
|
||||||
{
|
{
|
||||||
if (!HasSubMenu() && Count() > 0) {
|
if (!HasSubMenu() && Count() > 0) {
|
||||||
|
int CurrentChannelNr = cDevice::CurrentChannel();
|
||||||
|
cChannel *CurrentChannel = Channels.GetByNumber(CurrentChannelNr);
|
||||||
int Index = Current();
|
int Index = Current();
|
||||||
cChannel *channel = GetChannel(Current());
|
cChannel *channel = GetChannel(Current());
|
||||||
int DeletedChannel = channel->Number();
|
int DeletedChannel = channel->Number();
|
||||||
@ -508,10 +510,38 @@ eOSState cMenuChannels::Delete(void)
|
|||||||
return osContinue;
|
return osContinue;
|
||||||
}
|
}
|
||||||
if (Interface->Confirm(tr("Delete channel?"))) {
|
if (Interface->Confirm(tr("Delete channel?"))) {
|
||||||
|
if (CurrentChannel && channel == CurrentChannel) {
|
||||||
|
int n = Channels.GetNextNormal(CurrentChannel->Index());
|
||||||
|
#if APIVERSNUM == 10400
|
||||||
|
if (n < 0) {
|
||||||
|
int Idx = CurrentChannel->Index();
|
||||||
|
cChannel *channel = Channels.Get(--Idx);
|
||||||
|
while (channel && channel->GroupSep())
|
||||||
|
channel = Channels.Get(--Idx);
|
||||||
|
if (channel)
|
||||||
|
n = Idx;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
#warning ******* API version changed - remove old stuff
|
||||||
|
if (n < 0)
|
||||||
|
n = Channels.GetPrevNormal(CurrentChannel->Index());
|
||||||
|
#endif
|
||||||
|
CurrentChannel = Channels.Get(n);
|
||||||
|
CurrentChannelNr = 0; // triggers channel switch below
|
||||||
|
}
|
||||||
Channels.Del(channel);
|
Channels.Del(channel);
|
||||||
cOsdMenu::Del(Index);
|
cOsdMenu::Del(Index);
|
||||||
Propagate();
|
Propagate();
|
||||||
isyslog("channel %d deleted", DeletedChannel);
|
isyslog("channel %d deleted", DeletedChannel);
|
||||||
|
if (CurrentChannel && CurrentChannel->Number() != CurrentChannelNr) {
|
||||||
|
if (!cDevice::PrimaryDevice()->Replaying() || cDevice::PrimaryDevice()->Transferring())
|
||||||
|
Channels.SwitchTo(CurrentChannel->Number());
|
||||||
|
#if APIVERSNUM != 10400
|
||||||
|
#warning ******* API version changed - activate new code
|
||||||
|
else
|
||||||
|
cDevice::SetCurrentChannel(CurrentChannel);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return osContinue;
|
return osContinue;
|
||||||
|
Loading…
Reference in New Issue
Block a user