From 7c9181bf95fedb7a4b4ab40c31aaa841ead074ed Mon Sep 17 00:00:00 2001 From: lordjaxom Date: Sun, 2 Jan 2005 16:54:41 +0000 Subject: *** empty log message *** --- status.c | 12 ++++++++++-- status.h | 4 +++- xml/string.c | 21 ++++++++++++++++++++- xml/string.h | 8 +++++++- 4 files changed, 40 insertions(+), 5 deletions(-) diff --git a/status.c b/status.c index 8d83072..5df11ee 100644 --- a/status.c +++ b/status.c @@ -1,5 +1,5 @@ /* - * $Id: status.c,v 1.3 2004/12/21 20:26:25 lordjaxom Exp $ + * $Id: status.c,v 1.4 2005/01/02 16:54:41 lordjaxom Exp $ */ #include "status.h" @@ -16,7 +16,8 @@ cText2SkinStatus::cText2SkinStatus(void): mReplayMode(replayNone), mRecordings(), mCurrentRecording(0), - mNextRecording(0) + mNextRecording(0), + mLastLanguage(Setup.OSDLanguage) { mStatus = this; } @@ -139,3 +140,10 @@ cxType cText2SkinStatus::GetTokenData(const txToken &Token) return cxType::False; } + +void cText2SkinStatus::OsdClear(void) { + if (Setup.OSDLanguage != mLastLanguage) { + mLastLanguage = Setup.OSDLanguage; + cxString::Reparse(); + } +} diff --git a/status.h b/status.h index d17fdd1..6ab5fee 100644 --- a/status.h +++ b/status.h @@ -1,5 +1,5 @@ /* - * $Id: status.h,v 1.2 2004/12/21 18:35:54 lordjaxom Exp $ + * $Id: status.h,v 1.3 2005/01/02 16:54:41 lordjaxom Exp $ */ #ifndef VDR_TEXT2SKIN_STATUS_H @@ -40,10 +40,12 @@ private: tRecordings mRecordings; uint mCurrentRecording; uint mNextRecording; + int mLastLanguage; protected: virtual void Replaying(const cControl *Control, const char *Name); virtual void Recording(const cDevice *Device, const char *Name); + virtual void OsdClear(void); public: cText2SkinStatus(void); diff --git a/xml/string.c b/xml/string.c index 594b4b6..e0b1303 100644 --- a/xml/string.c +++ b/xml/string.c @@ -1,5 +1,5 @@ /* - * $Id: string.c,v 1.4 2005/01/01 23:44:36 lordjaxom Exp $ + * $Id: string.c,v 1.5 2005/01/02 16:54:41 lordjaxom Exp $ */ #include "xml/string.h" @@ -49,6 +49,25 @@ std::string txToken::Token(const txToken &Token) cxString::cxString(cxSkin *Skin): mSkin(Skin) { + mStrings.push_back(this); +} + +cxString::~cxString() +{ + tStringList::iterator it = mStrings.begin(); + while (it != mStrings.end()) { + if ((*it) == this) { + mStrings.erase(it); + break; + } + } +} + +void cxString::Reparse(void) +{ + tStringList::iterator it = mStrings.begin(); + while (it != mStrings.end()) + (*it)->Parse(); } bool cxString::Parse(const std::string &Text) diff --git a/xml/string.h b/xml/string.h index e97b5d4..fe7149c 100644 --- a/xml/string.h +++ b/xml/string.h @@ -1,5 +1,5 @@ /* - * $Id: string.h,v 1.5 2005/01/01 23:44:36 lordjaxom Exp $ + * $Id: string.h,v 1.6 2005/01/02 16:54:41 lordjaxom Exp $ */ #ifndef VDR_TEXT2SKIN_XML_STRING_H @@ -168,13 +168,19 @@ class cxSkin; class cxString { private: + typedef std::vector tStringList; + static tStringList mStrings; + std::string mText; std::string mOriginal; std::vector mTokens; cxSkin *mSkin; public: + static void Reparse(void); + cxString(cxSkin *Skin); + ~cxString(); bool Parse(const std::string &Text); bool Parse(void) { return Parse(mOriginal); } -- cgit v1.2.3