summaryrefslogtreecommitdiff
path: root/vdr.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2002-02-10 15:18:45 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2002-02-10 15:18:45 +0100
commit8c403e1b0df6c961662c8733c27faa54bace065b (patch)
tree2eb57f7dc5045d50f27bd6fe95d222160ac46416 /vdr.c
parent1b3d0f1d1bc019fa4b1790596c4dcc3215ef6ce7 (diff)
downloadvdr-8c403e1b0df6c961662c8733c27faa54bace065b.tar.gz
vdr-8c403e1b0df6c961662c8733c27faa54bace065b.tar.bz2
Confirmation prompt in case of an upcoming timer event when pressing the 'Power' key
Diffstat (limited to 'vdr.c')
-rw-r--r--vdr.c11
1 files changed, 9 insertions, 2 deletions
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 <getopt.h>
@@ -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 : "";