From ac64ce03ec6b5766691ff2da3af6f51ed800792a Mon Sep 17 00:00:00 2001 From: Andreas Brugger Date: Sun, 3 Dec 2006 17:45:17 +0100 Subject: 2006-12-03: Version 1.1-cvs_ext-0.10 (vdr-text2skin-1.1-cvs_ext-0.10.diff) - set EditableWidth. This is important for plugins like 'rotor' or 'extrecmenu' - now setting the locale setting LC_TIME according to the language-selection in VDR --- HISTORY | 7 +++++++ common.c | 2 ++ display.c | 2 -- i18n.c | 29 +++++++++++++++++++++++++++-- render.c | 17 +++++++++++++++-- text2skin.c | 2 +- 6 files changed, 52 insertions(+), 7 deletions(-) diff --git a/HISTORY b/HISTORY index 505b431..90fbcfe 100644 --- a/HISTORY +++ b/HISTORY @@ -1,6 +1,13 @@ VDR Plugin 'text2skin' Revision History --------------------------------------- +2006-12-03: Version 1.1-cvs_ext-0.10 (vdr-text2skin-1.1-cvs_ext-0.10.diff) + +- set EditableWidth. This is important for plugins like 'rotor' or + 'extrecmenu' +- now setting the locale setting LC_TIME according to the language-selection + in VDR + 2006-11-19: Version 1.1-cvs_ext-0.9a (vdr-text2skin-1.1-cvs_ext-0.9a.diff) - added APIVERSION to the Makefile for vdr-1.3.47 diff --git a/common.c b/common.c index d5bb0b4..0bfb1d4 100644 --- a/common.c +++ b/common.c @@ -4,6 +4,7 @@ #include "common.h" #include +#include #include #include #include @@ -409,6 +410,7 @@ cxType TimeType(time_t Time, const std::string &Format) if (Time > 0) { if (Format.length() > 0) { + setlocale(LC_TIME, tr("en_US")); strftime(result, sizeof(result), Format.c_str(), tm); cxType r = result; diff --git a/display.c b/display.c index fa71016..9960eac 100644 --- a/display.c +++ b/display.c @@ -1194,7 +1194,6 @@ cxType cText2SkinDisplayMenu::GetTokenData(const txToken &Token) : (cxType)false; } else if (mRecording) { // recording Info cRecordingInfo *recInfo = const_cast(mRecording->Info()); - tChannelID chID = recInfo->ChannelID(); cChannel *channel = Channels.GetByChannelID(recInfo->ChannelID(), true); return channel != NULL ? (cxType)ChannelName(channel, 0) @@ -1209,7 +1208,6 @@ cxType cText2SkinDisplayMenu::GetTokenData(const txToken &Token) : (cxType)false; } else if (mRecording) { // recording Info cRecordingInfo *recInfo = const_cast(mRecording->Info()); - tChannelID chID = recInfo->ChannelID(); cChannel *channel = Channels.GetByChannelID(recInfo->ChannelID(), true); return channel != NULL ? (cxType)ChannelShortName(channel, 0) diff --git a/i18n.c b/i18n.c index 28cd46e..4f97840 100644 --- a/i18n.c +++ b/i18n.c @@ -329,8 +329,8 @@ const tI18nPhrase Phrases[] = { "", #endif }, - { "Show auxiliary infos of recordings", - "Zusatzinfos der Aufnahmen anzeigen", + { "Auxiliary infos in recordings/timers", + "Zusatzinfos bei Aufnahmen/Timer anzeigen", "", "", "", @@ -452,6 +452,31 @@ const tI18nPhrase Phrases[] = { #endif #if VDRVERSNUM >= 10316 "", +#endif + }, + { "en_US", + "de_DE", + "sl_SI", + "it_IT", + "nl_NL", + "pt_PT", + "fr_FR", + "no_NO", + "fi_FI", + "pl_PL", + "es_ES", + "el_GR", + "sv_SE", + "ro_RO", + "hu_HU", + "ca_AD", + "ru_RU", + "hr_HR", +#if VDRVERSNUM >= 10313 + "et_EE", +#endif +#if VDRVERSNUM >= 10316 + "da_DK", #endif }, { NULL } diff --git a/render.c b/render.c index 4fafdbe..87df8a3 100644 --- a/render.c +++ b/render.c @@ -227,6 +227,7 @@ void cText2SkinRender::DrawObject(const cxObject *Object) uint itemheight = item->Size().h; uint maxitems = areasize.h / itemheight; uint yoffset = 0; + bool initialEditableWidthSet = false; mMenuScrollbar.maxItems = maxitems; SetMaxItems(maxitems); //Dprintf("setmaxitems %d\n", maxitems); @@ -262,13 +263,23 @@ void cText2SkinRender::DrawObject(const cxObject *Object) nexttab = GetTab(n); } + // set initial EditableWidth + // this is for plugins like 'extrecmenu' and 'rotor' + if ((obj.Type() == cxObject::text || obj.Type() == cxObject::marquee || obj.Type() == cxObject::blink) && !initialEditableWidthSet) { + initialEditableWidthSet = true; + SetEditableWidth(obj.Size().w); + } + if (t >= 0 && nexttab > 0 && nexttab < obj.mPos1.x + obj.Size().w - 1) // there is a "next tab" with text obj.mPos2.x = Object->mPos1.x + o->mPos1.x + nexttab; else { // there is no "next tab", use the rightmost edge obj.mPos2.x += Object->mPos1.x; - if (obj.Type() == cxObject::text && t == 1) { + /* not used anymore due to change to fontOsd + but could be usefull if someone uses a differnt font + + if ((obj.Type() == cxObject::text || obj.Type() == cxObject::marquee || obj.Type() == cxObject::blink) && t == 1) { // VDR assumes, that the font in the menu is fontOsd, // so the EditableWidth is not necessarily correct // for TTF @@ -278,7 +289,9 @@ void cText2SkinRender::DrawObject(const cxObject *Object) if (defFont != obj.Font()) editableWidth = (int)(editableWidth * defFont->Width(dummy) / (1.1 * obj.Font()->Width(dummy))); SetEditableWidth(editableWidth); - } + } */ + if ((obj.Type() == cxObject::text || obj.Type() == cxObject::marquee || obj.Type() == cxObject::blink) && t == 1) + SetEditableWidth(obj.Size().w); } obj.mPos2.y += Object->mPos1.y + yoffset; diff --git a/text2skin.c b/text2skin.c index 2f18e4d..dc41f15 100644 --- a/text2skin.c +++ b/text2skin.c @@ -14,7 +14,7 @@ #include "loader.h" #include "status.h" -const char *cText2SkinPlugin::VERSION = "1.1-cvs_ext-0.9a"; +const char *cText2SkinPlugin::VERSION = "1.1-cvs_ext-0.10"; const char *cText2SkinPlugin::SKINVERSION = "1.0"; const char *cText2SkinPlugin::DESCRIPTION = "Loader for text-based skins"; -- cgit v1.2.3