]> www.vanbest.org Git - sasc-ng.git/commitdiff
add user message display to OSD
authorleslie <unknown>
Mon, 7 Jan 2008 21:17:06 +0000 (22:17 +0100)
committerleslie <unknown>
Mon, 7 Jan 2008 21:17:06 +0000 (22:17 +0100)
13 files changed:
data.c
log.c
log.h
po/de_DE.po
po/fi_FI.po
po/fr_FR.po
po/hu_HU.po
po/it_IT.po
po/nl_NL.po
po/pl_PL.po
po/ru_RU.po
po/sv_SE.po
sc.c

diff --git a/data.c b/data.c
index ad4925e74cf292d268a49061d1ea6bf8da995ee6..42e9c73476d53ec3a5c1aebc4cbe7ae01e019ec0 100644 (file)
--- a/data.c
+++ b/data.c
@@ -29,6 +29,7 @@
 #include "misc.h"
 #include "scsetup.h"
 #include "log-core.h"
+#include "i18n.h"
 
 #define KEY_FILE     "SoftCam.Key"
 #define EXT_AU_INT   (15*60*1000) // ms interval for external AU
@@ -883,7 +884,9 @@ bool cPlainKeys::AddNewKey(cPlainKey *nk, const char *reason)
     if(k->Cmp(nk)) return false;
 
   cPlainKey *ref=0;
-  PRINTF(L_GEN_INFO,"key update for ID %s",*nk->ToString(true));
+  cString ks=nk->ToString(true);
+  PRINTF(L_GEN_INFO,"key update for ID %s",*ks);
+  ums.Queue("%s %s",tr("Key update"),*ks);
   for(k=0; (k=FindKeyNoTrig(nk->type,nk->id,nk->keynr,nk->Size(),k)); ) {
     if(nk->CanSupersede()) {
       PRINTF(L_GEN_INFO,"supersedes key: %s",*k->ToString(true));
diff --git a/log.c b/log.c
index 170d4da1fc246960e3ea72b65ff285dc41a78b7b..b8c4c07823853ade32401f96ab5579027e253ef2 100644 (file)
--- a/log.c
+++ b/log.c
@@ -38,7 +38,7 @@ struct LogHeader {
   };
 
 struct LogConfig logcfg = {
-  1,0,0,
+  1,0,0,0,
   0,
   "/var/log/vdr-sc"
   };
@@ -396,6 +396,55 @@ int cLogging::GetClassByName(const char *name)
   return -1;  
 }
 
+// -- cUserMsg -----------------------------------------------------------------
+
+cUserMsg::cUserMsg(const char *m)
+{
+  msg=strdup(m);
+}
+
+cUserMsg::~cUserMsg()
+{
+  free(msg);
+}
+
+// -- cUserMsgs ----------------------------------------------------------------
+
+cUserMsgs ums;
+
+cUserMsgs::cUserMsgs(void)
+{
+  mutex=new cMutex;
+}
+
+cUserMsgs::~cUserMsgs()
+{
+  delete mutex;
+}
+
+void cUserMsgs::Queue(const char *fmt, ...)
+{
+  if(logcfg.logUser) {
+    char buff[1024];
+    va_list ap;
+    va_start(ap,fmt);
+    vsnprintf(buff,sizeof(buff),fmt,ap);
+    va_end(ap);
+    mutex->Lock();
+    Add(new cUserMsg(buff));
+    mutex->Unlock();
+    }
+}
+
+cUserMsg *cUserMsgs::GetQueuedMsg(void)
+{
+  mutex->Lock();
+  cUserMsg *um=First();
+  if(um) Del(um,false);
+  mutex->Unlock();
+  return um;
+}
+
 // -- cLogLineBuff -------------------------------------------------------------
 
 cLogLineBuff::cLogLineBuff(int C)
diff --git a/log.h b/log.h
index 38fa86b644586e0c12be711e94c6e027a5bd44c1..e523f3499a2285e90dd591bcb8e7118f677a020a 100644 (file)
--- a/log.h
+++ b/log.h
@@ -22,6 +22,8 @@
 
 #include "misc.h"
 
+class cMutex;
+
 // ----------------------------------------------------------------
 
 #define LOPT_NUM    24
@@ -68,7 +70,7 @@
 // ----------------------------------------------------------------
 
 struct LogConfig {
-  int logCon, logFile, logSys;
+  int logCon, logFile, logSys, logUser;
   int maxFilesize;
   char logFilename[128];
   };
@@ -112,6 +114,31 @@ public:
 
 // ----------------------------------------------------------------
 
+class cUserMsg : public cSimpleItem {
+private:
+  char *msg;
+public:
+  cUserMsg(const char *m);
+  ~cUserMsg();
+  const char *Message(void) { return msg; };
+  };
+
+// ----------------------------------------------------------------
+
+class cUserMsgs : public cSimpleList<cUserMsg> {
+private:
+  cMutex *mutex;
+public:
+  cUserMsgs(void);
+  ~cUserMsgs();
+  void Queue(const char *fmt, ...) __attribute__ ((format (printf,2,3)));
+  cUserMsg *GetQueuedMsg(void);
+  };
+
+extern cUserMsgs ums;
+
+// ----------------------------------------------------------------
+
 class cLogLineBuff : public cLineBuff {
 private:
   int c;
index 6b231b96c1974bbaff44558c31e89fc32273c8b1..76e4e142bbeb402e3aaf885d194bea035080dc78 100644 (file)
@@ -6,7 +6,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: VDR 1.5.9\n"
 "Report-Msgid-Bugs-To: <noone@nowhere.org>\n"
-"POT-Creation-Date: 2007-12-19 18:49+0100\n"
+"POT-Creation-Date: 2008-01-07 22:10+0100\n"
 "PO-Revision-Date: 2007-08-27 12:45+0200\n"
 "Last-Translator: somebody\n"
 "Language-Team: somebody\n"
@@ -14,6 +14,9 @@ msgstr ""
 "Content-Type: text/plain; charset=ISO-8859-15\n"
 "Content-Transfer-Encoding: 8bit\n"
 
+msgid "Key update"
+msgstr "Key Update"
+
 msgid "off"
 msgstr "aus"
 
@@ -148,6 +151,9 @@ msgstr "Dateigr
 msgid "Log to syslog"
 msgstr "Meldungen in Syslog"
 
+msgid "Show user messages"
+msgstr "Benutzer Meldungen zeigen"
+
 msgid "A software emulated CAM"
 msgstr "Ein Software emuliertes CAM"
 
index 2447c7dc1ec19b4a2e306867017db9f63b026e5c..3482afce80083ebdc75120399707d34b607dd2d7 100644 (file)
@@ -6,7 +6,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: VDR 1.5.9\n"
 "Report-Msgid-Bugs-To: <noone@nowhere.org>\n"
-"POT-Creation-Date: 2007-12-19 18:52+0100\n"
+"POT-Creation-Date: 2008-01-07 22:10+0100\n"
 "PO-Revision-Date: 2007-08-27 12:45+0200\n"
 "Last-Translator: somebody\n"
 "Language-Team: somebody\n"
@@ -14,6 +14,9 @@ msgstr ""
 "Content-Type: text/plain; charset=ISO-8859-15\n"
 "Content-Transfer-Encoding: 8bit\n"
 
+msgid "Key update"
+msgstr ""
+
 msgid "off"
 msgstr "pois"
 
@@ -148,6 +151,9 @@ msgstr "Tiedoston maksimikoko (KB)"
 msgid "Log to syslog"
 msgstr "Tulosta systeemilokiin"
 
+msgid "Show user messages"
+msgstr ""
+
 msgid "A software emulated CAM"
 msgstr "Ohjelmistopohjainen salauksenpurku"
 
index 6fd88fe809e1f6b86bdb80869ab1f827a715dced..4e31102209a87079fb3eec9565e00331916f878b 100644 (file)
@@ -6,7 +6,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: VDR 1.5.9\n"
 "Report-Msgid-Bugs-To: <noone@nowhere.org>\n"
-"POT-Creation-Date: 2007-12-19 18:52+0100\n"
+"POT-Creation-Date: 2008-01-07 22:10+0100\n"
 "PO-Revision-Date: 2007-08-27 12:45+0200\n"
 "Last-Translator: somebody\n"
 "Language-Team: somebody\n"
@@ -14,6 +14,9 @@ msgstr ""
 "Content-Type: text/plain; charset=ISO-8859-1\n"
 "Content-Transfer-Encoding: 8bit\n"
 
+msgid "Key update"
+msgstr ""
+
 msgid "off"
 msgstr "off"
 
@@ -148,6 +151,9 @@ msgstr ""
 msgid "Log to syslog"
 msgstr ""
 
+msgid "Show user messages"
+msgstr ""
+
 msgid "A software emulated CAM"
 msgstr "Un logiciel emulateur de CAM"
 
index 9744b77e20bf83cd1fb84f9ff4f4aeee53c18dbd..7b76ea32d6e92b97eb27f70a3b8b53a433d2e66f 100644 (file)
@@ -6,7 +6,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: VDR 1.5.11\n"
 "Report-Msgid-Bugs-To: <noone@nowhere.org>\n"
-"POT-Creation-Date: 2007-12-19 18:52+0100\n"
+"POT-Creation-Date: 2008-01-07 22:10+0100\n"
 "PO-Revision-Date: 2007-11-01 16:45+0200\n"
 "Last-Translator: jv\n"
 "Language-Team: somebody\n"
@@ -14,6 +14,9 @@ msgstr ""
 "Content-Type: text/plain; charset=utf-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 
+msgid "Key update"
+msgstr ""
+
 msgid "off"
 msgstr "ki"
 
@@ -148,6 +151,9 @@ msgstr "Fileméret limit (KB)"
 msgid "Log to syslog"
 msgstr "Naplózás a rendszelogba"
 
+msgid "Show user messages"
+msgstr ""
+
 msgid "A software emulated CAM"
 msgstr "Szoftveresen emulált CAM"
 
index df9c34df0520b96f285a79811a574f45fd2d1cd5..1b75611ed5ec61154c294efd34bc365f2c7394c1 100644 (file)
@@ -6,7 +6,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: VDR 1.5.9\n"
 "Report-Msgid-Bugs-To: <noone@nowhere.org>\n"
-"POT-Creation-Date: 2007-12-19 18:52+0100\n"
+"POT-Creation-Date: 2008-01-07 22:10+0100\n"
 "PO-Revision-Date: 2007-08-27 12:45+0200\n"
 "Last-Translator: somebody\n"
 "Language-Team: somebody\n"
@@ -14,6 +14,9 @@ msgstr ""
 "Content-Type: text/plain; charset=ISO-8859-15\n"
 "Content-Transfer-Encoding: 8bit\n"
 
+msgid "Key update"
+msgstr ""
+
 msgid "off"
 msgstr "spento"
 
@@ -148,6 +151,9 @@ msgstr "Limite dimensione file (KB)"
 msgid "Log to syslog"
 msgstr "Log in Syslog"
 
+msgid "Show user messages"
+msgstr ""
+
 msgid "A software emulated CAM"
 msgstr "Un software di emulazione CAM"
 
@@ -200,4 +206,4 @@ msgid "SC-Seca: EMM updates"
 msgstr "SC-Seca: aggiornamenti EMM"
 
 msgid "SC-Seca: activate PPV"
-msgstr "SC-Seca: attiva PPV" 
+msgstr "SC-Seca: attiva PPV"
index 5cc85db35e56c6321c92f01a1a3c80d7059bf685..eb9e6b8d1d182cec40bc55bff43ac109416fc93a 100644 (file)
@@ -6,7 +6,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: VDR 1.5.9\n"
 "Report-Msgid-Bugs-To: <noone@nowhere.org>\n"
-"POT-Creation-Date: 2007-12-19 18:52+0100\n"
+"POT-Creation-Date: 2008-01-07 22:10+0100\n"
 "PO-Revision-Date: 2007-08-27 12:45+0200\n"
 "Last-Translator: somebody\n"
 "Language-Team: somebody\n"
@@ -14,6 +14,9 @@ msgstr ""
 "Content-Type: text/plain; charset=ISO-8859-15\n"
 "Content-Transfer-Encoding: 8bit\n"
 
+msgid "Key update"
+msgstr ""
+
 msgid "off"
 msgstr "uit"
 
@@ -148,6 +151,9 @@ msgstr ""
 msgid "Log to syslog"
 msgstr ""
 
+msgid "Show user messages"
+msgstr ""
+
 msgid "A software emulated CAM"
 msgstr "In software geëmuleerde CAM"
 
index 184cb325227e411d30e5bb6a68b638252b9dd746..709c7286563e5d17567923ccee354766dc5acf5c 100644 (file)
@@ -6,7 +6,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: VDR 1.5.9\n"
 "Report-Msgid-Bugs-To: <noone@nowhere.org>\n"
-"POT-Creation-Date: 2007-12-19 18:52+0100\n"
+"POT-Creation-Date: 2008-01-07 22:10+0100\n"
 "PO-Revision-Date: 2007-08-27 12:45+0200\n"
 "Last-Translator: somebody\n"
 "Language-Team: somebody\n"
@@ -14,6 +14,9 @@ msgstr ""
 "Content-Type: text/plain; charset=ISO-8859-2\n"
 "Content-Transfer-Encoding: 8bit\n"
 
+msgid "Key update"
+msgstr ""
+
 msgid "off"
 msgstr "wy³±cz"
 
@@ -148,6 +151,9 @@ msgstr ""
 msgid "Log to syslog"
 msgstr ""
 
+msgid "Show user messages"
+msgstr ""
+
 msgid "A software emulated CAM"
 msgstr "Programowo emulowany CAM"
 
index c1d6a193911267899adfb17d60c322cb6c813b0d..f370e5f3283098eb8779194d60ce3ff47872e48a 100644 (file)
@@ -6,7 +6,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: VDR 1.5.9\n"
 "Report-Msgid-Bugs-To: <noone@nowhere.org>\n"
-"POT-Creation-Date: 2007-12-19 18:52+0100\n"
+"POT-Creation-Date: 2008-01-07 22:10+0100\n"
 "PO-Revision-Date: 2008-01-03 14:21+0100\n"
 "Last-Translator: somebody\n"
 "Language-Team: ru\n"
@@ -15,6 +15,9 @@ msgstr ""
 "Content-Transfer-Encoding: 8bit\n"
 "X-Generator: KBabel 1.11.4\n"
 
+msgid "Key update"
+msgstr ""
+
 msgid "off"
 msgstr "ÒëÚÛ"
 
@@ -149,6 +152,9 @@ msgstr "
 msgid "Log to syslog"
 msgstr "ÁÞÞÑéÕÝØï Ò Syslog"
 
+msgid "Show user messages"
+msgstr ""
+
 msgid "A software emulated CAM"
 msgstr "¿àÞÓàÐÜÝëÙ íÜãÛïâÞà CAM"
 
index 04fcf04f53574d2a100d848c6f16895bffa1cafb..e424901731e6b90e5acba86358f67746995dc0d5 100644 (file)
@@ -6,7 +6,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: VDR 1.5.9\n"
 "Report-Msgid-Bugs-To: <noone@nowhere.org>\n"
-"POT-Creation-Date: 2007-12-19 18:52+0100\n"
+"POT-Creation-Date: 2008-01-07 22:10+0100\n"
 "PO-Revision-Date: 2007-08-27 12:45+0200\n"
 "Last-Translator: somebody\n"
 "Language-Team: somebody\n"
@@ -14,6 +14,9 @@ msgstr ""
 "Content-Type: text/plain; charset=ISO-8859-1\n"
 "Content-Transfer-Encoding: 8bit\n"
 
+msgid "Key update"
+msgstr ""
+
 msgid "off"
 msgstr "av"
 
@@ -148,6 +151,9 @@ msgstr ""
 msgid "Log to syslog"
 msgstr ""
 
+msgid "Show user messages"
+msgstr ""
+
 msgid "A software emulated CAM"
 msgstr "En mjukvaruemulerad CAM"
 
diff --git a/sc.c b/sc.c
index 50f2860739b05175490bbb5385658bdc25cb6144..33b64dfaa479db2d5ee09d34c457c9ee1bf9764a 100644 (file)
--- a/sc.c
+++ b/sc.c
@@ -1192,6 +1192,7 @@ public:
   virtual bool Start(void);
   virtual void Stop(void);
   virtual void Housekeeping(void);
+  virtual void MainThreadHook(void);
   virtual cMenuSetupPage *SetupMenu(void);
   virtual bool SetupParse(const char *Name, const char *Value);
   virtual const char **SVDRPHelpPages(void);
@@ -1209,12 +1210,13 @@ cScPlugin::cScPlugin(void)
   ScOpts->Add(new cOptBool ("LocalPriority",trNOOP("Prefer local systems") ,&ScSetup.LocalPriority));
   ScOpts->Add(new cOptMInt ("ScCaps"       ,trNOOP("Active on DVB card")   , ScSetup.ScCaps,MAXSCCAPS,0));
   ScOpts->Add(new cOptMInt ("CaIgnore"     ,trNOOP("Ignore CAID")          , ScSetup.CaIgnore,MAXCAIGN,2));
-  LogOpts=new cOpts(0,5);
+  LogOpts=new cOpts(0,6);
   LogOpts->Add(new cOptBool ("LogConsole"  ,trNOOP("Log to console")      ,&logcfg.logCon));
   LogOpts->Add(new cOptBool ("LogFile"     ,trNOOP("Log to file")         ,&logcfg.logFile));
   LogOpts->Add(new cOptStr  ("LogFileName" ,trNOOP("Filename")            ,logcfg.logFilename,sizeof(logcfg.logFilename),FileNameChars));
   LogOpts->Add(new cOptInt  ("LogFileLimit",trNOOP("Filesize limit (KB)") ,&logcfg.maxFilesize,0,2000000));
   LogOpts->Add(new cOptBool ("LogSyslog"   ,trNOOP("Log to syslog")       ,&logcfg.logSys));
+  LogOpts->Add(new cOptBool ("LogUserMsg"  ,trNOOP("Show user messages")  ,&logcfg.logUser));
 #ifndef STATICBUILD
   dlls.Load();
 #endif
@@ -1366,6 +1368,16 @@ void cScPlugin::Housekeeping(void)
   cSoftCAM::HouseKeeping();
 }
 
+void cScPlugin::MainThreadHook(void)
+{
+  int n=0;
+  cUserMsg *um;
+  while(++n<=10 && (um=ums.GetQueuedMsg())) {
+    Skins.QueueMessage(mtInfo,um->Message());
+    delete um;
+    }
+}
+
 const char **cScPlugin::SVDRPHelpPages(void)
 {
   static const char *HelpPages[] = {