diff --git a/CONTRIBUTORS b/CONTRIBUTORS index c4ef8363..c3ef4cc6 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -863,6 +863,7 @@ Christoph Hermanns Oskar Signell for pointing out a problem with setting an editing mark while in "Pause" mode, where replay was not immediately positioned to the marked frame + for making single shot timers and events show the day of week Dirk Essl for reporting a wrong URL to the 'Doxygen' tool in INSTALL diff --git a/HISTORY b/HISTORY index 945576cc..e9cf9c25 100644 --- a/HISTORY +++ b/HISTORY @@ -2814,3 +2814,8 @@ Video Disk Recorder Revision History Wiesweg). - Added a hint to PLUGINS.html about how to name a plugin that implements a skin. - Completed the Finnish OSD texts (thanks to Rolf Ahrenberg). +- Single shot timers and events now show the day of week (adopted with some changes + from the "elchi" patch, orginally introduced by Oskar Signell). Plugins that use + cEvent::GetDateString() should note that this function now returns a longer + string, including the day of week. The new function const char *WeekDayName(time_t t) + can be called with a time_t value to get the day of week for that time. diff --git a/epg.c b/epg.c index 28d8c1d2..2768db2e 100644 --- a/epg.c +++ b/epg.c @@ -7,7 +7,7 @@ * Original version (as used in VDR before 1.3.0) written by * Robert Schneider and Rolf Hakenes . * - * $Id: epg.c 1.18 2004/03/13 15:01:05 kls Exp $ + * $Id: epg.c 1.19 2004/05/22 12:37:07 kls Exp $ */ #include "epg.h" @@ -115,9 +115,12 @@ bool cEvent::IsRunning(bool OrAboutToStart) const const char *cEvent::GetDateString(void) const { - static char buf[25]; + static char buf[32]; struct tm tm_r; - strftime(buf, sizeof(buf), "%d.%m.%Y", localtime_r(&startTime, &tm_r)); + tm *tm = localtime_r(&startTime, &tm_r); + char *p = stpcpy(buf, WeekDayName(tm->tm_wday)); + *p++ = ' '; + strftime(p, sizeof(buf) - (p - buf), "%d.%m.%Y", tm); return buf; } diff --git a/menu.c b/menu.c index 968a873c..f3b2eb1c 100644 --- a/menu.c +++ b/menu.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: menu.c 1.300 2004/05/16 12:47:22 kls Exp $ + * $Id: menu.c 1.302 2004/05/22 13:23:22 kls Exp $ */ #include "menu.h" @@ -633,6 +633,7 @@ eOSState cMenuEditTimer::ProcessKey(eKeys Key) } if (addIfConfirmed) Timers.Add(timer); + timer->Matches(); Timers.Save(); isyslog("timer %d %s (%s)", timer->Index() + 1, addIfConfirmed ? "added" : "modified", timer->HasFlags(tfActive) ? "active" : "inactive"); addIfConfirmed = false; @@ -677,9 +678,11 @@ bool cMenuTimerItem::operator< (const cListObject &ListObject) void cMenuTimerItem::Set(void) { char *buffer = NULL; - asprintf(&buffer, "%c\t%d\t%s\t%02d:%02d\t%02d:%02d\t%s", + asprintf(&buffer, "%c\t%d\t%s%s%s\t%02d:%02d\t%02d:%02d\t%s", !(timer->HasFlags(tfActive)) ? ' ' : timer->FirstDay() ? '!' : timer->Recording() ? '#' : '>', timer->Channel()->Number(), + timer->IsSingleEvent() ? WeekDayName(timer->StartTime()) : "", + timer->IsSingleEvent() ? " " : "", timer->PrintDay(timer->Day()), timer->Start() / 100, timer->Start() % 100, @@ -908,7 +911,7 @@ cMenuWhatsOnItem::cMenuWhatsOnItem(const cEvent *Event, cChannel *Channel) char t = Timers.GetMatch(Event, &TimerMatch) ? (TimerMatch == tmFull) ? 'T' : 't' : ' '; char v = event->Vps() && (event->Vps() - event->StartTime()) ? 'V' : ' '; char r = event->IsRunning() ? '*' : ' '; - asprintf(&buffer, "%d\t%.*s\t%.*s\t%c%c%c\t%s", channel->Number(), 6, channel->Name(), 5, event->GetTimeString(), t, v, r, event->Title()); + asprintf(&buffer, "%d\t%.*s\t%s\t%c%c%c\t%s", channel->Number(), 6, channel->Name(), event->GetTimeString(), t, v, r, event->Title()); SetText(buffer, false); } @@ -1026,7 +1029,7 @@ cMenuScheduleItem::cMenuScheduleItem(const cEvent *Event) char t = Timers.GetMatch(Event, &TimerMatch) ? (TimerMatch == tmFull) ? 'T' : 't' : ' '; char v = event->Vps() && (event->Vps() - event->StartTime()) ? 'V' : ' '; char r = event->IsRunning() ? '*' : ' '; - asprintf(&buffer, "%.*s\t%.*s\t%c%c%c\t%s", 5, event->GetDateString(), 5, event->GetTimeString(), t, v, r, event->Title()); + asprintf(&buffer, "%.*s\t%s\t%c%c%c\t%s", 6, event->GetDateString(), event->GetTimeString(), t, v, r, event->Title()); SetText(buffer, false); } @@ -1048,7 +1051,7 @@ public: }; cMenuSchedule::cMenuSchedule(void) -:cOsdMenu("", 6, 6, 4) +:cOsdMenu("", 7, 6, 4) { now = next = false; otherChannel = 0; diff --git a/skinclassic.c b/skinclassic.c index 2c4b5632..fe9c0254 100644 --- a/skinclassic.c +++ b/skinclassic.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: skinclassic.c 1.1 2004/05/15 14:51:18 kls Exp $ + * $Id: skinclassic.c 1.2 2004/05/22 13:04:54 kls Exp $ */ #include "skinclassic.h" @@ -280,7 +280,7 @@ void cSkinClassicDisplayMenu::SetEvent(const cEvent *Event) int y = y2; cTextScroller ts; char t[32]; - snprintf(t, sizeof(t), "%s %s - %s", Event->GetDateString(), Event->GetTimeString(), Event->GetEndTimeString());//TODO dayname, no year + snprintf(t, sizeof(t), "%s %s - %s", Event->GetDateString(), Event->GetTimeString(), Event->GetEndTimeString()); ts.Set(osd, xl, y, x1 - xl, y3 - y, t, font, Theme.Color(clrMenuEventTime), Theme.Color(clrBackground)); if (Event->Vps() && Event->Vps() != Event->StartTime()) { char *buffer; diff --git a/skinsttng.c b/skinsttng.c index cb44a3e0..a268978a 100644 --- a/skinsttng.c +++ b/skinsttng.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: skinsttng.c 1.1 2004/05/16 09:27:35 kls Exp $ + * $Id: skinsttng.c 1.2 2004/05/22 13:05:07 kls Exp $ */ // Star Trek: The Next Generation® is a registered trademark of Paramount Pictures @@ -515,7 +515,7 @@ void cSkinSTTNGDisplayMenu::SetEvent(const cEvent *Event) int y = y3; cTextScroller ts; char t[32]; - snprintf(t, sizeof(t), "%s %s - %s", Event->GetDateString(), Event->GetTimeString(), Event->GetEndTimeString());//TODO dayname, no year + snprintf(t, sizeof(t), "%s %s - %s", Event->GetDateString(), Event->GetTimeString(), Event->GetEndTimeString()); ts.Set(osd, xl, y, x4 - xl, y4 - y, t, font, Theme.Color(clrMenuEventTime), Theme.Color(clrBackground)); if (Event->Vps() && Event->Vps() != Event->StartTime()) { char *buffer; diff --git a/tools.c b/tools.c index fc8cb294..42193b2f 100644 --- a/tools.c +++ b/tools.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: tools.c 1.78 2004/01/11 15:42:30 kls Exp $ + * $Id: tools.c 1.79 2004/05/22 12:13:27 kls Exp $ */ #include "tools.h" @@ -495,6 +495,12 @@ const char *WeekDayName(int WeekDay) return "???"; } +const char *WeekDayName(time_t t) +{ + struct tm tm_r; + return WeekDayName(localtime_r(&t, &tm_r)->tm_wday); +} + const char *DayDateTime(time_t t) { static char buffer[32]; diff --git a/tools.h b/tools.h index 5af8ffa4..2132d001 100644 --- a/tools.h +++ b/tools.h @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: tools.h 1.55 2004/01/11 15:42:15 kls Exp $ + * $Id: tools.h 1.56 2004/05/22 12:11:44 kls Exp $ */ #ifndef __TOOLS_H @@ -84,6 +84,7 @@ bool RemoveEmptyDirectories(const char *DirName, bool RemoveThis = false); char *ReadLink(const char *FileName); bool SpinUpDisk(const char *FileName); const char *WeekDayName(int WeekDay); ///< \warning returns a statically allocated string! +const char *WeekDayName(time_t t); ///< \warning returns a statically allocated string! const char *DayDateTime(time_t t = 0); ///< \warning returns a statically allocated string! class cPoller {