From 61b085f1d12ef86807f779f57671fa1e7a5a14c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matti=20Lehtim=C3=A4ki?= Date: Sat, 5 May 2012 21:04:06 +0300 Subject: Improve error logging. Make character list for menu editing modifiable through translation files. New version number. --- HISTORY | 2 +- epgfixer.c | 2 +- po/fi_FI.po | 39 +++++++++++++++++++++------------------ regexp.c | 4 ++-- setup_menu.c | 15 +++++++++++---- tools.c | 2 +- tools.h | 8 +++++--- 7 files changed, 42 insertions(+), 30 deletions(-) diff --git a/HISTORY b/HISTORY index 09de591..8c1a1c0 100644 --- a/HISTORY +++ b/HISTORY @@ -1,6 +1,6 @@ VDR Plugin 'epgfixer' Revision History -------------------------------------- -2012-xx-xx: Version 0.0.7 +2012-05-05: Version 0.1.0 - Support for character set conversion for selected channels. - Support for stripping HTML entities. diff --git a/epgfixer.c b/epgfixer.c index f87b84e..04bb987 100644 --- a/epgfixer.c +++ b/epgfixer.c @@ -16,7 +16,7 @@ #error "VDR-1.7.26 API version or greater is required!" #endif -static const char *VERSION = "0.0.7"; +static const char *VERSION = "0.1.0"; static const char *DESCRIPTION = trNOOP("Fix bugs in EPG"); class cPluginEpgfixer : public cPlugin { diff --git a/po/fi_FI.po b/po/fi_FI.po index 800ad93..de11e7c 100644 --- a/po/fi_FI.po +++ b/po/fi_FI.po @@ -5,10 +5,10 @@ # msgid "" msgstr "" -"Project-Id-Version: vdr-epgfixer 0.0.3\n" +"Project-Id-Version: vdr-epgfixer 0.1.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-05-05 15:17+0300\n" -"PO-Revision-Date: 2012-05-03 22:20+0300\n" +"POT-Creation-Date: 2012-05-05 19:01+0300\n" +"PO-Revision-Date: 2012-05-05 18:25+0300\n" "Last-Translator: Matti Lehtimäki \n" "Language-Team: Finnish \n" "MIME-Version: 1.0\n" @@ -19,16 +19,10 @@ msgstr "" msgid "Fix bugs in EPG" msgstr "Korjaa virheitä EPG:ssä" -msgid "Toggle state" -msgstr "Vaihda tila" +msgid " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789%~\\/?!()[]{}<>$^*.,:;-=#" +msgstr " abcdefghijklmnopqrstuvwxyzåäöABCDEFGHIJKLMNOPQRSTUVWXYZÅÄÖ0123456789%~\\/?!()[]{}<>$^*.,:;-=#" -msgid "Add" -msgstr "Lisää" - -msgid "Delete" -msgstr "Poista" - -msgid "Cancel" +msgid "Button$Cancel" msgstr "Peru" msgid "Regular expressions" @@ -43,6 +37,9 @@ msgstr "Merkistömuunnokset" msgid "Edit character set conversions." msgstr "Muokkaa merkistömuunnoksia." +msgid "--- EPG bugfixes ---" +msgstr "--- EPG korjaukset ---" + msgid "Remove quotes from ShortText" msgstr "Poista lainaukset lyhyestä kuvauksesta" @@ -94,7 +91,7 @@ msgid "" "Title\n" "\"ShortText\"[.]" msgstr "" -"Ohjelmaoppaan korjaustaso >= 1: Jotkin kanavat laittavat lyhyen kuvausksen lainusmerkkeihin, mikä oli ärsyttävää (jotkut jopa laittavat '.' viimeisen '\"' jälkeen):\n" +"Ohjelmaoppaan korjaustaso >= 1: Jotkin kanavat laittavat lyhyen kuvausksen lainausmerkkeihin, mikä oli ärsyttävää (jotkut jopa laittavat '.' viimeisen '\"' jälkeen):\n" "\n" "Otsikko\n" "\"Lyhyt kuvaus\"[.]" @@ -121,7 +118,7 @@ msgid "Replace backticks with single quotes" msgstr "Korvaa gravis heittomerkillä" msgid "EPG bugfix level >= 2: Some channels use the ` (\"backtick\") character, where a ' (single quote) would be normally used. Actually, \"backticks\" in normal text don't make much sense, so let's replace them." -msgstr "Ohjelmaoppaan korjaustaso >= 2: Jotkin kanavat käyttävät ` (gravis) merkkiä ' (lainausmerkki) sijaan. Itse asiassa gravis ei ole järkevä normaalissa tekstissä, joten korvataan ne." +msgstr "Ohjelmaoppaan korjaustaso >= 2: Jotkin kanavat käyttävät ` (gravis) merkkiä ' (heittomerkki) sijaan. Itse asiassa gravis ei ole järkevä normaalissa tekstissä, joten korvataan ne." msgid "Fix stream component descriptions" msgstr "Korjaa lähetekomponenttien kuvaukset" @@ -135,11 +132,17 @@ msgstr "Poista HTML-merkit" msgid "Convert HTML entities from all fields to matching regular characters." msgstr "Korvaa HTML merkit kaikista kentistä normaaleilla merkeillä." -msgid "Reload files" -msgstr "Lataa uudelleen tiedostot" +msgid "Button$Load" +msgstr "Lataa" + +msgid "Button$Clear EPG" +msgstr "Tyhjennä EPG" + +msgid "Loading configuration files..." +msgstr "Ladataan asetustiedostoja..." -msgid "Clear EPG data" -msgstr "Tyhjennä EPG tiedot" +msgid "Clearing EPG data..." +msgstr "Tyhjennetään EPG tietoja..." msgid "Help" msgstr "Ohje" diff --git a/regexp.c b/regexp.c index 57db548..dd6856c 100644 --- a/regexp.c +++ b/regexp.c @@ -38,13 +38,13 @@ void cRegexp::Compile() int erroffset; re = pcre_compile(regexp, 0, &error, &erroffset, NULL); if (error) { - esyslog("PCRE compile error: %s at offset %i", error, erroffset); + error("PCRE compile error: %s at offset %i", error, erroffset); enabled = false; } else { sd = pcre_study(re, 0, (const char **)&error); if (error) - esyslog("PCRE study error: %s", error); + error("PCRE study error: %s", error); } } diff --git a/setup_menu.c b/setup_menu.c index 016abfd..1e5fc3f 100644 --- a/setup_menu.c +++ b/setup_menu.c @@ -17,7 +17,7 @@ #define MAXREGEXPLENGTH 512 const char *RegexpChars = - " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789%~\\/?!()[]{}<>$^*.,:;-=#"; + trNOOP(" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789%~\\/?!()[]{}<>$^*.,:;-=#"); template class cMenuSetupConfigEditor : public cMenuSetupPage { @@ -80,11 +80,11 @@ protected: int i = 0; T *item = (T *)list->First(); while (i < list->Count()) { - Add(new cMenuEditStrItem(item->Enabled() ? "+" : "-", lines[i], MAXREGEXPLENGTH, RegexpChars)); + Add(new cMenuEditStrItem(item->Enabled() ? "+" : "-", lines[i], MAXREGEXPLENGTH, tr(RegexpChars))); item = (T *)item->Next(); ++i; } - SetHelp(tr("Toggle state"), tr("Add"), tr("Delete"), tr("Cancel")); + SetHelp(trVDR("Button$On/Off"), trVDR("Button$New"), trVDR("Button$Delete"), tr("Button$Cancel")); Display(); } public: @@ -167,6 +167,9 @@ void cMenuSetupEpgfixer::Set(void) Add(new cOsdItem(tr("Character set conversions"), osUser2)); help.Append(tr("Edit character set conversions.")); + Add(new cOsdItem(tr("--- EPG bugfixes ---"), osUnknown, false)); + help.Append(""); + Add(new cMenuEditBoolItem(tr("Remove quotes from ShortText"), &newconfig.quotedshorttext)); help.Append(tr("EPG bugfix level >= 1: Some channels put the ShortText in quotes and use either the ShortText or the Description field, depending on how long the string is:\n\nTitle\n\"ShortText\". Description")); @@ -197,7 +200,7 @@ void cMenuSetupEpgfixer::Set(void) Add(new cMenuEditBoolItem(tr("Strip HTML entities"), &newconfig.striphtml)); help.Append(tr("Convert HTML entities from all fields to matching regular characters.")); - SetHelp(tr("Reload files"),NULL,NULL, tr("Clear EPG data")); + SetHelp(tr("Button$Load"),NULL,NULL, tr("Button$Clear EPG")); Display(); } @@ -226,14 +229,18 @@ eOSState cMenuSetupEpgfixer::ProcessKey(eKeys Key) if (state == osUnknown) { switch (Key) { case kRed: + Skins.Message(mtInfo, tr("Loading configuration files...")); EpgfixerRegexps.ReloadConfigFile(); EpgfixerCharSets.ReloadConfigFile(); + Skins.Message(mtInfo, NULL); state = osContinue; break; case kBlue: + Skins.Message(mtInfo, tr("Clearing EPG data...")); cEitFilter::SetDisableUntil(time(NULL) + 10); if (cSchedules::ClearAll()) cEitFilter::SetDisableUntil(time(NULL) + 10); + Skins.Message(mtInfo, NULL); state = osContinue; break; case kInfo: diff --git a/tools.c b/tools.c index ca16d1b..c15c983 100644 --- a/tools.c +++ b/tools.c @@ -114,7 +114,7 @@ static char *htmlcharconv(char *str, struct conv_table *conv, unsigned int elem) size_t l1 = strlen(conv[i].from); size_t l2 = strlen(conv[i].to); if (l2 > l1) { - esyslog("htmlcharconv(): cannot reallocate string"); + error("htmlcharconv(): cannot reallocate string"); return str; } if (l2 != l1) diff --git a/tools.h b/tools.h index 595f4f3..dfcee30 100644 --- a/tools.h +++ b/tools.h @@ -5,14 +5,16 @@ * */ -#ifndef __EPGFIXER_STRINGTOOLS_H_ -#define __EPGFIXER_STRINGTOOLS_H_ +#ifndef __EPGFIXER_TOOLS_H_ +#define __EPGFIXER_TOOLS_H_ #include #include #include #include +#define error(x...) esyslog("EPGFixer: " x); + #define FREE(x) { free(x); x = NULL; } char *striphtml(char *str); @@ -96,4 +98,4 @@ public: const char *GetConfigFile() { return fileName; } }; -#endif //__EPGFIXER_STRINGTOOLS_H_ +#endif //__EPGFIXER_TOOLS_H_ -- cgit v1.2.3