From 8c403e1b0df6c961662c8733c27faa54bace065b Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 10 Feb 2002 15:18:45 +0100 Subject: [PATCH] Confirmation prompt in case of an upcoming timer event when pressing the 'Power' key --- CONTRIBUTORS | 4 ++++ HISTORY | 3 +++ i18n.c | 12 +++++++++++- vdr.c | 11 +++++++++-- 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 07925b51..9ccf53db 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -201,3 +201,7 @@ J Uwe Freese for suggesting to automatically close an empty recordings page after deleting an entry + +Rainer Zocholl + for suggesting a confirmation prompt when the user presses the "Power" button + and there is an upcoming timer event diff --git a/HISTORY b/HISTORY index cd889c18..26a3acbd 100644 --- a/HISTORY +++ b/HISTORY @@ -991,3 +991,6 @@ Video Disk Recorder Revision History longer shown (thanks to Andy Grobb). - If compiled with VFAT=1, characters that can't be handled by a VFAT system are now encoded to '#XX'. +- When the user presses the "Power" button and there is a timer about to start + recording within Setup.MinEventTimeout minutes, there is now a confirmation + prompt telling the user that there is an upcoming timer event. diff --git a/i18n.c b/i18n.c index 3a16f81e..f2c414f0 100644 --- a/i18n.c +++ b/i18n.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: i18n.c 1.52 2002/02/09 17:20:19 kls Exp $ + * $Id: i18n.c 1.53 2002/02/10 15:07:46 kls Exp $ * * Slovenian translations provided by Miha Setina * Italian translations provided by Alberto Carraro @@ -452,6 +452,16 @@ const tPhrase Phrases[] = { "", // TODO "Nauhoitus kesken - lopetetaanko se?", }, + { "Recording in %d minutes, shut down anyway?", + "Aufnahme in %d Minuten - trotzdem ausschalten?", + "", // TODO + "", // TODO + "", // TODO + "", // TODO + "", // TODO + "", // TODO + "", // TODO + }, { "Press any key to cancel shutdown", "Taste drücken um Shutdown abzubrechen", "", // TODO diff --git a/vdr.c b/vdr.c index 72f04f8f..9d5167b4 100644 --- a/vdr.c +++ b/vdr.c @@ -22,7 +22,7 @@ * * The project's page is at http://www.cadsoft.de/people/kls/vdr * - * $Id: vdr.c 1.94 2002/02/02 15:59:18 kls Exp $ + * $Id: vdr.c 1.95 2002/02/10 15:12:43 kls Exp $ */ #include @@ -494,13 +494,20 @@ int main(int argc, char *argv[]) else LastActivity = 1; } + bool UserShutdown = key == kPower; + if (UserShutdown && Next && Delta <= Setup.MinEventTimeout * 60 && !ForceShutdown) { + char *buf; + asprintf(&buf, tr("Recording in %d minutes, shut down anyway?"), Delta / 60); + if (Interface->Confirm(buf)) + ForceShutdown = true; + delete buf; + } if (!Next || Delta > Setup.MinEventTimeout * 60 || ForceShutdown) { ForceShutdown = false; if (timer) dsyslog(LOG_INFO, "next timer event at %s", ctime(&Next)); if (WatchdogTimeout > 0) signal(SIGALRM, SIG_IGN); - bool UserShutdown = key == kPower; if (Interface->Confirm(tr("Press any key to cancel shutdown"), UserShutdown ? 5 : SHUTDOWNWAIT, true)) { int Channel = timer ? timer->channel : 0; const char *File = timer ? timer->file : "";