Implemented the option "Setup/OSD/Menu button closes"

This commit is contained in:
Klaus Schmidinger 2006-01-13 15:45:02 +01:00
parent ff88f3bfed
commit 317b15f5a0
7 changed files with 46 additions and 7 deletions

View File

@ -4152,3 +4152,6 @@ Video Disk Recorder Revision History
is given.
- Added missing i18n entry for the "Timer" button (thanks to Ville Skyttä)
- Updated the Finnish OSD texts (thanks to Rolf Ahrenberg).
- Making the "Menu" key behave consistently has not been well received by several
users, so the new option "Setup/OSD/Menu button closes" can be used to get the
old behavior back (which also is the default value of this option).

7
MANUAL
View File

@ -525,6 +525,13 @@ Version 1.3
(first) line of the list directly to the first (last)
one.
Menu button closes = no
If set to "yes", pressing the "Menu" button while there is
anything displayed on the OSD will close the OSD. If set
to "no", the "Menu" button will open the main menu after
closing a temporary display, like, for instance, the channel
display.
Sort timers = yes Turns sorting the timers in the "Timers" menu on/off.
Timers are sorted by ascending start times, with the
first one being the next timer that will start.

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: config.c 1.140 2006/01/07 12:28:49 kls Exp $
* $Id: config.c 1.141 2006/01/13 15:19:37 kls Exp $
*/
#include "config.h"
@ -220,6 +220,7 @@ cSetup::cSetup(void)
TimeoutRequChInfo = 1;
MenuScrollPage = 1;
MenuScrollWrap = 0;
MenuButtonCloses = 0;
MarkInstantRecord = 1;
strcpy(NameInstantRecord, "TITLE EPISODE");
InstantRecordTime = 180;
@ -379,6 +380,7 @@ bool cSetup::Parse(const char *Name, const char *Value)
else if (!strcasecmp(Name, "TimeoutRequChInfo")) TimeoutRequChInfo = atoi(Value);
else if (!strcasecmp(Name, "MenuScrollPage")) MenuScrollPage = atoi(Value);
else if (!strcasecmp(Name, "MenuScrollWrap")) MenuScrollWrap = atoi(Value);
else if (!strcasecmp(Name, "MenuButtonCloses")) MenuButtonCloses = atoi(Value);
else if (!strcasecmp(Name, "MarkInstantRecord")) MarkInstantRecord = atoi(Value);
else if (!strcasecmp(Name, "NameInstantRecord")) strn0cpy(NameInstantRecord, Value, MaxFileName);
else if (!strcasecmp(Name, "InstantRecordTime")) InstantRecordTime = atoi(Value);
@ -445,6 +447,7 @@ bool cSetup::Save(void)
Store("TimeoutRequChInfo", TimeoutRequChInfo);
Store("MenuScrollPage", MenuScrollPage);
Store("MenuScrollWrap", MenuScrollWrap);
Store("MenuButtonCloses", MenuButtonCloses);
Store("MarkInstantRecord", MarkInstantRecord);
Store("NameInstantRecord", NameInstantRecord);
Store("InstantRecordTime", InstantRecordTime);

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: config.h 1.239 2006/01/08 13:08:42 kls Exp $
* $Id: config.h 1.240 2006/01/13 15:17:19 kls Exp $
*/
#ifndef __CONFIG_H
@ -193,6 +193,7 @@ public:
int TimeoutRequChInfo;
int MenuScrollPage;
int MenuScrollWrap;
int MenuButtonCloses;
int MarkInstantRecord;
char NameInstantRecord[MaxFileName];
int InstantRecordTime;

23
i18n.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: i18n.c 1.232 2006/01/13 15:02:41 kls Exp $
* $Id: i18n.c 1.233 2006/01/13 15:38:17 kls Exp $
*
* Translations provided by:
*
@ -3052,6 +3052,27 @@ const tI18nPhrase Phrases[] = {
"Ridade kerimine",
"Scroll rundt",
},
{ "Setup.OSD$Menu button closes",
"Menu-Taste schließt",
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
"",// TODO
},
{ "Setup.OSD$Sort timers",
"Timer sortieren",
"Sortiraj termine",

3
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.391 2006/01/13 14:56:00 kls Exp $
* $Id: menu.c 1.392 2006/01/13 15:17:53 kls Exp $
*/
#include "menu.h"
@ -2007,6 +2007,7 @@ void cMenuSetupOSD::Set(void)
Add(new cMenuEditBoolItem(tr("Setup.OSD$Timeout requested channel info"), &data.TimeoutRequChInfo));
Add(new cMenuEditBoolItem(tr("Setup.OSD$Scroll pages"), &data.MenuScrollPage));
Add(new cMenuEditBoolItem(tr("Setup.OSD$Scroll wraps"), &data.MenuScrollWrap));
Add(new cMenuEditBoolItem(tr("Setup.OSD$Menu button closes"), &data.MenuButtonCloses));
Add(new cMenuEditBoolItem(tr("Setup.OSD$Sort timers"), &data.SortTimers));
Add(new cMenuEditBoolItem(tr("Setup.OSD$Recording directories"), &data.RecordingDirs));
SetCurrent(Get(current));

9
vdr.c
View File

@ -22,7 +22,7 @@
*
* The project's page is at http://www.cadsoft.de/vdr
*
* $Id: vdr.c 1.234 2006/01/09 16:44:15 kls Exp $
* $Id: vdr.c 1.235 2006/01/13 15:33:54 kls Exp $
*/
#include <getopt.h>
@ -787,14 +787,17 @@ int main(int argc, char *argv[])
// Keys that must work independent of any interactive mode:
switch (key) {
// Menu control:
case kMenu:
case kMenu: {
key = kNone; // nobody else needs to see this key
bool WasOpen = Interact != NULL;
bool WasMenu = Interact && Interact->IsMenu();
if (Menu)
DELETE_MENU;
else if (cControl::Control() && cOsd::IsOpen())
cControl::Control()->Hide();
else
if (!WasOpen || !WasMenu && !Setup.MenuButtonCloses)
Menu = new cMenuMain;
}
break;
// Info:
case kInfo: {