summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Wieninger <cwieninger (at) gmx (dot) de>2008-04-03 22:39:14 +0200
committerChristian Wieninger <cwieninger (at) gmx (dot) de>2008-04-03 22:39:14 +0200
commit81419138d8d5ebfdc0494b3f29de88c2999a277d (patch)
tree49dfa35dbd826799e4e4f0a8636e4d224fab58bd
parent11db30edf64aa8fdcbadc9fd39082c9bd0b6d826 (diff)
downloadvdr-plugin-epgsearch-81419138d8d5ebfdc0494b3f29de88c2999a277d.tar.gz
vdr-plugin-epgsearch-81419138d8d5ebfdc0494b3f29de88c2999a277d.tar.bz2
support for VDRSymbols font, 0.9.24.beta26
spanish translation update
-rw-r--r--HISTORY4
-rw-r--r--HISTORY.DE4
-rw-r--r--doc-src/en/epgsearch.4.txt7
-rw-r--r--epgsearch.c24
-rw-r--r--epgsearch.h1
-rw-r--r--epgsearchtools.h27
-rw-r--r--menu_searchresults.c20
-rw-r--r--menu_whatson.c65
-rw-r--r--po/es_ES.po6
9 files changed, 130 insertions, 28 deletions
diff --git a/HISTORY b/HISTORY
index 006cc87..57d901b 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,7 +1,9 @@
VDR Plugin 'epgsearch' Revision History
---------------------------------------
-2007-xx-xx: Version 0.9.24
+2008-xx-xx: Version 0.9.24
new:
+- support for vdr-1.6.x
+- support for VDRSymbols font (activate it with 'WarEagle=1' in epgsearchmenu.conf)
- new SVDRP command 'LSCC' that returns the results of a timer conflict
check. See the MANUAL for details about the format of the result list.
- the EPG command 'Search in recordings' now evaluates the info.vdr instead of the
diff --git a/HISTORY.DE b/HISTORY.DE
index a01a579..a5c2de3 100644
--- a/HISTORY.DE
+++ b/HISTORY.DE
@@ -1,8 +1,10 @@
VDR Plugin 'epgsearch' Revision History
---------------------------------------
-2007-xx-xx: Version 0.9.24
+2008-xx-xx: Version 0.9.24
neu:
+- Unterstützung von vdr-1.6.x
+- Unterstützung des VDRSymbols-Font (aktivieren mit 'WarEagle=1' in epgsearchmenu.conf)
- neuer SVDRP-Befehl 'LSCC', der das Ergebnis einer Timerkonfliktprüfung
zurückgibt. Zum Format der Ergebnisliste bitte ins MANUAL schauen.
- der EPG-Befehl 'Suche in Aufnahmen' wertet nun die info.vdr anstelle des
diff --git a/doc-src/en/epgsearch.4.txt b/doc-src/en/epgsearch.4.txt
index 4a13933..5c3fbab 100644
--- a/doc-src/en/epgsearch.4.txt
+++ b/doc-src/en/epgsearch.4.txt
@@ -549,7 +549,8 @@ for the 'Whats on...' and 'Search results' menu there are also:
%chsh% - the short channel name (>=vdr-1.3.15)
%chlng% - the 'normal' channel name
%chdata% - VDR's internal channel representation (e.g. 'S19.2E-1-1101-28106')
- %progr% - graphical progress bar (not for menu 'Search results')
+ %progr% - graphical progress bar (not for menu 'Search results'),
+ requires VDRSymbols font for vdr>=1.5.3
%progrT2S% - progress bar in text2skin style (not for menu 'Search results')
some indepent variables:
@@ -586,7 +587,9 @@ To enable icons from WarEagleIcon-Patch simply put the line
WarEagleIcons=1
-to F<epgsearchmenu.conf>.
+to F<epgsearchmenu.conf>. This also works for vdr>=1.5.3, which uses true type fonts,
+if you have installed and selected the font VDRSymbols.ttf (available at
+http://andreas.vdr-developer.org/enigmang/download)
NOTE: As long as there is a file epgsearchmenu.conf with an entry for a special
menu, all setup settings regarding the look of this menu are ignored.
diff --git a/epgsearch.c b/epgsearch.c
index f39593e..58c0e98 100644
--- a/epgsearch.c
+++ b/epgsearch.c
@@ -66,13 +66,14 @@ The project's page is at http://winni.vdr-developer.org/epgsearch
#include "menu_announcelist.h"
#include "confdloader.h"
-static const char VERSION[] = "0.9.24.beta25";
+static const char VERSION[] = "0.9.24.beta26";
static const char DESCRIPTION[] = trNOOP("search the EPG for repeats and more");
// globals
char *ConfigDir = NULL;
bool reloadMenuConf = false;
int updateForced = 0;
+bool isUTF8 = false;
// LogFile declaration and statics
cLogFile LogFile;
@@ -456,9 +457,30 @@ bool cPluginEpgsearch::Start(void)
cSwitchTimerThread::Init();
cConflictCheckThread::Init(this);
+ CheckUTF8();
+
return true;
}
+void cPluginEpgsearch::CheckUTF8()
+{
+ // Taken from VDR's vdr.c
+ char *CodeSet = NULL;
+ if (setlocale(LC_CTYPE, ""))
+ CodeSet = nl_langinfo(CODESET);
+ else {
+ char *LangEnv = getenv("LANG"); // last resort in case locale stuff isn't installed
+ if (LangEnv) {
+ CodeSet = strchr(LangEnv, '.');
+ if (CodeSet)
+ CodeSet++; // skip the dot
+ }
+ }
+
+ if (CodeSet && strcasestr(CodeSet, "UTF-8") != 0)
+ isUTF8=true;
+}
+
void cPluginEpgsearch::Stop(void)
{
cSearchTimerThread::Exit();
diff --git a/epgsearch.h b/epgsearch.h
index 41da675..80b7b4f 100644
--- a/epgsearch.h
+++ b/epgsearch.h
@@ -52,6 +52,7 @@ public:
virtual cString SVDRPCommand(const char *Cmd, const char *Option, int &ReplyCode);
void LoadUserVars();
void LoadConfD();
+ void CheckUTF8();
};
#endif
diff --git a/epgsearchtools.h b/epgsearchtools.h
index 080eb80..d1f8cea 100644
--- a/epgsearchtools.h
+++ b/epgsearchtools.h
@@ -76,6 +76,33 @@ using std::string;
#define ISRADIO(x) ((x)->Vpid()==0||(x)->Vpid()==1||(x)->Vpid()==0x1fff)
+// Icons used in WarEagle and VDRSymbols-Font
+#define ICON_REC 0xF9
+#define ICON_RUNNING 0xFB
+#define ICON_CLOCK 0xFD
+#define ICON_CLOCK_HALF 0x74
+#define ICON_BAR_OPEN 0x82
+#define ICON_BAR_FULL 0xFF
+#define ICON_BAR_EMPTY 0x83
+#define ICON_BAR_CLOSE 0x84
+#define ICON_VPS 0x56
+
+
+// UTF-8 Icons
+#define ICON_BAR_OPEN_UTF8 "\uE007"
+#define ICON_BAR_FULL_UTF8 "\uE008"
+#define ICON_BAR_EMPTY_UTF8 "\uE009"
+#define ICON_BAR_CLOSE_UTF8 "\uE00A"
+#define ICON_REC_UTF8 "\uE00B"
+#define ICON_CLOCK_UTF8 "\uE00C"
+#define ICON_CLOCK_HALF_UTF8 "t"
+#define ICON_RUNNING_UTF8 "\uE012"
+#define ICON_VPS_UTF8 "V"
+
+#if APIVERSNUM < 10503
+#define Utf8BufSize(s) ((s) * 4)
+#endif
+
extern const char AllowedChars[];
extern char* ConfigDir;
diff --git a/menu_searchresults.c b/menu_searchresults.c
index 4bb34e5..d0b7b90 100644
--- a/menu_searchresults.c
+++ b/menu_searchresults.c
@@ -42,6 +42,7 @@ The project's page is at http://winni.vdr-developer.org/epgsearch
const char* ButtonBlue[3] = {NULL, NULL, NULL};
extern int gl_InfoConflict;
+extern bool isUTF8;
static int CompareRecording(const void *p1, const void *p2)
{
@@ -78,13 +79,22 @@ bool cMenuSearchResultsItem::Update(bool Force)
if (Force || timerMatch != OldTimerMatch)
{
- char t[2]="",v[2]="",r[2]="";
- char szStatus[4] = "";
+ char t[Utf8BufSize(2)]="",v[Utf8BufSize(2)]="",r[Utf8BufSize(2)]="";
+ char szStatus[Utf8BufSize(4)] = "";
if (EPGSearchConfig.WarEagle)
{
- sprintf(t, "%c", event && hasMatch ? (timerMatch == tmFull) ? ((timer && timer->Recording())?249:253) : 't' : ' ');
- sprintf(v, "%c", event && event->Vps() && (event->Vps() - event->StartTime()) ? 'V' : ' ');
- sprintf(r, "%c", event && event->IsRunning() ? 251 : ' ');
+ if (!isUTF8)
+ {
+ sprintf(t, "%c", event && hasMatch ? (timerMatch == tmFull) ? ((timer && timer->Recording())?ICON_REC:ICON_CLOCK) : ICON_CLOCK_HALF : ' ');
+ sprintf(v, "%c", event && event->Vps() && (event->Vps() - event->StartTime()) ? ICON_VPS : ' ');
+ sprintf(r, "%c", event && event->IsRunning() ? ICON_RUNNING : ' ');
+ }
+ else
+ {
+ sprintf(t, "%s", (event && hasMatch ? (timerMatch == tmFull) ? ((timer && timer->Recording())?ICON_REC_UTF8:ICON_CLOCK_UTF8) : ICON_CLOCK_HALF_UTF8 : " "));
+ sprintf(v, "%s", event && event->Vps() && (event->Vps() - event->StartTime()) ? ICON_VPS_UTF8 : " ");
+ sprintf(r, "%s", (event && event->IsRunning() ? ICON_RUNNING_UTF8 : " "));
+ }
}
else
{
diff --git a/menu_whatson.c b/menu_whatson.c
index bb5f275..fb12ec0 100644
--- a/menu_whatson.c
+++ b/menu_whatson.c
@@ -22,6 +22,8 @@ The project's page is at http://winni.vdr-developer.org/epgsearch
*/
#include <vector>
+#include <iostream>
+#include <sstream>
#include <string>
#include "uservars.h"
#include "menu_whatson.h"
@@ -50,6 +52,7 @@ The project's page is at http://winni.vdr-developer.org/epgsearch
#define HOURS2SECS(x) (x*60*60)
extern int exitToMainMenu;
+extern bool isUTF8;
int gl_InfoConflict = 0;
// --- cMenuMyScheduleItem ------------------------------------------------------
@@ -85,7 +88,7 @@ bool cMenuMyScheduleItem::Update(bool Force)
if (Force || timerMatch != OldTimerMatch || inSwitchList != OldInSwitchList)
{
- char szProgressPart[12] = "";
+ char szProgressPart[Utf8BufSize(12)] = "";
char szProgressPartT2S[12] = "";
time_t now = time(NULL);
if (channel)
@@ -112,11 +115,24 @@ bool cMenuMyScheduleItem::Update(bool Force)
szProgressPartT2S[9] = ']';
szProgressPartT2S[10] = 0;
- szProgressPart[0] = 130;
- memset(szProgressPart + 1, 131, 6);
- szProgressPart[7] = 132;
- szProgressPart[8] = 0;
- memset(szProgressPart, 127, frac);
+ if (!isUTF8)
+ {
+ szProgressPart[0] = ICON_BAR_OPEN;
+ memset(szProgressPart + 1, ICON_BAR_EMPTY, 6);
+ szProgressPart[7] = ICON_BAR_CLOSE;
+ szProgressPart[8] = 0;
+ memset(szProgressPart, ICON_BAR_FULL, frac);
+ }
+ else
+ {
+ std::stringstream buffer;
+ buffer << ICON_BAR_OPEN_UTF8;
+ for(int i=0;i<8;i++) buffer << (i<frac?ICON_BAR_FULL_UTF8:ICON_BAR_EMPTY_UTF8);
+ buffer << ICON_BAR_CLOSE_UTF8;
+ char* temp = strdup(buffer.str().c_str());
+ sprintf(szProgressPart, "%s", temp);
+ free(temp);
+ }
}
else
{
@@ -127,16 +143,25 @@ bool cMenuMyScheduleItem::Update(bool Force)
}
}
- char t[2],v[2],r[2];
- char szStatus[4];
+ char t[Utf8BufSize(2)],v[Utf8BufSize(2)],r[Utf8BufSize(2)];
+ char szStatus[Utf8BufSize(4)];
szStatus[3] = 0;
t[1]=v[1]=r[1] = 0;
if (EPGSearchConfig.WarEagle)
{
- t[0] = event && hasMatch ? (timerMatch == tmFull) ? ((timer && timer->Recording())?249:253) : 't' : ' ';
- v[0] = event && event->Vps() && (event->Vps() - event->StartTime()) ? 'V' : ' ';
- r[0] = event && event->IsRunning() ? 251 : ' ';
+ if (!isUTF8)
+ {
+ t[0] = event && hasMatch ? (timerMatch == tmFull) ? ((timer && timer->Recording())?ICON_REC:ICON_CLOCK) : ICON_CLOCK_HALF : ' ';
+ v[0] = event && event->Vps() && (event->Vps() - event->StartTime()) ? ICON_VPS : ' ';
+ r[0] = event && event->IsRunning() ? ICON_RUNNING : ' ';
+ }
+ else
+ {
+ sprintf(t, "%s", (event && hasMatch ? (timerMatch == tmFull) ? ((timer && timer->Recording())?ICON_REC_UTF8:ICON_CLOCK_UTF8) : ICON_CLOCK_HALF_UTF8 : " "));
+ sprintf(v, "%s", event && event->Vps() && (event->Vps() - event->StartTime()) ? ICON_VPS_UTF8 : " ");
+ sprintf(r, "%s", (event && event->IsRunning() ? ICON_RUNNING_UTF8 : " "));
+ }
}
else
{
@@ -150,10 +175,20 @@ bool cMenuMyScheduleItem::Update(bool Force)
cSwitchTimer* s = SwitchTimers.InSwitchList(event);
t[0] = (s && s->announceOnly)?'s':'S';
}
- szStatus[0] = t[0];
- szStatus[1] = v[0];
- szStatus[2] = r[0];
-
+ if (EPGSearchConfig.WarEagle && isUTF8)
+ {
+ std::stringstream buffer;
+ buffer << t << v << r;
+ char* temp = strdup(buffer.str().c_str());
+ sprintf(szStatus, "%s", temp);
+ free(temp);
+ }
+ else
+ {
+ szStatus[0] = t[0];
+ szStatus[1] = v[0];
+ szStatus[2] = r[0];
+ }
char* buffer = strdup(menutemplate);
strreplace(buffer, '|', '\t');
diff --git a/po/es_ES.po b/po/es_ES.po
index 913451f..766c4e1 100644
--- a/po/es_ES.po
+++ b/po/es_ES.po
@@ -394,7 +394,7 @@ msgid "Help$Set this to 'yes' if you don't like to get any announcements of broa
msgstr "Establecer a 'sí' cuando no desee recibir ningún aviso de emisiones durante una reproducción."
msgid "Recreate timers after deletion"
-msgstr "Recrear programaciones tras borrado"
+msgstr "Recrear programaciones tras borrar"
msgid "Help$Set this to 'yes' if you want timers to be recreated with the next search timer update after deleting them."
msgstr "Establecer a 'sí' cuando desee que las programaciones se creen de nuevo con la siguiente actualización de programación por búsqueda después de borrarlas."
@@ -556,10 +556,10 @@ msgid "$ abcdefghijklmnopqrstuvwxyz0123456789-.,#~\\^$[]|()*+?{}/:%@&"
msgstr " aábcdeéfghiíjklmnñoópqrstuúvwxyz0123456789-.,#~\\^$[]|()*+?{}/:%@&"
msgid "Start/Stop time has changed"
-msgstr ""
+msgstr "Ha cambiado el tiempo inicial/final"
msgid "Title/episode has changed"
-msgstr ""
+msgstr "Ha cambiado el título/episodio"
msgid "No new timers were added."
msgstr "No se añadieron nuevas programaciones."