summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Neumann <fnu@yavdr.org>2017-05-26 11:46:01 +0200
committerFrank Neumann <fnu@yavdr.org>2017-05-26 11:46:01 +0200
commit6ab0fcd425e0e54a04e12e3a61f5555c81b9ec25 (patch)
tree8e2d567f7c6a6ce1fcd81af45d433789310ad30a
parent35b380b5b6ee8d46c1b5ed45837d3c35ea1a5faf (diff)
downloadvdr-plugin-text2skin-6ab0fcd425e0e54a04e12e3a61f5555c81b9ec25.tar.gz
vdr-plugin-text2skin-6ab0fcd425e0e54a04e12e3a61f5555c81b9ec25.tar.bz2
Make MAX_CHARS configurable.
-rw-r--r--common.c8
-rw-r--r--menu.c2
-rw-r--r--po/de_DE.po3
-rw-r--r--po/fi_FI.po3
-rw-r--r--po/it_IT.po3
-rw-r--r--setup.c2
-rw-r--r--setup.h1
7 files changed, 17 insertions, 5 deletions
diff --git a/common.c b/common.c
index a371f00..f35fa62 100644
--- a/common.c
+++ b/common.c
@@ -1,6 +1,7 @@
// -*- c++ -*-
#include "common.h"
+#include "setup.h"
#include <sstream>
#include <vdr/plugin.h>
#include <vdr/device.h>
@@ -225,9 +226,6 @@ bool GetFrontendHasSignal(void)
std::string AddExtInfoToDescription(const char *Title, const char *ShortText, const char *Description, const char *Aux, bool StripAux)
{
- // max. width so lines don't get wrapped
- #define MAX_CHARS 100
-
// prepare the description
std::stringstream desc("");
@@ -274,7 +272,7 @@ std::string AddExtInfoToDescription(const char *Title, const char *ShortText, co
buf << " - " << r->event->Title();
if (!isempty(r->event->ShortText())) buf << "~" << r->event->ShortText();
- desc << FitToWidth(buf, MAX_CHARS) << "\n";
+ desc << FitToWidth(buf, (Text2SkinSetup.MaxChars)) << "\n";
}
delete list;
}
@@ -297,7 +295,7 @@ std::string AddExtInfoToDescription(const char *Title, const char *ShortText, co
desc << tr("AUXILIARY INFOS") << ":\n";
std::stringstream buf;
buf << " - " << tr("Search timer") << ": " << searchTimer;
- desc << FitToWidth(buf, MAX_CHARS) << "\n";
+ desc << FitToWidth(buf, (Text2SkinSetup.MaxChars)) << "\n";
}
}
}
diff --git a/menu.c b/menu.c
index 66566f9..487c7cb 100644
--- a/menu.c
+++ b/menu.c
@@ -25,6 +25,7 @@ void cText2SkinSetupPage::Setup(void) {
Add(new cMenuEditBoolItem(tr("Use 'epgsearch' to check timer-conflicts"), &mData.CheckTimerConflict));
Add(new cOsdItem(tr("Flush image cache"), osUser1));
Add(new cMenuEditIntItem(tr("Max. image cache size"), &mData.MaxCacheFill, 1));
+ Add(new cMenuEditIntItem(tr("Max. characters per line"), &mData.MaxChars, 1));
Add(new cMenuEditBoolItem(tr("Old Skin compatibility (<1.0)"), &mData.SupportOldSkins, tr("no"), tr("yes")));
SetCurrent(Get(current));
@@ -42,6 +43,7 @@ void cText2SkinSetupPage::Store(void) {
SetupStore("StripAux", mData.StripAux);
SetupStore("CheckTimerConflict", mData.CheckTimerConflict);
SetupStore("MaxCacheFill", mData.MaxCacheFill);
+ SetupStore("MaxChars", mData.MaxChars);
SetupStore("SupportOldSkins", mData.SupportOldSkins);
Text2SkinSetup = mData;
}
diff --git a/po/de_DE.po b/po/de_DE.po
index 662e4f1..b627283 100644
--- a/po/de_DE.po
+++ b/po/de_DE.po
@@ -60,6 +60,9 @@ msgstr "Bildspeicher leeren"
msgid "Max. image cache size"
msgstr "Max. Größe des Bildspeichers"
+msgid "Max. characters per line"
+msgstr "Max. Zeichenzahl pro Linie"
+
msgid "Old Skin compatibility (<1.0)"
msgstr "Unterstützung alter Skins (<1.0)"
diff --git a/po/fi_FI.po b/po/fi_FI.po
index 7e731d1..c96bfe2 100644
--- a/po/fi_FI.po
+++ b/po/fi_FI.po
@@ -60,6 +60,9 @@ msgstr "Tyhjennä kuvat välimuistista"
msgid "Max. image cache size"
msgstr "Välimuistin maksimikoko"
+msgid "Max. characters per line"
+msgstr ""
+
msgid "Old Skin compatibility (<1.0)"
msgstr ""
diff --git a/po/it_IT.po b/po/it_IT.po
index 4b02b2e..b2d6f1e 100644
--- a/po/it_IT.po
+++ b/po/it_IT.po
@@ -62,6 +62,9 @@ msgstr "Svuota cache immagini"
msgid "Max. image cache size"
msgstr "Dim. massima cache immagini"
+msgid "Max. characters per line"
+msgstr ""
+
msgid "Old Skin compatibility (<1.0)"
msgstr ""
diff --git a/setup.c b/setup.c
index 18da5ba..b2d3f9d 100644
--- a/setup.c
+++ b/setup.c
@@ -14,6 +14,7 @@ cText2SkinSetup::cText2SkinSetup(void):
StripAux(true),
CheckTimerConflict(false),
MaxCacheFill(25),
+ MaxChars(100),
SupportOldSkins(true)
{
}
@@ -26,6 +27,7 @@ bool cText2SkinSetup::SetupParse(const char *Name, const char *Value) {
else if (strcmp(Name, "StripAux") == 0) StripAux = atoi(Value);
else if (strcmp(Name, "CheckTimerConflict") == 0) CheckTimerConflict = atoi(Value);
else if (strcmp(Name, "MaxCacheFill") == 0) MaxCacheFill = atoi(Value);
+ else if (strcmp(Name, "MaxChars") == 0) MaxChars = atoi(Value);
else if (strcmp(Name, "SupportOldSkins") == 0) SupportOldSkins = atoi(Value);
else return false;
return true;
diff --git a/setup.h b/setup.h
index a698cb8..4562d4d 100644
--- a/setup.h
+++ b/setup.h
@@ -18,6 +18,7 @@ public:
int StripAux;
int CheckTimerConflict;
int MaxCacheFill;
+ int MaxChars;
int SupportOldSkins;
};