Added setup option to switch functionality of keys Blue and OK

This commit is contained in:
louis 2013-06-01 11:08:17 +02:00
parent daac1abd7d
commit 10c1a1d8ce
9 changed files with 64 additions and 19 deletions

View File

@ -40,3 +40,4 @@ VDR Plugin 'tvguide' Revision History
- Display of Main Menu Entry configurable - Display of Main Menu Entry configurable
- Eliminated setup option "Number of channels to jump", directly jump - Eliminated setup option "Number of channels to jump", directly jump
number of channel columns / rows with green / yellow number of channel columns / rows with green / yellow
- Added setup option to switch functionality of keys "Blue" and "OK"

View File

@ -46,6 +46,7 @@ cTvguideConfig::cTvguideConfig() {
hugeStepHours = 24; hugeStepHours = 24;
channelJumpMode = eNumJump; channelJumpMode = eNumJump;
jumpChannels = 0; jumpChannels = 0;
blueKeyMode = 0;
hideLastGroup = 0; hideLastGroup = 0;
hideChannelLogos = 0; hideChannelLogos = 0;
logoWidthRatio = 13; logoWidthRatio = 13;
@ -254,6 +255,7 @@ bool cTvguideConfig::SetupParse(const char *Name, const char *Value) {
else if (strcmp(Name, "bigStepHours") == 0) bigStepHours = atoi(Value); else if (strcmp(Name, "bigStepHours") == 0) bigStepHours = atoi(Value);
else if (strcmp(Name, "hugeStepHours") == 0) hugeStepHours = atoi(Value); else if (strcmp(Name, "hugeStepHours") == 0) hugeStepHours = atoi(Value);
else if (strcmp(Name, "channelJumpMode") == 0) channelJumpMode = atoi(Value); else if (strcmp(Name, "channelJumpMode") == 0) channelJumpMode = atoi(Value);
else if (strcmp(Name, "blueKeyMode") == 0) blueKeyMode = atoi(Value);
else if (strcmp(Name, "hideLastGroup") == 0) hideLastGroup = atoi(Value); else if (strcmp(Name, "hideLastGroup") == 0) hideLastGroup = atoi(Value);
else if (strcmp(Name, "hideEpgImages") == 0) hideEpgImages = atoi(Value); else if (strcmp(Name, "hideEpgImages") == 0) hideEpgImages = atoi(Value);
else if (strcmp(Name, "epgImageWidth") == 0) epgImageWidth = atoi(Value); else if (strcmp(Name, "epgImageWidth") == 0) epgImageWidth = atoi(Value);

View File

@ -46,6 +46,7 @@ class cTvguideConfig {
int hugeStepHours; int hugeStepHours;
int channelJumpMode; int channelJumpMode;
int jumpChannels; int jumpChannels;
int blueKeyMode;
int hideLastGroup; int hideLastGroup;
int hideChannelLogos; int hideChannelLogos;
int logoWidthRatio; int logoWidthRatio;

View File

@ -63,7 +63,11 @@ void cFooter::drawYellowButton(const char *text) {
} }
void cFooter::drawBlueButton() { void cFooter::drawBlueButton() {
cString text(tr("Switch to Channel")); cString text;
if (tvguideConfig.blueKeyMode == 0)
text = tr("Switch to Channel");
else if (tvguideConfig.blueKeyMode == 1)
text = tr("Detailed EPG");
DrawButton(*text, theme.Color(clrButtonBlue), theme.Color(clrButtonBlueBorder), 3); DrawButton(*text, theme.Color(clrButtonBlue), theme.Color(clrButtonBlueBorder), 3);
} }

View File

@ -3,7 +3,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vdr-tvguide 0.0.1\n" "Project-Id-Version: vdr-tvguide 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n" "Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2013-06-01 10:39+0200\n" "POT-Creation-Date: 2013-06-01 11:02+0200\n"
"PO-Revision-Date: 2012-08-25 17:49+0200\n" "PO-Revision-Date: 2012-08-25 17:49+0200\n"
"Last-Translator: Horst\n" "Last-Translator: Horst\n"
"Language-Team: \n" "Language-Team: \n"
@ -33,6 +33,9 @@ msgstr "Kanäle vor"
msgid "Switch to Channel" msgid "Switch to Channel"
msgstr "Umschalten" msgstr "Umschalten"
msgid "Detailed EPG"
msgstr "Detailiertes EPG"
msgid "General Settings" msgid "General Settings"
msgstr "Allgemeine Einstellungen" msgstr "Allgemeine Einstellungen"
@ -48,6 +51,12 @@ msgstr "x Kanäle zurück / vor"
msgid "previous / next channel group" msgid "previous / next channel group"
msgstr "vorherige / nächste Kanalgruppe" msgstr "vorherige / nächste Kanalgruppe"
msgid "Blue: Channel Switch, Ok: Detailed EPG"
msgstr "Blau: Umschalten, OK: Detailiertes EPG"
msgid "Blue: Detailed EPG, Ok: Channel Switch"
msgstr "Blau: Detailiertes EPG, OK: Umschalten"
msgid "never" msgid "never"
msgstr "nie" msgstr "nie"
@ -69,6 +78,9 @@ msgstr "Abgerundete Ecken"
msgid "Channel Jump Mode (Keys Green / Yellow)" msgid "Channel Jump Mode (Keys Green / Yellow)"
msgstr "Kanalsprung Modus (Tasten grün / gelb)" msgstr "Kanalsprung Modus (Tasten grün / gelb)"
msgid "Keys Blue and OK"
msgstr "Tasten Blau und OK"
msgid "Hide last Channel Group" msgid "Hide last Channel Group"
msgstr "Letzte Kanalgruppe verstecken" msgstr "Letzte Kanalgruppe verstecken"

View File

@ -62,6 +62,7 @@ void cTvguideSetup::Store(void) {
SetupStore("bigStepHours", tvguideConfig.bigStepHours); SetupStore("bigStepHours", tvguideConfig.bigStepHours);
SetupStore("hugeStepHours", tvguideConfig.hugeStepHours); SetupStore("hugeStepHours", tvguideConfig.hugeStepHours);
SetupStore("channelJumpMode", tvguideConfig.channelJumpMode); SetupStore("channelJumpMode", tvguideConfig.channelJumpMode);
SetupStore("blueKeyMode", tvguideConfig.blueKeyMode);
SetupStore("hideLastGroup", tvguideConfig.hideLastGroup); SetupStore("hideLastGroup", tvguideConfig.hideLastGroup);
SetupStore("hideChannelLogos", tvguideConfig.hideChannelLogos); SetupStore("hideChannelLogos", tvguideConfig.hideChannelLogos);
SetupStore("logoExtension", tvguideConfig.logoExtension); SetupStore("logoExtension", tvguideConfig.logoExtension);
@ -135,6 +136,8 @@ cMenuSetupGeneral::cMenuSetupGeneral(cTvguideConfig* data) : cMenuSetupSubMenu(
timeFormatItems[1] = "24h"; timeFormatItems[1] = "24h";
jumpMode[0] = tr("x channels back / forward"); jumpMode[0] = tr("x channels back / forward");
jumpMode[1] = tr("previous / next channel group"); jumpMode[1] = tr("previous / next channel group");
blueMode[0] = tr("Blue: Channel Switch, Ok: Detailed EPG");
blueMode[1] = tr("Blue: Detailed EPG, Ok: Channel Switch");
useSubtitleRerunTexts[0] = tr("never"); useSubtitleRerunTexts[0] = tr("never");
useSubtitleRerunTexts[1] = tr("if exists"); useSubtitleRerunTexts[1] = tr("if exists");
useSubtitleRerunTexts[2] = tr("always"); useSubtitleRerunTexts[2] = tr("always");
@ -151,6 +154,7 @@ void cMenuSetupGeneral::Set(void) {
Add(new cMenuEditBoolItem(tr("Rounded Corners"), &tmpTvguideConfig->roundedCorners)); Add(new cMenuEditBoolItem(tr("Rounded Corners"), &tmpTvguideConfig->roundedCorners));
Add(new cMenuEditStraItem(tr("Channel Jump Mode (Keys Green / Yellow)"), &tmpTvguideConfig->channelJumpMode, 2, jumpMode)); Add(new cMenuEditStraItem(tr("Channel Jump Mode (Keys Green / Yellow)"), &tmpTvguideConfig->channelJumpMode, 2, jumpMode));
Add(new cMenuEditStraItem(tr("Keys Blue and OK"), &tmpTvguideConfig->blueKeyMode, 2, blueMode));
Add(new cMenuEditBoolItem(tr("Hide last Channel Group"), &tmpTvguideConfig->hideLastGroup)); Add(new cMenuEditBoolItem(tr("Hide last Channel Group"), &tmpTvguideConfig->hideLastGroup));
Add(new cMenuEditIntItem(tr("Time to display in minutes"), &tmpTvguideConfig->displayTime, 120, 320)); Add(new cMenuEditIntItem(tr("Time to display in minutes"), &tmpTvguideConfig->displayTime, 120, 320));
Add(new cMenuEditIntItem(tr("Big Step (Keys 1 / 3) in hours"), &tmpTvguideConfig->bigStepHours, 1, 12)); Add(new cMenuEditIntItem(tr("Big Step (Keys 1 / 3) in hours"), &tmpTvguideConfig->bigStepHours, 1, 12));

View File

@ -30,6 +30,7 @@ class cMenuSetupGeneral : public cMenuSetupSubMenu {
cThemes themes; cThemes themes;
const char * timeFormatItems[2]; const char * timeFormatItems[2];
const char * jumpMode[2]; const char * jumpMode[2];
const char * blueMode[2];
const char *useSubtitleRerunTexts[3]; const char *useSubtitleRerunTexts[3];
void Set(void); void Set(void);
public: public:

View File

@ -444,21 +444,6 @@ void cTvGuideOsd::processKeyRight() {
} }
} }
void cTvGuideOsd::processKeyOk() {
if (detailViewActive) {
delete detailView;
detailView = NULL;
detailViewActive = false;
osdManager.flush();
} else {
if (!activeGrid->isDummy()) {
detailViewActive = true;
detailView = new cDetailView(activeGrid);
detailView->Start();
}
}
}
void cTvGuideOsd::processKeyRed() { void cTvGuideOsd::processKeyRed() {
if ((activeGrid == NULL) || activeGrid->isDummy()) if ((activeGrid == NULL) || activeGrid->isDummy())
return; return;
@ -553,6 +538,24 @@ void cTvGuideOsd::processKeyYellow() {
} }
eOSState cTvGuideOsd::processKeyBlue() { eOSState cTvGuideOsd::processKeyBlue() {
if (tvguideConfig.blueKeyMode == 0) {
return ChannelSwitch();
} else if (tvguideConfig.blueKeyMode == 1) {
DetailedEPG();
}
return osContinue;
}
eOSState cTvGuideOsd::processKeyOk() {
if ((tvguideConfig.blueKeyMode == 0) || detailViewActive ) {
DetailedEPG();
} else if (tvguideConfig.blueKeyMode == 1) {
return ChannelSwitch();
}
return osContinue;
}
eOSState cTvGuideOsd::ChannelSwitch() {
if (activeGrid == NULL) if (activeGrid == NULL)
return osContinue; return osContinue;
const cChannel *currentChannel = activeGrid->column->getChannel(); const cChannel *currentChannel = activeGrid->column->getChannel();
@ -563,6 +566,21 @@ eOSState cTvGuideOsd::processKeyBlue() {
return osContinue; return osContinue;
} }
void cTvGuideOsd::DetailedEPG() {
if (detailViewActive) {
delete detailView;
detailView = NULL;
detailViewActive = false;
osdManager.flush();
} else {
if (!activeGrid->isDummy()) {
detailViewActive = true;
detailView = new cDetailView(activeGrid);
detailView->Start();
}
}
}
void cTvGuideOsd::processKey1() { void cTvGuideOsd::processKey1() {
bool tooFarInPast = myTime->DelStep(tvguideConfig.bigStepHours*60); bool tooFarInPast = myTime->DelStep(tvguideConfig.bigStepHours*60);
if (tooFarInPast) if (tooFarInPast)
@ -642,7 +660,7 @@ eOSState cTvGuideOsd::ProcessKey(eKeys Key) {
case kGreen: processKeyGreen(); break; case kGreen: processKeyGreen(); break;
case kYellow: processKeyYellow(); break; case kYellow: processKeyYellow(); break;
case kBlue: state = processKeyBlue(); break; case kBlue: state = processKeyBlue(); break;
case kOk: processKeyOk(); break; case kOk: state = processKeyOk(); break;
case kBack: state=osEnd; break; case kBack: state=osEnd; break;
case k1: processKey1(); break; case k1: processKey1(); break;
case k3: processKey3(); break; case k3: processKey3(); break;

View File

@ -26,7 +26,7 @@ private:
void processKeyGreen(); void processKeyGreen();
void processKeyYellow(); void processKeyYellow();
eOSState processKeyBlue(); eOSState processKeyBlue();
void processKeyOk(); eOSState processKeyOk();
void processKey1(); void processKey1();
void processKey3(); void processKey3();
void processKey4(); void processKey4();
@ -40,6 +40,8 @@ private:
void timeBack(); void timeBack();
void ScrollForward(); void ScrollForward();
void ScrollBack(); void ScrollBack();
eOSState ChannelSwitch();
void DetailedEPG();
void dump(); void dump();
public: public:
cTvGuideOsd(void); cTvGuideOsd(void);