mirror of
				https://github.com/vdr-projects/vdr.git
				synced 2025-03-01 10:50:46 +00:00 
			
		
		
		
	Fixed handling the "Power" key in case a timer is about to start recording
This commit is contained in:
		@@ -1424,6 +1424,7 @@ Udo Richter <udo_richter@gmx.de>
 | 
			
		||||
 no plugin is active
 | 
			
		||||
 for suggesting to add 'eval' to the $VDRCMD call in 'runvdr' to avoid problems with
 | 
			
		||||
 quoting
 | 
			
		||||
 for fixing handling the "Power" key in case a timer is about to start recording
 | 
			
		||||
 | 
			
		||||
Sven Kreiensen <svenk@kammer.uni-hannover.de>
 | 
			
		||||
 for his help in keeping 'channels.conf.terr' up to date
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								HISTORY
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								HISTORY
									
									
									
									
									
								
							@@ -4698,3 +4698,5 @@ Video Disk Recorder Revision History
 | 
			
		||||
  (suggested by Udo Richter).
 | 
			
		||||
- Fixed missing ',' in the Italian and Polish OSD texts (thanks to Marko M<>kel<65>).
 | 
			
		||||
- Updated the Czech OSD texts (thanks to Vladim<69>r B<>rta).
 | 
			
		||||
- Fixed handling the "Power" key in case a timer is about to start recording
 | 
			
		||||
  (thanks to Udo Richter).
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										25
									
								
								vdr.c
									
									
									
									
									
								
							
							
						
						
									
										25
									
								
								vdr.c
									
									
									
									
									
								
							@@ -22,7 +22,7 @@
 | 
			
		||||
 *
 | 
			
		||||
 * The project's page is at http://www.cadsoft.de/vdr
 | 
			
		||||
 *
 | 
			
		||||
 * $Id: vdr.c 1.267 2006/04/29 09:14:06 kls Exp $
 | 
			
		||||
 * $Id: vdr.c 1.268 2006/05/05 13:43:32 kls Exp $
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include <getopt.h>
 | 
			
		||||
@@ -970,7 +970,7 @@ int main(int argc, char *argv[])
 | 
			
		||||
                  }
 | 
			
		||||
               break;
 | 
			
		||||
          // Power off:
 | 
			
		||||
          case kPower:
 | 
			
		||||
          case kPower: {
 | 
			
		||||
               isyslog("Power button pressed");
 | 
			
		||||
               DELETE_MENU;
 | 
			
		||||
               if (!Shutdown) {
 | 
			
		||||
@@ -985,8 +985,20 @@ int main(int argc, char *argv[])
 | 
			
		||||
                  }
 | 
			
		||||
               if (cPluginManager::Active(tr("shut down anyway?")))
 | 
			
		||||
                  break;
 | 
			
		||||
               cTimer *timer = Timers.GetNextActiveTimer();
 | 
			
		||||
               time_t Next  = timer ? timer->StartTime() : 0;
 | 
			
		||||
               time_t Delta = timer ? Next - time(NULL) : 0;
 | 
			
		||||
               if (Next && Delta <= Setup.MinEventTimeout * 60) {
 | 
			
		||||
                  char *buf;
 | 
			
		||||
                  asprintf(&buf, tr("Recording in %ld minutes, shut down anyway?"), Delta / 60);
 | 
			
		||||
                  bool confirm = Interface->Confirm(buf);
 | 
			
		||||
                  free(buf);
 | 
			
		||||
                  if (!confirm)
 | 
			
		||||
                     break;
 | 
			
		||||
                  }
 | 
			
		||||
               ForceShutdown = true;
 | 
			
		||||
               break;
 | 
			
		||||
               }
 | 
			
		||||
          default: break;
 | 
			
		||||
          }
 | 
			
		||||
        Interact = Menu ? Menu : cControl::Control(); // might have been closed in the mean time
 | 
			
		||||
@@ -1121,15 +1133,6 @@ int main(int argc, char *argv[])
 | 
			
		||||
                    else
 | 
			
		||||
                       LastActivity = 1;
 | 
			
		||||
                    }
 | 
			
		||||
                 if (UserShutdown && Next && Delta <= Setup.MinEventTimeout * 60 && !ForceShutdown) {
 | 
			
		||||
                    char *buf;
 | 
			
		||||
                    asprintf(&buf, tr("Recording in %ld minutes, shut down anyway?"), Delta / 60);
 | 
			
		||||
                    if (Interface->Confirm(buf))
 | 
			
		||||
                       ForceShutdown = true;
 | 
			
		||||
                    else
 | 
			
		||||
                       UserShutdown = false;
 | 
			
		||||
                    free(buf);
 | 
			
		||||
                    }
 | 
			
		||||
                 if (!Next || Delta > Setup.MinEventTimeout * 60 || ForceShutdown) {
 | 
			
		||||
                    ForceShutdown = false;
 | 
			
		||||
                    if (timer)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user