summaryrefslogtreecommitdiff
path: root/vdr.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2001-09-08 13:02:05 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2001-09-08 13:02:05 +0200
commitc7bb0bb73964eafed5e337dc18278fa118775671 (patch)
tree6395d9610aeb59b7546441df30d93280a3474f26 /vdr.c
parent57b324cd424aa2d4be111fb824e2a024c7f1fc11 (diff)
downloadvdr-c7bb0bb73964eafed5e337dc18278fa118775671.tar.gz
vdr-c7bb0bb73964eafed5e337dc18278fa118775671.tar.bz2
Improved handling of 'Power' key
Diffstat (limited to 'vdr.c')
-rw-r--r--vdr.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/vdr.c b/vdr.c
index f71cfd12..51a841ee 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.70 2001/09/08 12:15:05 kls Exp $
+ * $Id: vdr.c 1.71 2001/09/08 12:49:38 kls Exp $
*/
#define _GNU_SOURCE
@@ -350,7 +350,7 @@ int main(int argc, char *argv[])
EITScanner.Activity();
LastActivity = time(NULL);
}
- if (*Interact) {
+ if (*Interact && key != kPower) {
switch ((*Interact)->ProcessKey(key)) {
case osMenu: DELETENULL(Menu);
Menu = new cMenuMain(ReplayControl);
@@ -434,6 +434,7 @@ int main(int argc, char *argv[])
case kOk: LastChannel = -1; break; // forces channel display
// Power off:
case kPower: isyslog(LOG_INFO, "Power button pressed");
+ DELETENULL(*Interact);
if (!Shutdown) {
Interface->Error(tr("Can't shutdown - option '-s' not given!"));
break;
@@ -455,8 +456,7 @@ int main(int argc, char *argv[])
time_t Now = time(NULL);
if (Now - LastActivity > ACTIVITYTIMEOUT) {
// Shutdown:
- if (Shutdown && (Setup.MinUserInactivity && Now - LastActivity > Setup.MinUserInactivity * 60 || ForceShutdown)) {
- ForceShutdown = false;
+ if (Shutdown && Setup.MinUserInactivity && Now - LastActivity > Setup.MinUserInactivity * 60) {
cTimer *timer = Timers.GetNextActiveTimer();
time_t Next = timer ? timer->StartTime() : 0;
time_t Delta = timer ? Next - Now : 0;
@@ -470,7 +470,8 @@ int main(int argc, char *argv[])
else
LastActivity = 1;
}
- if (!Next || Delta > Setup.MinEventTimeout * 60) {
+ if (!Next || Delta > Setup.MinEventTimeout * 60 || ForceShutdown) {
+ ForceShutdown = false;
if (timer)
dsyslog(LOG_INFO, "next timer event at %s", ctime(&Next));
if (WatchdogTimeout > 0)