From 7af332fd26e257d780412b8ae44632ca98282575 Mon Sep 17 00:00:00 2001 From: anbr Date: Sat, 11 Sep 2010 12:08:30 +0200 Subject: Show next timer on lines (Feature #427) --- HISTORY | 6 ++++++ targavfd.c | 2 +- watch.c | 22 +++++++++++++++++----- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/HISTORY b/HISTORY index 13bbb5d..ed031ba 100644 --- a/HISTORY +++ b/HISTORY @@ -1,6 +1,12 @@ VDR Plugin 'targavfd' Revision History ------------------------------------- +2010-09-11 +- Show next timer on lines (Feature #427) + +2010-07-18 +- Update italian translation (Support #357) + 2010-07-17: Version 0.0.5 - Add exit mode 'Show only present next timer' (Request #356) - Add setup option to control volume bargraph diff --git a/targavfd.c b/targavfd.c index 624a0cb..230de51 100644 --- a/targavfd.c +++ b/targavfd.c @@ -20,7 +20,7 @@ #include "status.h" #include "setup.h" -static const char *VERSION = "0.0.5"; +static const char *VERSION = "0.0.6"; class cPluginTargaVFD : public cPlugin { private: diff --git a/watch.c b/watch.c index b36f157..5473aba 100644 --- a/watch.c +++ b/watch.c @@ -140,6 +140,7 @@ void cVFDWatch::close() { case eOnExitMode_NEXTTIMER_BLANKSCR: { isyslog("targaVFD: closing, show only next timer."); + int nTop = (theSetup.m_cHeight - pFont->Height())/2; this->clear(); if(t) { struct tm l; @@ -149,16 +150,27 @@ void cVFDWatch::close() { localtime_r(&tt, &l); if((tt - tn) > 86400) { // next timer more then 24h - topic = cString::sprintf("%d. %02d:%02d %s", l.tm_mday, l.tm_hour, l.tm_min, t->File()); + topic = cString::sprintf("%d. %02d:%02d", l.tm_mday, l.tm_hour, l.tm_min); } else { // next timer (today) - topic = cString::sprintf("%02d:%02d %s", l.tm_hour, l.tm_min, t->File()); + topic = cString::sprintf("%02d:%02d", l.tm_hour, l.tm_min); + } + + int w = pFont->Width(topic); + if(theSetup.m_bTwoLineMode) { + this->DrawText(0,0,topic); + if((w + 3) < theSetup.m_cWidth) + this->DrawText(w + 3,0,t->Channel()->Name()); + this->DrawText(0,pFont->Height(), t->File()); + } else { + this->DrawText(0,nTop<0?0:nTop, topic); + if((w + 3) < theSetup.m_cWidth) + this->DrawText(w + 3,nTop<0?0:nTop, t->File()); } - this->DrawText(0,0,topic); this->icons(eIconRECORD); } else { - if(theSetup.m_nOnExit == eOnExitMode_NEXTTIMER) - this->DrawText(0,0,tr("None active timer")); + if(theSetup.m_nOnExit == eOnExitMode_NEXTTIMER) + this->DrawText(0,nTop<0?0:nTop,tr("None active timer")); this->icons(0); } this->flush(true); -- cgit v1.2.3