summaryrefslogtreecommitdiff
path: root/setup.cpp
diff options
context:
space:
mode:
authorJochen Dolze <vdr@dolze.de>2009-02-15 23:46:17 +0100
committerJochen Dolze <vdr@dolze.de>2009-02-15 23:46:17 +0100
commit87447b03d3227941174c6b0a413b0266d958f3c7 (patch)
treedd1d74b73938cb5bdb4b7b089e2ca5cfdc4f3f06 /setup.cpp
parentbb0871b294f05254546258048428c0aa5f8042b8 (diff)
downloadvdr-plugin-infosatepg-0.0.7.tar.gz
vdr-plugin-infosatepg-0.0.7.tar.bz2
New version 0.0.7v0.0.7
Added channel copy and reset functions
Diffstat (limited to 'setup.cpp')
-rw-r--r--setup.cpp47
1 files changed, 37 insertions, 10 deletions
diff --git a/setup.cpp b/setup.cpp
index 5452e68..f1e3d24 100644
--- a/setup.cpp
+++ b/setup.cpp
@@ -66,7 +66,6 @@ cMenuSetupInfosatepg::cMenuSetupInfosatepg (cGlobalInfosatepg *Global)
Add (new cOsdItem (buffer));
}
}
- //SetHelp(tr("Button$Reset"));
}
cOsdItem *cMenuSetupInfosatepg::NewTitle (const char *s)
@@ -128,9 +127,22 @@ eOSState cMenuSetupInfosatepg::Edit()
{
int chanIndex=Current()-chanCurrent;
if (chanIndex<global->InfosatChannels())
- return AddSubMenu (new cMenuSetupChannelMenu (global,chanIndex));
+ {
+ eOSState state=AddSubMenu (new cMenuSetupChannelMenu (global,chanIndex));
+ cChannel *chan = Channels.GetByChannelID (global->GetChannelID (chanIndex));
+ if (chan)
+ {
+ int chanuse=global->GetChannelUsage(chanIndex);
+ cString buffer = cString::sprintf ("%s:\t%s",chan->Name(),chanuse ? tr ("used") : "");
+ cOsdItem *osd=Get(Current());
+ osd->SetText(buffer);
+ }
+ return state;
+ }
else
+ {
return osUnknown;
+ }
}
else
return osUnknown;
@@ -148,10 +160,6 @@ eOSState cMenuSetupInfosatepg::ProcessKey (eKeys Key)
{
switch (Key)
{
- case kRed:
- //dsyslog("Red1 key pressed");
- state=osContinue;
- break;
case kOk:
state=Edit();
@@ -180,10 +188,10 @@ cMenuSetupChannelMenu::cMenuSetupChannelMenu (cGlobalInfosatepg *Global, int Ind
newDays=global->GetChannelDays(index);
if (newDays<=0) newDays=1;
- channel = Channels.GetByChannelID (global->GetChannelID (index));
+ cChannel *channel = Channels.GetByChannelID (global->GetChannelID (index));
if (!channel) return;
- //SetHelp(NULL,tr("Button$Default"));
+ SetHelp(tr("Button$Reset"),tr("Button$Copy"));
cString buffer = cString::sprintf("---- %s ----", channel->Name());
Add (new cOsdItem (buffer,osUnknown,false));
@@ -201,6 +209,7 @@ void cMenuSetupChannelMenu::Store (void)
{
bool bReprocess=false;
+ cChannel *channel = Channels.GetByChannelID (global->GetChannelID (index));
if (!channel) return;
cString ChannelID = channel->GetChannelID().ToString();
cString name = cString::sprintf("Channel-%s",*ChannelID);
@@ -229,10 +238,28 @@ eOSState cMenuSetupChannelMenu::ProcessKey (eKeys Key)
switch (Key)
{
case kRed:
- state=osContinue;
+ if (Skins.Message(mtInfo,tr("Reset all channel settings?"))==kOk)
+ {
+ newDays=1;
+ newChannelUse=USE_NOTHING;
+ int oldindex=index;
+ for (index=0; index<global->InfosatChannels(); index++) Store();
+ index=oldindex;
+ state=osBack;
+ }
+ else
+ {
+ state=osContinue;
+ }
break;
case kGreen:
- //dsyslog("Green1 key pressed");
+ if (Skins.Message(mtInfo,tr("Copy settings to all channels?"))==kOk)
+ {
+ int oldindex=index;
+ for (index=0; index<global->InfosatChannels(); index++) Store();
+ index=oldindex;
+
+ }
state=osContinue;
break;