diff options
author | Timo Eskola <timo@tolleri.net> | 2015-09-08 13:51:02 +0300 |
---|---|---|
committer | Timo Eskola <timo@tolleri.net> | 2015-09-08 13:51:02 +0300 |
commit | b6ae0f75d77ac5025bf068993ecdc763631d32a9 (patch) | |
tree | 0c29c5a04d3c94834ba8ff035d61141390768e02 | |
parent | a29e83f54bbae14ee29f958d3640be9073e25a0c (diff) | |
download | vdr-plugin-useractivity-b6ae0f75d77ac5025bf068993ecdc763631d32a9.tar.gz vdr-plugin-useractivity-b6ae0f75d77ac5025bf068993ecdc763631d32a9.tar.bz2 |
Version 0.1.0:
- Italian translations by Diego Pierotto
- Converted translation files to UTF-8
- Check for automatic start added
- Support for VDR < 1.6.0 dropped
-rw-r--r-- | HISTORY | 7 | ||||
-rw-r--r-- | Makefile | 27 | ||||
-rw-r--r-- | README | 7 | ||||
-rw-r--r-- | activity.c | 89 | ||||
-rw-r--r-- | activity.h | 18 | ||||
-rw-r--r-- | i18n-template.c | 17 | ||||
-rw-r--r-- | i18n.c | 79 | ||||
-rw-r--r-- | i18n.h | 22 | ||||
-rw-r--r-- | po/ca_ES.po | 30 | ||||
-rw-r--r-- | po/cs_CZ.po | 28 | ||||
-rw-r--r-- | po/da_DK.po | 28 | ||||
-rw-r--r-- | po/de_DE.po | 28 | ||||
-rw-r--r-- | po/el_GR.po | 28 | ||||
-rw-r--r-- | po/es_ES.po | 28 | ||||
-rw-r--r-- | po/et_EE.po | 28 | ||||
-rw-r--r-- | po/fi_FI.po | 22 | ||||
-rw-r--r-- | po/fr_FR.po | 31 | ||||
-rw-r--r-- | po/hr_HR.po | 29 | ||||
-rw-r--r-- | po/hu_HU.po | 29 | ||||
-rw-r--r-- | po/it_IT.po | 19 | ||||
-rw-r--r-- | po/nl_NL.po | 30 | ||||
-rw-r--r-- | po/nn_NO.po | 29 | ||||
-rw-r--r-- | po/pl_PL.po | 28 | ||||
-rw-r--r-- | po/pt_PT.po | 28 | ||||
-rw-r--r-- | po/ro_RO.po | 29 | ||||
-rw-r--r-- | po/ru_RU.po | 28 | ||||
-rw-r--r-- | po/sl_SI.po | 29 | ||||
-rw-r--r-- | po/sv_SE.po | 29 | ||||
-rw-r--r-- | po/tr_TR.po | 28 | ||||
-rwxr-xr-x | po2i18n.pl | 139 | ||||
-rw-r--r-- | useractivity.c | 31 |
31 files changed, 149 insertions, 873 deletions
@@ -1,6 +1,13 @@ VDR Plugin 'useractivity' Revision History ------------------------------------------ +2009-03-13: Version 0.1.0 + +- Italian translations by Diego Pierotto +- Converted translation files to UTF-8 +- Check for automatic start added +- Support for VDR < 1.6.0 dropped + 2007-11-26: Version 0.0.4 - Fixed X activity detection for Ubuntu 7.10. @@ -65,7 +65,7 @@ endif ### The object files (add further files here): -OBJS = $(PLUGIN).o activity.o i18n.o +OBJS = $(PLUGIN).o activity.o ### Libraries @@ -78,9 +78,6 @@ endif %.o: %.c $(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $< -i18n.c: i18n-template.c po2i18n.pl - ./po2i18n.pl < i18n-template.c > i18n.c - # Dependencies: MAKEDEP = $(CXX) -MM -MG @@ -95,25 +92,25 @@ $(DEPFILE): Makefile i18n.c PODIR = po LOCALEDIR = $(VDRDIR)/locale I18Npo = $(wildcard $(PODIR)/*.po) -I18Nmo = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file)))) -I18Ndirs = $(notdir $(foreach file, $(I18Npo), $(basename $(file)))) +I18Nmsgs = $(addprefix $(LOCALEDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file)))))) I18Npot = $(PODIR)/$(PLUGIN).pot %.mo: %.po msgfmt -c -o $@ $< $(I18Npot): $(wildcard *.c) - xgettext -C -cTRANSLATORS --no-wrap -F -k -ktr -ktrNOOP --msgid-bugs-address='<timo@tolleri.net>' -o $@ $(wildcard *.c) + xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --msgid-bugs-address='<timo@tolleri.net>' -o $@ $^ + +%.po: $(I18Npot) + msgmerge -U --no-wrap --no-location --backup=none -q $@ $< + @touch $@ -$(I18Npo): $(I18Npot) - msgmerge -U --no-wrap -F --backup=none -q $@ $< +$(I18Nmsgs): $(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo + @mkdir -p $(dir \$@) + cp $< $@ -i18n: $(I18Nmo) - @mkdir -p $(LOCALEDIR) - for i in $(I18Ndirs); do\ - mkdir -p $(LOCALEDIR)/$$i/LC_MESSAGES;\ - cp $(PODIR)/$$i.mo $(LOCALEDIR)/$$i/LC_MESSAGES/vdr-$(PLUGIN).mo;\ - done +.PHONY: i18n +i18n: $(I18Nmsgs) $(I18Npot) ### Targets: @@ -19,7 +19,7 @@ GETI LSTU Display a list of users. SETA - Set VDR user activity. + Set VDR user active. SETI <minutes> Set minimum user inactivity in minutes. @@ -31,8 +31,3 @@ Xauthority: Depending on the way you start VDR, you might need to setup Xauthority in order to get idle the time from X window. - -Converter for po files (po2i18n): -- Written by Udo Richter <udo_richter@gmx.de> -- Project's homepage http://www.udo-richter.de/vdr/scripts.html#po2i18n - http://www.udo-richter.de/vdr/scripts.en.html#po2i18n @@ -8,7 +8,6 @@ #include <stdlib.h> #include <stdio.h> -#include <syslog.h> #ifdef USE_XSS #include <X11/Xlib.h> #include <X11/extensions/scrnsaver.h> @@ -19,11 +18,23 @@ #include <sys/stat.h> #include <time.h> #include <vdr/config.h> -#if VDRVERSNUM >= 10501 #include <vdr/shutdown.h> -#endif #include "activity.h" +#define MANUALSTART 600 // seconds the next timer must be in the future to assume manual start +#define SLEEPSECCONDS 60 // seconds to sleep while checking for activity in automatic mode + +cUserActivity::cUserActivity() { + automatic = AutomaticStart(); + lastInactivity = 0; + sleep = new cCondWait(); +} + +cUserActivity::~cUserActivity() { + Stop(); + delete sleep; +} + #ifdef USE_XSS int cUserActivity::DisplayIdleTime(char *display) { Display *d; @@ -31,7 +42,7 @@ int cUserActivity::DisplayIdleTime(char *display) { static int event, error, result=-1; if (!(d = XOpenDisplay(display))) { - syslog(LOG_ERR, "useractivity: Unable to open DISPLAY %s\n", display); + esyslog("vdr-useractivity: Unable to open DISPLAY %s\n", display); return result; } @@ -41,7 +52,7 @@ int cUserActivity::DisplayIdleTime(char *display) { result = (mitInfo->idle/1000)/60; } else { - syslog(LOG_ERR, "useractivity: MIT-SCREEN-SAVER missing\n"); + esyslog("vdr-useractivity: MIT-SCREEN-SAVER missing\n"); return result; } @@ -84,7 +95,62 @@ int cUserActivity::IdleTime(struct utmp *uptr) { return idle; } +int cUserActivity::MinIdleTime(void) { + struct utmp *uptr; + int idle; + int result=-1; + + setutent(); + while((uptr = getutent())!=NULL) { + if(uptr->ut_type == USER_PROCESS) { + idle = IdleTime(uptr); + if(idle >= 0 && (idle < result || result == -1)) { + result = idle; + } + } + } + endutent(); + return result; +} + +bool cUserActivity::AutomaticStart() { + time_t Delta = Setup.NextWakeupTime ? Setup.NextWakeupTime - time(NULL) : 0; + + if(!Setup.NextWakeupTime || abs(Delta) > MANUALSTART) { + // Apparently the user started VDR manually + dsyslog("vdr-useractivity: assuming manual start of VDR"); + return false; + } + else { + dsyslog("vdr-useractivity: scheduled wakeup time in %ld minutes, assuming automatic start of VDR", Delta / 60); + return true; + } +} + +void cUserActivity::Action(void) { + int inactivity; + while (Running()) { + if(sleep->Wait(SLEEPSECCONDS * 1000)) + break; + inactivity = min(GetUserInactivity(), MinIdleTime()); + if(inactivity < 0) { + dsyslog("vdr-useractivity: invalid inactivity = %d", inactivity); + Stop(); + break; + } + if(inactivity < lastInactivity) + { dsyslog("vdr-useractivity: activity detected, inactivity = %d, lastInactivity = %d", inactivity, lastInactivity); + Stop(); + break; + } + lastInactivity = inactivity; + } +} + bool cUserActivity::ActiveUsers(void) { + if(automatic) + return false; + struct utmp *uptr; int idle; bool result=false; @@ -103,11 +169,16 @@ bool cUserActivity::ActiveUsers(void) { return result; } +void cUserActivity::Stop(void) { + automatic = false; + sleep->Signal(); + if(Running()) + Cancel(3); +} + void cUserActivity::SetMinUserInactivity(int minutes) { Setup.MinUserInactivity = minutes; -#if VDRVERSNUM >= 10501 ShutdownHandler.SetUserInactiveTimeout(); -#endif } int cUserActivity::GetMinUserInactivity(void) { @@ -120,9 +191,7 @@ char *cUserActivity::GetUsers(void) { using namespace std; stringstream stream; -#if VDRVERSNUM >= 10501 stream << "VDR user has been inactive " << GetUserInactivity() << " minutes." << endl; -#endif stream << "USER DEVICE IDLE HOST" << endl; setutent(); while((uptr = getutent())!=NULL) { @@ -146,7 +215,6 @@ char *cUserActivity::GetUsers(void) { return result; } -#if VDRVERSNUM >= 10501 int cUserActivity::GetUserInactivity(void) { return GetMinUserInactivity() ? GetMinUserInactivity() - 1 - @@ -156,5 +224,4 @@ int cUserActivity::GetUserInactivity(void) { void cUserActivity::UserActivity(void) { ShutdownHandler.SetUserInactiveTimeout(); } -#endif @@ -10,23 +10,33 @@ #define _USERACTILITY_ACTIVITY_H #include <utmp.h> +#include <vdr/thread.h> -class cUserActivity { +class cUserActivity : public cThread { private: + bool automatic; + int lastInactivity; + cCondWait *sleep; #ifdef USE_XSS static int DisplayIdleTime(char *display); #endif static int DeviceIdleTime(char *device); static int IdleTime(struct utmp *uptr); + static int MinIdleTime(); + static bool AutomaticStart(); + protected: + virtual void Action(void); public: - static bool ActiveUsers(void); + cUserActivity(); + ~cUserActivity(); + bool ActiveUsers(void); + bool IsAutomatic(void) { return automatic; } + void Stop(void); static void SetMinUserInactivity(int minutes); static int GetMinUserInactivity(void); static char *GetUsers(void); -#if VDRVERSNUM >= 10501 static int GetUserInactivity(void); static void UserActivity(void); -#endif }; #endif diff --git a/i18n-template.c b/i18n-template.c deleted file mode 100644 index a2d69c0..0000000 --- a/i18n-template.c +++ /dev/null @@ -1,17 +0,0 @@ -/* - * i18n.c: Internationalization - * - * See the README file for copyright information and how to reach the author. - * - * $Id:$ - */ - -#include "i18n.h" - -#if VDRVERSNUM < 10507 -const tI18nPhrase Phrases[] = { -// START I18N -// END I18N - { NULL } - }; -#endif @@ -1,79 +0,0 @@ -/* - * i18n.c: Internationalization - * - * See the README file for copyright information and how to reach the author. - * - * $Id:$ - */ - -#include "i18n.h" - -const tI18nPhrase Phrases[] = { - { "Active users", - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "Aktiiviset käyttäjät", - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - }, - { "Prevents shutdown if there are active users", - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "Estää sammutuksen, jos järjestelmässä on aktiivisia käyttäjiä", - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - }, - { "There are active users in the system", - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "Järjestelmässä on aktiivisia käyttäjiä", - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - "",// TODO - }, - { NULL } - }; @@ -1,22 +0,0 @@ -/* - * i18n.h: Internationalization - * - * See the README file for copyright information and how to reach the author. - * - * $Id:$ - */ - -#ifndef _I18N__H -#define _I18N__H - -#include <vdr/i18n.h> - -#ifndef trNOOP -#define trNOOP(s) (s) -#endif - -#if VDRVERSNUM < 10507 -extern const tI18nPhrase Phrases[]; -#endif - -#endif //_I18N__H diff --git a/po/ca_ES.po b/po/ca_ES.po deleted file mode 100644 index 92afc76..0000000 --- a/po/ca_ES.po +++ /dev/null @@ -1,30 +0,0 @@ -# VDR plugin language source file. -# Copyright (C) 2007 Klaus Schmidinger <kls@cadsoft.de> -# This file is distributed under the same license as the VDR package. -# Marc Rovira Vall <tm05462@salleURL.edu>, 2003 -# Ramon Roca <ramon.roca@xcombo.com>, 2003 -# Jordi Vilà <jvila@tinet.org>, 2003 -# -msgid "" -msgstr "" -"Project-Id-Version: VDR 1.5.7\n" -"Report-Msgid-Bugs-To: <timo@tolleri.net>\n" -"POT-Creation-Date: 2007-08-19 22:20+0300\n" -"PO-Revision-Date: 2007-08-19 22:15+0300\n" -"Last-Translator: Jordi Vilà <jvila@tinet.org>\n" -"Language-Team: <vdr@linuxtv.org>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=ISO-8859-1\n" -"Content-Transfer-Encoding: 8bit\n" - -#: useractivity.c:14 -msgid "Prevents shutdown if there are active users" -msgstr "" - -#: useractivity.c:16 -msgid "Active users" -msgstr "" - -#: useractivity.c:103 -msgid "There are active users in the system" -msgstr "" diff --git a/po/cs_CZ.po b/po/cs_CZ.po deleted file mode 100644 index c5620b6..0000000 --- a/po/cs_CZ.po +++ /dev/null @@ -1,28 +0,0 @@ -# VDR plugin language source file. -# Copyright (C) 2007 Klaus Schmidinger <kls@cadsoft.de> -# This file is distributed under the same license as the VDR package. -# Vladimír Bárta <vladimir.barta@k2atmitec.cz>, 2006 -# -msgid "" -msgstr "" -"Project-Id-Version: VDR 1.5.7\n" -"Report-Msgid-Bugs-To: <timo@tolleri.net>\n" -"POT-Creation-Date: 2007-08-19 22:20+0300\n" -"PO-Revision-Date: 2007-08-19 22:15+0300\n" -"Last-Translator: Vladimír Bárta <vladimir.barta@k2atmitec.cz>\n" -"Language-Team: <vdr@linuxtv.org>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=ISO-8859-2\n" -"Content-Transfer-Encoding: 8bit\n" - -#: useractivity.c:14 -msgid "Prevents shutdown if there are active users" -msgstr "" - -#: useractivity.c:16 -msgid "Active users" -msgstr "" - -#: useractivity.c:103 -msgid "There are active users in the system" -msgstr "" diff --git a/po/da_DK.po b/po/da_DK.po deleted file mode 100644 index f3c2014..0000000 --- a/po/da_DK.po +++ /dev/null @@ -1,28 +0,0 @@ -# VDR plugin language source file. -# Copyright (C) 2007 Klaus Schmidinger <kls@cadsoft.de> -# This file is distributed under the same license as the VDR package. -# Mogens Elneff <mogens@elneff.dk>, 2004 -# -msgid "" -msgstr "" -"Project-Id-Version: VDR 1.5.7\n" -"Report-Msgid-Bugs-To: <timo@tolleri.net>\n" -"POT-Creation-Date: 2007-08-19 22:20+0300\n" -"PO-Revision-Date: 2007-08-19 22:15+0300\n" -"Last-Translator: Mogens Elneff <mogens@elneff.dk>\n" -"Language-Team: <vdr@linuxtv.org>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=ISO-8859-15\n" -"Content-Transfer-Encoding: 8bit\n" - -#: useractivity.c:14 -msgid "Prevents shutdown if there are active users" -msgstr "" - -#: useractivity.c:16 -msgid "Active users" -msgstr "" - -#: useractivity.c:103 -msgid "There are active users in the system" -msgstr "" diff --git a/po/de_DE.po b/po/de_DE.po deleted file mode 100644 index 9c46bd1..0000000 --- a/po/de_DE.po +++ /dev/null @@ -1,28 +0,0 @@ -# VDR plugin language source file. -# Copyright (C) 2007 Klaus Schmidinger <kls@cadsoft.de> -# This file is distributed under the same license as the VDR package. -# Klaus Schmidinger <kls@cadsoft.de>, 2000 -# -msgid "" -msgstr "" -"Project-Id-Version: VDR 1.5.7\n" -"Report-Msgid-Bugs-To: <timo@tolleri.net>\n" -"POT-Creation-Date: 2007-08-19 22:20+0300\n" -"PO-Revision-Date: 2007-08-19 22:15+0300\n" -"Last-Translator: Klaus Schmidinger <kls@cadsoft.de>\n" -"Language-Team: <vdr@linuxtv.org>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=ISO-8859-15\n" -"Content-Transfer-Encoding: 8bit\n" - -#: useractivity.c:14 -msgid "Prevents shutdown if there are active users" -msgstr "" - -#: useractivity.c:16 -msgid "Active users" -msgstr "" - -#: useractivity.c:103 -msgid "There are active users in the system" -msgstr "" diff --git a/po/el_GR.po b/po/el_GR.po deleted file mode 100644 index 60762bd..0000000 --- a/po/el_GR.po +++ /dev/null @@ -1,28 +0,0 @@ -# VDR plugin language source file. -# Copyright (C) 2007 Klaus Schmidinger <kls@cadsoft.de> -# This file is distributed under the same license as the VDR package. -# Dimitrios Dimitrakos <mail@dimitrios.de>, 2002 -# -msgid "" -msgstr "" -"Project-Id-Version: VDR 1.5.7\n" -"Report-Msgid-Bugs-To: <timo@tolleri.net>\n" -"POT-Creation-Date: 2007-08-19 22:20+0300\n" -"PO-Revision-Date: 2007-08-19 22:15+0300\n" -"Last-Translator: Dimitrios Dimitrakos <mail@dimitrios.de>\n" -"Language-Team: <vdr@linuxtv.org>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=ISO-8859-7\n" -"Content-Transfer-Encoding: 8bit\n" - -#: useractivity.c:14 -msgid "Prevents shutdown if there are active users" -msgstr "" - -#: useractivity.c:16 -msgid "Active users" -msgstr "" - -#: useractivity.c:103 -msgid "There are active users in the system" -msgstr "" diff --git a/po/es_ES.po b/po/es_ES.po deleted file mode 100644 index e7fdf84..0000000 --- a/po/es_ES.po +++ /dev/null @@ -1,28 +0,0 @@ -# VDR plugin language source file. -# Copyright (C) 2007 Klaus Schmidinger <kls@cadsoft.de> -# This file is distributed under the same license as the VDR package. -# Ruben Nunez Francisco <ruben.nunez@tang-it.com>, 2002 -# -msgid "" -msgstr "" -"Project-Id-Version: VDR 1.5.7\n" -"Report-Msgid-Bugs-To: <timo@tolleri.net>\n" -"POT-Creation-Date: 2007-08-19 22:20+0300\n" -"PO-Revision-Date: 2007-08-19 22:15+0300\n" -"Last-Translator: Ruben Nunez Francisco <ruben.nunez@tang-it.com>\n" -"Language-Team: <vdr@linuxtv.org>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=ISO-8859-15\n" -"Content-Transfer-Encoding: 8bit\n" - -#: useractivity.c:14 -msgid "Prevents shutdown if there are active users" -msgstr "" - -#: useractivity.c:16 -msgid "Active users" -msgstr "" - -#: useractivity.c:103 -msgid "There are active users in the system" -msgstr "" diff --git a/po/et_EE.po b/po/et_EE.po deleted file mode 100644 index 6a7fdc0..0000000 --- a/po/et_EE.po +++ /dev/null @@ -1,28 +0,0 @@ -# VDR plugin language source file. -# Copyright (C) 2007 Klaus Schmidinger <kls@cadsoft.de> -# This file is distributed under the same license as the VDR package. -# Arthur Konovalov <kasjas@hot.ee>, 2004 -# -msgid "" -msgstr "" -"Project-Id-Version: VDR 1.5.7\n" -"Report-Msgid-Bugs-To: <timo@tolleri.net>\n" -"POT-Creation-Date: 2007-08-19 22:20+0300\n" -"PO-Revision-Date: 2007-08-19 22:15+0300\n" -"Last-Translator: Arthur Konovalov <kasjas@hot.ee>\n" -"Language-Team: <vdr@linuxtv.org>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=ISO-8859-13\n" -"Content-Transfer-Encoding: 8bit\n" - -#: useractivity.c:14 -msgid "Prevents shutdown if there are active users" -msgstr "" - -#: useractivity.c:16 -msgid "Active users" -msgstr "" - -#: useractivity.c:103 -msgid "There are active users in the system" -msgstr "" diff --git a/po/fi_FI.po b/po/fi_FI.po index ae3bcee..5f25832 100644 --- a/po/fi_FI.po +++ b/po/fi_FI.po @@ -2,30 +2,30 @@ # Copyright (C) 2007 Klaus Schmidinger <kls@cadsoft.de> # This file is distributed under the same license as the VDR package. # Hannu Savolainen <hannu@opensound.com>, 2002 -# Jaakko Hyvätti <jaakko@hyvatti.iki.fi>, 2002 +# Jaakko Hyvätti <jaakko@hyvatti.iki.fi>, 2002 # Niko Tarnanen <niko.tarnanen@hut.fi>, 2003 # Rolf Ahrenberg <rahrenbe@cc.hut.fi>, 2003 # msgid "" msgstr "" -"Project-Id-Version: VDR 1.5.7\n" +"Project-Id-Version: vdr-useractivity 0.1.0\n" "Report-Msgid-Bugs-To: <timo@tolleri.net>\n" -"POT-Creation-Date: 2007-08-19 22:20+0300\n" +"POT-Creation-Date: 2009-03-13 09:20+0200\n" "PO-Revision-Date: 2007-08-19 22:15+0300\n" -"Last-Translator: Rolf Ahrenberg <rahrenbe@cc.hut.fi>\n" +"Last-Translator: Timo Eskola <timo@tolleri.net>\n" "Language-Team: <vdr@linuxtv.org>\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=ISO-8859-15\n" +"Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: Finnish\n" +"X-Poedit-Country: FINLAND\n" +"X-Poedit-SourceCharset: utf-8\n" -#: useractivity.c:14 msgid "Prevents shutdown if there are active users" -msgstr "Estää sammutuksen, jos järjestelmässä on aktiivisia käyttäjiä" +msgstr "Estää sammutuksen, jos järjestelmässä on aktiivisia käyttäjiä" -#: useractivity.c:16 msgid "Active users" -msgstr "Aktiiviset käyttäjät" +msgstr "Aktiiviset käyttäjät" -#: useractivity.c:103 msgid "There are active users in the system" -msgstr "Järjestelmässä on aktiivisia käyttäjiä" +msgstr "Järjestelmässä on aktiivisia käyttäjiä" diff --git a/po/fr_FR.po b/po/fr_FR.po deleted file mode 100644 index c028a50..0000000 --- a/po/fr_FR.po +++ /dev/null @@ -1,31 +0,0 @@ -# VDR plugin language source file. -# Copyright (C) 2007 Klaus Schmidinger <kls@cadsoft.de> -# This file is distributed under the same license as the VDR package. -# Jean-Claude Repetto <jc@repetto.org>, 2001 -# Olivier Jacques <jacquesolivier@hotmail.com>, 2003 -# Gregoire Favre <greg@magma.unil.ch>, 2003 -# Nicolas Huillard <nhuillard@e-dition.fr>, 2005 -# -msgid "" -msgstr "" -"Project-Id-Version: VDR 1.5.7\n" -"Report-Msgid-Bugs-To: <timo@tolleri.net>\n" -"POT-Creation-Date: 2007-08-19 22:20+0300\n" -"PO-Revision-Date: 2007-08-19 22:15+0300\n" -"Last-Translator: Nicolas Huillard <nhuillard@e-dition.fr>\n" -"Language-Team: <vdr@linuxtv.org>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=ISO-8859-1\n" -"Content-Transfer-Encoding: 8bit\n" - -#: useractivity.c:14 -msgid "Prevents shutdown if there are active users" -msgstr "" - -#: useractivity.c:16 -msgid "Active users" -msgstr "" - -#: useractivity.c:103 -msgid "There are active users in the system" -msgstr "" diff --git a/po/hr_HR.po b/po/hr_HR.po deleted file mode 100644 index 2e1baa1..0000000 --- a/po/hr_HR.po +++ /dev/null @@ -1,29 +0,0 @@ -# VDR plugin language source file. -# Copyright (C) 2007 Klaus Schmidinger <kls@cadsoft.de> -# This file is distributed under the same license as the VDR package. -# Drazen Dupor <drazen.dupor@dupor.com>, 2004 -# Dino Ravnic <dino.ravnic@fer.hr>, 2004 -# -msgid "" -msgstr "" -"Project-Id-Version: VDR 1.5.7\n" -"Report-Msgid-Bugs-To: <timo@tolleri.net>\n" -"POT-Creation-Date: 2007-08-19 22:20+0300\n" -"PO-Revision-Date: 2007-08-19 22:15+0300\n" -"Last-Translator: Drazen Dupor <drazen.dupor@dupor.com>\n" -"Language-Team: <vdr@linuxtv.org>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=ISO-8859-2\n" -"Content-Transfer-Encoding: 8bit\n" - -#: useractivity.c:14 -msgid "Prevents shutdown if there are active users" -msgstr "" - -#: useractivity.c:16 -msgid "Active users" -msgstr "" - -#: useractivity.c:103 -msgid "There are active users in the system" -msgstr "" diff --git a/po/hu_HU.po b/po/hu_HU.po deleted file mode 100644 index b738818..0000000 --- a/po/hu_HU.po +++ /dev/null @@ -1,29 +0,0 @@ -# VDR plugin language source file. -# Copyright (C) 2007 Klaus Schmidinger <kls@cadsoft.de> -# This file is distributed under the same license as the VDR package. -# Istvan Koenigsberger <istvnko@hotmail.com>, 2002 -# Guido Josten <guido.josten@t-online.de>, 2002 -# -msgid "" -msgstr "" -"Project-Id-Version: VDR 1.5.7\n" -"Report-Msgid-Bugs-To: <timo@tolleri.net>\n" -"POT-Creation-Date: 2007-08-19 22:20+0300\n" -"PO-Revision-Date: 2007-08-19 22:15+0300\n" -"Last-Translator: Istvan Koenigsberger <istvnko@hotmail.com>, Guido Josten <guido.josten@t-online.de>\n" -"Language-Team: <vdr@linuxtv.org>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=ISO-8859-2\n" -"Content-Transfer-Encoding: 8bit\n" - -#: useractivity.c:14 -msgid "Prevents shutdown if there are active users" -msgstr "" - -#: useractivity.c:16 -msgid "Active users" -msgstr "" - -#: useractivity.c:103 -msgid "There are active users in the system" -msgstr "" diff --git a/po/it_IT.po b/po/it_IT.po index a3654e7..7f54f0b 100644 --- a/po/it_IT.po +++ b/po/it_IT.po @@ -7,24 +7,27 @@ # msgid "" msgstr "" -"Project-Id-Version: VDR 1.5.7\n" +"Project-Id-Version: vdr-useractivity 0.1.0\n" "Report-Msgid-Bugs-To: <timo@tolleri.net>\n" "POT-Creation-Date: 2007-08-19 22:20+0300\n" -"PO-Revision-Date: 2007-08-19 22:15+0300\n" -"Last-Translator: Sean Carlos <seanc@libero.it>\n" -"Language-Team: <vdr@linuxtv.org>\n" +"PO-Revision-Date: 2009-02-10 23:28+0100\n" +"Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n" +"Language-Team: <vdr@linuxtv.org>\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=ISO-8859-15\n" +"Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: Italian\n" +"X-Poedit-Country: ITALY\n" +"X-Poedit-SourceCharset: utf-8\n" #: useractivity.c:14 msgid "Prevents shutdown if there are active users" -msgstr "" +msgstr "Previene lo spegnimento se esistono utenti attivi" #: useractivity.c:16 msgid "Active users" -msgstr "" +msgstr "Utenti attivi" #: useractivity.c:103 msgid "There are active users in the system" -msgstr "" +msgstr "Esistono utenti attivi nel sistema" diff --git a/po/nl_NL.po b/po/nl_NL.po deleted file mode 100644 index 589f0f4..0000000 --- a/po/nl_NL.po +++ /dev/null @@ -1,30 +0,0 @@ -# VDR plugin language source file. -# Copyright (C) 2007 Klaus Schmidinger <kls@cadsoft.de> -# This file is distributed under the same license as the VDR package. -# Arnold Niessen <niessen@iae.nl> <arnold.niessen@philips.com>, 2001 -# Hans Dingemans <hans.dingemans@tacticalops.nl>, 2003 -# Maarten Wisse <Maarten.Wisse@urz.uni-hd.de>, 2005 -# -msgid "" -msgstr "" -"Project-Id-Version: VDR 1.5.7\n" -"Report-Msgid-Bugs-To: <timo@tolleri.net>\n" -"POT-Creation-Date: 2007-08-19 22:20+0300\n" -"PO-Revision-Date: 2007-08-19 22:15+0300\n" -"Last-Translator: Maarten Wisse <Maarten.Wisse@urz.uni-hd.de>\n" -"Language-Team: <vdr@linuxtv.org>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=ISO-8859-15\n" -"Content-Transfer-Encoding: 8bit\n" - -#: useractivity.c:14 -msgid "Prevents shutdown if there are active users" -msgstr "" - -#: useractivity.c:16 -msgid "Active users" -msgstr "" - -#: useractivity.c:103 -msgid "There are active users in the system" -msgstr "" diff --git a/po/nn_NO.po b/po/nn_NO.po deleted file mode 100644 index d84ffe5..0000000 --- a/po/nn_NO.po +++ /dev/null @@ -1,29 +0,0 @@ -# VDR plugin language source file. -# Copyright (C) 2007 Klaus Schmidinger <kls@cadsoft.de> -# This file is distributed under the same license as the VDR package. -# Jørgen Tvedt <pjtvedt@online.no>, 2001 -# Truls Slevigen <truls@slevigen.no>, 2002 -# -msgid "" -msgstr "" -"Project-Id-Version: VDR 1.5.7\n" -"Report-Msgid-Bugs-To: <timo@tolleri.net>\n" -"POT-Creation-Date: 2007-08-19 22:20+0300\n" -"PO-Revision-Date: 2007-08-19 22:15+0300\n" -"Last-Translator: Truls Slevigen <truls@slevigen.no>\n" -"Language-Team: <vdr@linuxtv.org>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=ISO-8859-1\n" -"Content-Transfer-Encoding: 8bit\n" - -#: useractivity.c:14 -msgid "Prevents shutdown if there are active users" -msgstr "" - -#: useractivity.c:16 -msgid "Active users" -msgstr "" - -#: useractivity.c:103 -msgid "There are active users in the system" -msgstr "" diff --git a/po/pl_PL.po b/po/pl_PL.po deleted file mode 100644 index afa243b..0000000 --- a/po/pl_PL.po +++ /dev/null @@ -1,28 +0,0 @@ -# VDR plugin language source file. -# Copyright (C) 2007 Klaus Schmidinger <kls@cadsoft.de> -# This file is distributed under the same license as the VDR package. -# Michael Rakowski <mrak@gmx.de>, 2002 -# -msgid "" -msgstr "" -"Project-Id-Version: VDR 1.5.7\n" -"Report-Msgid-Bugs-To: <timo@tolleri.net>\n" -"POT-Creation-Date: 2007-08-19 22:20+0300\n" -"PO-Revision-Date: 2007-08-19 22:15+0300\n" -"Last-Translator: Michael Rakowski <mrak@gmx.de>\n" -"Language-Team: <vdr@linuxtv.org>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=ISO-8859-2\n" -"Content-Transfer-Encoding: 8bit\n" - -#: useractivity.c:14 -msgid "Prevents shutdown if there are active users" -msgstr "" - -#: useractivity.c:16 -msgid "Active users" -msgstr "" - -#: useractivity.c:103 -msgid "There are active users in the system" -msgstr "" diff --git a/po/pt_PT.po b/po/pt_PT.po deleted file mode 100644 index d6c4324..0000000 --- a/po/pt_PT.po +++ /dev/null @@ -1,28 +0,0 @@ -# VDR plugin language source file. -# Copyright (C) 2007 Klaus Schmidinger <kls@cadsoft.de> -# This file is distributed under the same license as the VDR package. -# Paulo Lopes <pmml@netvita.pt>, 2001 -# -msgid "" -msgstr "" -"Project-Id-Version: VDR 1.5.7\n" -"Report-Msgid-Bugs-To: <timo@tolleri.net>\n" -"POT-Creation-Date: 2007-08-19 22:20+0300\n" -"PO-Revision-Date: 2007-08-19 22:15+0300\n" -"Last-Translator: Paulo Lopes <pmml@netvita.pt>\n" -"Language-Team: <vdr@linuxtv.org>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=ISO-8859-1\n" -"Content-Transfer-Encoding: 8bit\n" - -#: useractivity.c:14 -msgid "Prevents shutdown if there are active users" -msgstr "" - -#: useractivity.c:16 -msgid "Active users" -msgstr "" - -#: useractivity.c:103 -msgid "There are active users in the system" -msgstr "" diff --git a/po/ro_RO.po b/po/ro_RO.po deleted file mode 100644 index 08515ef..0000000 --- a/po/ro_RO.po +++ /dev/null @@ -1,29 +0,0 @@ -# VDR plugin language source file. -# Copyright (C) 2007 Klaus Schmidinger <kls@cadsoft.de> -# This file is distributed under the same license as the VDR package. -# Paul Lacatus <paul@campina.iiruc.ro>, 2002 -# Lucian Muresan <lucianm@users.sourceforge.net>, 2004 -# -msgid "" -msgstr "" -"Project-Id-Version: VDR 1.5.7\n" -"Report-Msgid-Bugs-To: <timo@tolleri.net>\n" -"POT-Creation-Date: 2007-08-19 22:20+0300\n" -"PO-Revision-Date: 2007-08-19 22:15+0300\n" -"Last-Translator: Lucian Muresan <lucianm@users.sourceforge.net>\n" -"Language-Team: <vdr@linuxtv.org>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=ISO-8859-2\n" -"Content-Transfer-Encoding: 8bit\n" - -#: useractivity.c:14 -msgid "Prevents shutdown if there are active users" -msgstr "" - -#: useractivity.c:16 -msgid "Active users" -msgstr "" - -#: useractivity.c:103 -msgid "There are active users in the system" -msgstr "" diff --git a/po/ru_RU.po b/po/ru_RU.po deleted file mode 100644 index 3353176..0000000 --- a/po/ru_RU.po +++ /dev/null @@ -1,28 +0,0 @@ -# VDR plugin language source file. -# Copyright (C) 2007 Klaus Schmidinger <kls@cadsoft.de> -# This file is distributed under the same license as the VDR package. -# Vyacheslav Dikonov <sdiconov@mail.ru>, 2004 -# -msgid "" -msgstr "" -"Project-Id-Version: VDR 1.5.7\n" -"Report-Msgid-Bugs-To: <timo@tolleri.net>\n" -"POT-Creation-Date: 2007-08-19 22:20+0300\n" -"PO-Revision-Date: 2007-08-19 22:15+0300\n" -"Last-Translator: Vyacheslav Dikonov <sdiconov@mail.ru>\n" -"Language-Team: <vdr@linuxtv.org>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=ISO-8859-5\n" -"Content-Transfer-Encoding: 8bit\n" - -#: useractivity.c:14 -msgid "Prevents shutdown if there are active users" -msgstr "" - -#: useractivity.c:16 -msgid "Active users" -msgstr "" - -#: useractivity.c:103 -msgid "There are active users in the system" -msgstr "" diff --git a/po/sl_SI.po b/po/sl_SI.po deleted file mode 100644 index 94871df..0000000 --- a/po/sl_SI.po +++ /dev/null @@ -1,29 +0,0 @@ -# VDR plugin language source file. -# Copyright (C) 2007 Klaus Schmidinger <kls@cadsoft.de> -# This file is distributed under the same license as the VDR package. -# Miha Setina <mihasetina@softhome.net>, 2000 -# Matjaz Thaler <matjaz.thaler@guest.arnes.si>, 2003 -# -msgid "" -msgstr "" -"Project-Id-Version: VDR 1.5.7\n" -"Report-Msgid-Bugs-To: <timo@tolleri.net>\n" -"POT-Creation-Date: 2007-08-19 22:20+0300\n" -"PO-Revision-Date: 2007-08-19 22:15+0300\n" -"Last-Translator: Matjaz Thaler <matjaz.thaler@guest.arnes.si>\n" -"Language-Team: <vdr@linuxtv.org>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=ISO-8859-2\n" -"Content-Transfer-Encoding: 8bit\n" - -#: useractivity.c:14 -msgid "Prevents shutdown if there are active users" -msgstr "" - -#: useractivity.c:16 -msgid "Active users" -msgstr "" - -#: useractivity.c:103 -msgid "There are active users in the system" -msgstr "" diff --git a/po/sv_SE.po b/po/sv_SE.po deleted file mode 100644 index dd527db..0000000 --- a/po/sv_SE.po +++ /dev/null @@ -1,29 +0,0 @@ -# VDR plugin language source file. -# Copyright (C) 2007 Klaus Schmidinger <kls@cadsoft.de> -# This file is distributed under the same license as the VDR package. -# Tomas Prybil <tomas@prybil.se>, 2002 -# Jan Ekholm <chakie@infa.abo.fi>, 2003 -# -msgid "" -msgstr "" -"Project-Id-Version: VDR 1.5.7\n" -"Report-Msgid-Bugs-To: <timo@tolleri.net>\n" -"POT-Creation-Date: 2007-08-19 22:20+0300\n" -"PO-Revision-Date: 2007-08-19 22:15+0300\n" -"Last-Translator: Tomas Prybil <tomas@prybil.se>\n" -"Language-Team: <vdr@linuxtv.org>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=ISO-8859-1\n" -"Content-Transfer-Encoding: 8bit\n" - -#: useractivity.c:14 -msgid "Prevents shutdown if there are active users" -msgstr "" - -#: useractivity.c:16 -msgid "Active users" -msgstr "" - -#: useractivity.c:103 -msgid "There are active users in the system" -msgstr "" diff --git a/po/tr_TR.po b/po/tr_TR.po deleted file mode 100644 index 8bd3795..0000000 --- a/po/tr_TR.po +++ /dev/null @@ -1,28 +0,0 @@ -# VDR plugin language source file. -# Copyright (C) 2007 Klaus Schmidinger <kls@cadsoft.de> -# This file is distributed under the same license as the VDR package. -# Oktay Yolgeçen <oktay_73@yahoo.de>, 2007 -# -msgid "" -msgstr "" -"Project-Id-Version: VDR 1.5.7\n" -"Report-Msgid-Bugs-To: <timo@tolleri.net>\n" -"POT-Creation-Date: 2007-08-19 22:20+0300\n" -"PO-Revision-Date: 2007-08-19 22:15+0300\n" -"Last-Translator: Oktay Yolgeçen <oktay_73@yahoo.de>\n" -"Language-Team: <vdr@linuxtv.org>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=ISO-8859-9\n" -"Content-Transfer-Encoding: 8bit\n" - -#: useractivity.c:14 -msgid "Prevents shutdown if there are active users" -msgstr "" - -#: useractivity.c:16 -msgid "Active users" -msgstr "" - -#: useractivity.c:103 -msgid "There are active users in the system" -msgstr "" diff --git a/po2i18n.pl b/po2i18n.pl deleted file mode 100755 index 7ea3119..0000000 --- a/po2i18n.pl +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/perl -# -# po2i18n - Convert plugin po files in into i18n.c-format -# -# See the README file for copyright information and how to reach the author. -# - -use strict; -use warnings; - -my @LANGS = ( - "en_US", - "de_DE", - "sl_SI", - "it_IT", - "nl_NL", - "pt_PT", - "fr_FR", - "nn_NO", - "fi_FI", - "pl_PL", - "es_ES", - "el_GR", - "sv_SE", - "ro_RO", - "hu_HU", - "ca_ES", - "ru_RU", - "hr_HR", - "et_EE", - "da_DK", - "cs_CZ", - "tr_TR" - ); - -my %VERS = ( - "en_US" => 10200, - "de_DE" => 10200, - "sl_SI" => 10200, - "it_IT" => 10200, - "nl_NL" => 10200, - "pt_PT" => 10200, - "fr_FR" => 10200, - "nn_NO" => 10200, - "fi_FI" => 10200, - "pl_PL" => 10200, - "es_ES" => 10200, - "el_GR" => 10200, - "sv_SE" => 10200, - "ro_RO" => 10200, - "hu_HU" => 10200, - "ca_ES" => 10200, - "ru_RU" => 10302, - "hr_HR" => 10307, - "et_EE" => 10313, - "da_DK" => 10316, - "cs_CZ" => 10342, - "tr_TR" => 10502 - ); - - -my %strings; - -foreach my $lang (@LANGS) { $strings{$lang} = { }; } - - -sub LoadLanguage(*) { - my ($lang) = @_; - - if (!open FILE, "<", "po/$lang.po") { - return 0; - } - - my $msgid = ""; - while (<FILE>) { - chomp; - my $line = $_; - - if ($line =~ /^msgid "(.*)"$/) { - $msgid = $1; - } elsif ($line =~ /^msgstr "(.*)"$/) { - my $msgstr = $1; - $strings{$lang}->{$msgid} = $msgstr; - $strings{"en_US"}->{$msgid} = $msgid; - } - } - - close FILE; -} - - - -foreach my $lang (@LANGS) { - LoadLanguage($lang); -} - -my @msgids = sort keys %{$strings{"en_US"}}; - - -my $silent = 0; - -while (<>) { - my $line = $_; - - if ($line =~ /^\/\/ START I18N/) { - print "// START I18N - automatically generated by po2i18n.pl\n"; - for my $msgid (@msgids) { - next if $msgid eq ""; - - my $head = " { "; - my $endif = ""; - my $versnum = 10200; - - for my $lang (@LANGS) { - if ($VERS{$lang} ne $versnum) { - $versnum = $VERS{$lang}; - print $endif; - print "#if VDRVERSNUM >= $versnum\n"; - $endif = "#endif\n"; - } - my $msgstr = $strings{$lang}->{$msgid}; - $msgstr = "" if !defined $msgstr; - - print "$head\"$msgstr\",\n"; - $head = " "; - } - print $endif; - print " },\n"; - } - $silent = 1; - } - - if (!$silent) { print $line; } - - if ($line =~ /^\/\/ END I18N/) { - print "// END I18N - automatically generated by po2i18n.pl\n"; - $silent = 0; - } -} diff --git a/useractivity.c b/useractivity.c index 86f42f9..00eb352 100644 --- a/useractivity.c +++ b/useractivity.c @@ -7,10 +7,13 @@ */ #include <vdr/plugin.h> -#include "i18n.h" #include "activity.h" -static const char *VERSION = "0.0.4"; +#if defined(APIVERSNUM) && APIVERSNUM < 10600 +#error "VDR-1.6.0 API version or greater is required!" +#endif + +static const char *VERSION = "0.1.0"; static const char *DESCRIPTION = trNOOP("Prevents shutdown if there are active users"); #if 0 static const char *MAINMENUENTRY = trNOOP("Active users"); @@ -19,6 +22,7 @@ static const char *MAINMENUENTRY = trNOOP("Active users"); class cPluginUseractivity : public cPlugin { private: // Add any member variables or functions you may need here. + cUserActivity *activity; public: cPluginUseractivity(void); virtual ~cPluginUseractivity(); @@ -46,11 +50,13 @@ cPluginUseractivity::cPluginUseractivity(void) // Initialize any member variables here. // DON'T DO ANYTHING ELSE THAT MAY HAVE SIDE EFFECTS, REQUIRE GLOBAL // VDR OBJECTS TO EXIST OR PRODUCE ANY OUTPUT! + activity = NULL; } cPluginUseractivity::~cPluginUseractivity() { // Clean up after yourself! + delete activity; } const char *cPluginUseractivity::CommandLineHelp(void) @@ -74,15 +80,16 @@ bool cPluginUseractivity::Initialize(void) bool cPluginUseractivity::Start(void) { // Start any background activities the plugin shall perform. -#if VDRVERSNUM < 10507 - RegisterI18n(Phrases); -#endif + activity = new cUserActivity(); + if(activity->IsAutomatic()) + activity->Start(); return true; } void cPluginUseractivity::Stop(void) { // Stop any background activities the plugin shall perform. + activity->Stop(); } void cPluginUseractivity::Housekeeping(void) @@ -99,7 +106,7 @@ void cPluginUseractivity::MainThreadHook(void) cString cPluginUseractivity::Active(void) { // Return a message string if shutdown should be postponed - if(cUserActivity::ActiveUsers()) + if(activity->ActiveUsers()) return tr("There are active users in the system"); else return NULL; @@ -137,10 +144,8 @@ const char **cPluginUseractivity::SVDRPHelpPages(void) " Display minimum user inactivity in minutes.", "LSTU\n" " Display a list of users.", -#if VDRVERSNUM >= 10501 "SETA\n" - " Set VDR user activity.", -#endif + " Set VDR user active.", "SETI <minutes>\n" " Set minimum user inactivity in minutes.", NULL @@ -153,24 +158,18 @@ cString cPluginUseractivity::SVDRPCommand(const char *Command, const char *Optio // Process SVDRP commands this plugin implements if (strcasecmp(Command, "GETI") == 0) { // we use the default reply code here -#if VDRVERSNUM >= 10501 return cString::sprintf("Minimum user inactivity is %d minutes.\nVDR user has been inactive %d minutes.", cUserActivity::GetMinUserInactivity(), cUserActivity::GetUserInactivity()); -#else - return cString::sprintf("Minimum user inactivity is %d minutes.", cUserActivity::GetMinUserInactivity()); -#endif } else if (strcasecmp(Command, "LSTU") == 0) { // we use the default reply code here return cString(cUserActivity::GetUsers()); } -#if VDRVERSNUM >= 10501 else if (strcasecmp(Command, "SETA") == 0) { // we use the default reply code here cUserActivity::UserActivity(); return cString::sprintf("VDR user set active."); -} -#endif + } else if (strcasecmp(Command, "SETI") == 0) { ReplyCode = 501; if (*Option) { |