diff -up x/epg.c ./epg.c --- x/epg.c Fri Dec 30 16:41:59 2005 +++ ./epg.c Sat Jan 14 17:33:48 2006 @@ -230,6 +230,14 @@ cString cEvent::GetVpsString(void) const return buf; } +cString cEvent::GetWeekdayString() const +{ + char buf[4]; + struct tm tm_r; + strn0cpy(buf, WeekDayName(localtime_r(&startTime, &tm_r)->tm_wday), sizeof(buf)); + return buf; +} + void cEvent::Dump(FILE *f, const char *Prefix, bool InfoOnly) const { if (InfoOnly || startTime + duration + Setup.EPGLinger * 60 >= time(NULL)) { diff -up x/epg.h ./epg.h --- x/epg.h Tue Dec 27 15:31:24 2005 +++ ./epg.h Sat Jan 14 17:33:48 2006 @@ -88,6 +88,7 @@ public: cString GetTimeString(void) const; cString GetEndTimeString(void) const; cString GetVpsString(void) const; + cString GetWeekdayString(void) const; void SetEventID(u_int16_t EventID); void SetTableID(uchar TableID); void SetVersion(uchar Version); diff -up x/menu.c ./menu.c --- x/menu.c Sun Jan 8 12:39:57 2006 +++ ./menu.c Sat Jan 14 18:14:47 2006 @@ -1154,6 +1154,23 @@ eOSState cMenuWhatsOn::ProcessKey(eKeys return state; } +// --- cMenuScheduleSeparator ------------------------------------------------ + +class cMenuScheduleSeparator : public cOsdItem { +public: + const cEvent *event; + cMenuScheduleSeparator(const char *DateString); +}; + +cMenuScheduleSeparator::cMenuScheduleSeparator(const char *DateString) +{ + event = NULL; + char *buffer = NULL; + asprintf(&buffer, ">>> %s: %.*s", tr("New Day"), 10, DateString); + SetText(buffer, false); + SetSelectable(false); +} + // --- cMenuSchedule --------------------------------------------------------- class cMenuSchedule : public cOsdMenu { @@ -1206,9 +1223,14 @@ void cMenuSchedule::PrepareSchedule(cCha if (Schedule) { const cEvent *PresentEvent = Schedule->GetPresentEvent(Channel->Number() == cDevice::CurrentChannel()); time_t now = time(NULL) - Setup.EPGLinger * 60; + char curDate[10] = ""; for (const cEvent *Event = Schedule->Events()->First(); Event; Event = Schedule->Events()->Next(Event)) { - if (Event->EndTime() > now || Event == PresentEvent) + if (Event->EndTime() > now || Event == PresentEvent) { + if (strlen(curDate) > 0 && strncmp(Event->GetWeekdayString(), curDate, 10) != 0) + Add(new cMenuScheduleSeparator(Event->GetDateString())); Add(new cMenuScheduleItem(Event), Event == PresentEvent); + strncpy(curDate, Event->GetWeekdayString(), 10); + } } } } @@ -1218,7 +1240,8 @@ bool cMenuSchedule::Update(void) { bool result = false; for (cOsdItem *item = First(); item; item = Next(item)) { - if (((cMenuScheduleItem *)item)->Update()) + cMenuScheduleItem * msItem = dynamic_cast (item); + if (msItem && msItem->Update()) result = true; } return result; diff -up x/vdr.c ./vdr.c --- x/vdr.c Sun Jan 8 12:49:03 2006 +++ ./vdr.c Sat Jan 14 17:48:23 2006 @@ -339,14 +339,16 @@ int main(int argc, char *argv[]) if (getuid() == 0) { StartedAsRoot = true; - if (!SetKeepCaps(true)) - return 2; - if (!SetUser(VdrUser)) - return 2; - if (!SetKeepCaps(false)) - return 2; - if (!SetCapSysTime()) - return 2; + if (strcmp(VdrUser, "root")) { + if (!SetKeepCaps(true)) + return 2; + if (!SetUser(VdrUser)) + return 2; + if (!SetKeepCaps(false)) + return 2; + if (!SetCapSysTime()) + return 2; + } } // Help and version info: