mirror of
https://github.com/rofafor/vdr-plugin-iptv.git
synced 2023-10-10 13:37:03 +02:00
Switch channel when OK is pressed in channel editor.
This commit is contained in:
parent
6e45224b00
commit
b8bde0422c
15
setup.c
15
setup.c
@ -3,7 +3,7 @@
|
||||
*
|
||||
* See the README file for copyright information and how to reach the author.
|
||||
*
|
||||
* $Id: setup.c,v 1.11 2007/09/28 16:44:59 rahrenbe Exp $
|
||||
* $Id: setup.c,v 1.12 2007/09/29 12:33:48 ajhseppa Exp $
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
@ -285,6 +285,7 @@ protected:
|
||||
eOSState Edit(void);
|
||||
eOSState New(void);
|
||||
eOSState Delete(void);
|
||||
eOSState Switch(void);
|
||||
|
||||
public:
|
||||
cIptvMenuChannels();
|
||||
@ -332,6 +333,16 @@ void cIptvMenuChannels::Propagate(void)
|
||||
Channels.SetModified(true);
|
||||
}
|
||||
|
||||
eOSState cIptvMenuChannels::Switch(void)
|
||||
{
|
||||
if (HasSubMenu() || Count() == 0)
|
||||
return osContinue;
|
||||
cChannel *ch = GetChannel(Current());
|
||||
if (ch)
|
||||
return cDevice::PrimaryDevice()->SwitchChannel(ch, true) ? osEnd : osContinue;
|
||||
return osEnd;
|
||||
}
|
||||
|
||||
eOSState cIptvMenuChannels::Edit(void)
|
||||
{
|
||||
if (HasSubMenu() || Count() == 0)
|
||||
@ -401,7 +412,7 @@ eOSState cIptvMenuChannels::ProcessKey(eKeys Key)
|
||||
default:
|
||||
if (state == osUnknown) {
|
||||
switch (Key) {
|
||||
case kOk:
|
||||
case kOk: return Switch();
|
||||
case kRed: return Edit();
|
||||
case kGreen: return New();
|
||||
case kYellow: return Delete();
|
||||
|
Loading…
Reference in New Issue
Block a user