1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Confirmation prompt in case of an upcoming timer event when pressing the 'Power' key

This commit is contained in:
Klaus Schmidinger 2002-02-10 15:18:45 +01:00
parent 1b3d0f1d1b
commit 8c403e1b0d
4 changed files with 27 additions and 3 deletions

View File

@ -201,3 +201,7 @@ J
Uwe Freese <mail@uwe-freese.de> Uwe Freese <mail@uwe-freese.de>
for suggesting to automatically close an empty recordings page after deleting for suggesting to automatically close an empty recordings page after deleting
an entry an entry
Rainer Zocholl <Usenet-372114@zocki.toppoint.de>
for suggesting a confirmation prompt when the user presses the "Power" button
and there is an upcoming timer event

View File

@ -991,3 +991,6 @@ Video Disk Recorder Revision History
longer shown (thanks to Andy Grobb). longer shown (thanks to Andy Grobb).
- If compiled with VFAT=1, characters that can't be handled by a VFAT system are - If compiled with VFAT=1, characters that can't be handled by a VFAT system are
now encoded to '#XX'. 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.

12
i18n.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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 <mihasetina@softhome.net> * Slovenian translations provided by Miha Setina <mihasetina@softhome.net>
* Italian translations provided by Alberto Carraro <bertocar@tin.it> * Italian translations provided by Alberto Carraro <bertocar@tin.it>
@ -452,6 +452,16 @@ const tPhrase Phrases[] = {
"", // TODO "", // TODO
"Nauhoitus kesken - lopetetaanko se?", "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", { "Press any key to cancel shutdown",
"Taste drücken um Shutdown abzubrechen", "Taste drücken um Shutdown abzubrechen",
"", // TODO "", // TODO

11
vdr.c
View File

@ -22,7 +22,7 @@
* *
* The project's page is at http://www.cadsoft.de/people/kls/vdr * 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 <getopt.h> #include <getopt.h>
@ -494,13 +494,20 @@ int main(int argc, char *argv[])
else else
LastActivity = 1; 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) { if (!Next || Delta > Setup.MinEventTimeout * 60 || ForceShutdown) {
ForceShutdown = false; ForceShutdown = false;
if (timer) if (timer)
dsyslog(LOG_INFO, "next timer event at %s", ctime(&Next)); dsyslog(LOG_INFO, "next timer event at %s", ctime(&Next));
if (WatchdogTimeout > 0) if (WatchdogTimeout > 0)
signal(SIGALRM, SIG_IGN); signal(SIGALRM, SIG_IGN);
bool UserShutdown = key == kPower;
if (Interface->Confirm(tr("Press any key to cancel shutdown"), UserShutdown ? 5 : SHUTDOWNWAIT, true)) { if (Interface->Confirm(tr("Press any key to cancel shutdown"), UserShutdown ? 5 : SHUTDOWNWAIT, true)) {
int Channel = timer ? timer->channel : 0; int Channel = timer ? timer->channel : 0;
const char *File = timer ? timer->file : ""; const char *File = timer ? timer->file : "";