summaryrefslogtreecommitdiff
path: root/interface.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2001-09-01 09:04:37 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2001-09-01 09:04:37 +0200
commita8f8de9dc9fda5fc94e5bc3d98dac5785e72d7da (patch)
tree3afd0bc9751c677efe4dba5849b8e529e146cb7b /interface.c
parenta92b585c1ee19c74cfbc23e0096509a8101294fa (diff)
downloadvdr-a8f8de9dc9fda5fc94e5bc3d98dac5785e72d7da.tar.gz
vdr-a8f8de9dc9fda5fc94e5bc3d98dac5785e72d7da.tar.bz2
Implemented automatic shutdown
Diffstat (limited to 'interface.c')
-rw-r--r--interface.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/interface.c b/interface.c
index 1e06f4af..b7cb457c 100644
--- a/interface.c
+++ b/interface.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: interface.c 1.41 2001/08/25 13:15:00 kls Exp $
+ * $Id: interface.c 1.42 2001/09/01 07:30:37 kls Exp $
*/
#include "interface.h"
@@ -20,6 +20,7 @@ cInterface::cInterface(int SVDRPport)
cols[0] = 0;
width = height = 0;
keyFromWait = kNone;
+ interrupted = false;
rcIo = NULL;
SVDRP = NULL;
#if defined(REMOTE_RCU)
@@ -110,11 +111,12 @@ eKeys cInterface::Wait(int Seconds, bool KeepChar)
time_t timeout = time(NULL) + Seconds;
for (;;) {
Key = GetKey();
- if ((Key != kNone && (RAWKEY(Key) != kOk || RAWKEY(Key) == Key)) || time(NULL) > timeout)
+ if ((Key != kNone && (RAWKEY(Key) != kOk || RAWKEY(Key) == Key)) || time(NULL) > timeout || interrupted)
break;
}
if (KeepChar && ISRAWKEY(Key))
keyFromWait = Key;
+ interrupted = false;
return Key;
}
@@ -312,12 +314,13 @@ void cInterface::Error(const char *s)
Close();
}
-bool cInterface::Confirm(const char *s)
+bool cInterface::Confirm(const char *s, int Seconds, bool WaitForTimeout)
{
Open();
isyslog(LOG_INFO, "confirm: %s", s);
Status(s, clrBlack, clrYellow);
- bool result = Wait(10) == kOk;
+ eKeys k = Wait(Seconds);
+ bool result = WaitForTimeout ? k == kNone : k == kOk;
Status(NULL);
Close();
isyslog(LOG_INFO, "%sconfirmed", result ? "" : "not ");