From 152662d519a0e4bcaeafc2c7af14d48bbdd8e232 Mon Sep 17 00:00:00 2001 From: kamel5 Date: Thu, 18 Jul 2019 17:48:32 +0200 Subject: [PATCH] Rework cRecMenuItemDayChooser --- recmenuitem.c | 3 +-- recmenuitem.h | 1 - recmenus.c | 7 ++++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/recmenuitem.c b/recmenuitem.c index 41d5237..b8fca6d 100644 --- a/recmenuitem.c +++ b/recmenuitem.c @@ -2100,14 +2100,13 @@ eRecMenuState cRecMenuItemChannelChooser::ProcessKey(eKeys Key) { // --- cRecMenuItemDayChooser ------------------------------------------------------- cRecMenuItemDayChooser::cRecMenuItemDayChooser(cString text, - int weekdays, bool active, int *callback) { selectable = true; this->text = text; + this->weekdays = *callback; if (weekdays < 1) weekdays *= -1; - this->weekdays = weekdays; this->active = active; this->callback = callback; height = 3 * font->Height() / 2; diff --git a/recmenuitem.h b/recmenuitem.h index 436d35f..e91b52f 100644 --- a/recmenuitem.h +++ b/recmenuitem.h @@ -538,7 +538,6 @@ private: bool WeekDaySet(unsigned day); public: cRecMenuItemDayChooser (cString text, - int weekdays, bool active = false, int *callback = NULL); virtual ~cRecMenuItemDayChooser(void); diff --git a/recmenus.c b/recmenus.c index 9456adf..171e133 100644 --- a/recmenus.c +++ b/recmenus.c @@ -526,7 +526,7 @@ cRecMenuSeriesTimer::cRecMenuSeriesTimer(const cChannel *initialChannel, const c AddMenuItem(new cRecMenuItemChannelChooser(tr("Channel"), false, &channel)); AddMenuItem(new cRecMenuItemTime(tr("Series Timer start time"), false, &start)); AddMenuItem(new cRecMenuItemTime(tr("Series Timer stop time"), false, &stop)); - AddMenuItem(new cRecMenuItemDayChooser(tr("Days to record"), dayOfWeek, false, &dayOfWeek)); + AddMenuItem(new cRecMenuItemDayChooser(tr("Days to record"), false, &dayOfWeek)); AddMenuItem(new cRecMenuItemDay(tr("Day to start"), false, &tstart)); AddMenuItem(new cRecMenuItemInt(tr("Priority"), 0, MAXPRIORITY, false, &priority)); AddMenuItem(new cRecMenuItemInt(tr("Lifetime"), 0, MAXLIFETIME, false, &lifetime)); @@ -724,6 +724,7 @@ cRecMenuSearchTimerEdit::cRecMenuSearchTimerEdit(cTVGuideSearchTimer searchTimer std::string dir = sT.directory; strncpy(directory, dir.c_str(), TEXTINPUTLENGTH); dayOfWeek = DayOfWeek(sT.dayOfWeek); +// dsyslog("Weekday = %i, %i", sT.dayOfWeek, dayOfWeek); indent = " "; if (sT.useChannel == 1) { @@ -764,7 +765,7 @@ cRecMenuSearchTimerEdit::~cRecMenuSearchTimerEdit(void) { int cRecMenuSearchTimerEdit::DayOfWeek(int dayofWeek) { int vdrDayOfWeek = 0; - if (dayofWeek >= 0) { + if (dayofWeek > 0) { vdrDayOfWeek = pow(2, (dayofWeek + 6) % 7); } else if (dayofWeek < 0) { int absDayOfWeek = abs(dayofWeek); @@ -849,7 +850,7 @@ void cRecMenuSearchTimerEdit::CreateMenuItems(void) { } mainMenuItems.push_back(new cRecMenuItemBool(tr("Use day of week"), false, &sT.useDayOfWeek, rmsSearchTimerSave, true)); if (sT.useDayOfWeek) - mainMenuItems.push_back(new cRecMenuItemDayChooser(cString::sprintf("%s%s", *indent, tr("Day of week")), dayOfWeek, false, &dayOfWeek)); + mainMenuItems.push_back(new cRecMenuItemDayChooser(cString::sprintf("%s%s", *indent, tr("Day of week")), false, &dayOfWeek)); mainMenuItems.push_back(new cRecMenuItemBool(tr("Use in Favorites"), false, &sT.useInFavorites, rmsSearchTimerSave)); mainMenuItems.push_back(new cRecMenuItemBool(tr("Use as search timer"), false, &sT.useAsSearchTimer, rmsSearchTimerSave, true)); if (sT.useAsSearchTimer) {