Rework cRecMenuItemDayChooser

This commit is contained in:
kamel5 2019-07-18 17:48:32 +02:00
parent b17fd9b7aa
commit 152662d519
3 changed files with 5 additions and 6 deletions

View File

@ -2100,14 +2100,13 @@ eRecMenuState cRecMenuItemChannelChooser::ProcessKey(eKeys Key) {
// --- cRecMenuItemDayChooser ------------------------------------------------------- // --- cRecMenuItemDayChooser -------------------------------------------------------
cRecMenuItemDayChooser::cRecMenuItemDayChooser(cString text, cRecMenuItemDayChooser::cRecMenuItemDayChooser(cString text,
int weekdays,
bool active, bool active,
int *callback) { int *callback) {
selectable = true; selectable = true;
this->text = text; this->text = text;
this->weekdays = *callback;
if (weekdays < 1) if (weekdays < 1)
weekdays *= -1; weekdays *= -1;
this->weekdays = weekdays;
this->active = active; this->active = active;
this->callback = callback; this->callback = callback;
height = 3 * font->Height() / 2; height = 3 * font->Height() / 2;

View File

@ -538,7 +538,6 @@ private:
bool WeekDaySet(unsigned day); bool WeekDaySet(unsigned day);
public: public:
cRecMenuItemDayChooser (cString text, cRecMenuItemDayChooser (cString text,
int weekdays,
bool active = false, bool active = false,
int *callback = NULL); int *callback = NULL);
virtual ~cRecMenuItemDayChooser(void); virtual ~cRecMenuItemDayChooser(void);

View File

@ -526,7 +526,7 @@ cRecMenuSeriesTimer::cRecMenuSeriesTimer(const cChannel *initialChannel, const c
AddMenuItem(new cRecMenuItemChannelChooser(tr("Channel"), false, &channel)); AddMenuItem(new cRecMenuItemChannelChooser(tr("Channel"), false, &channel));
AddMenuItem(new cRecMenuItemTime(tr("Series Timer start time"), false, &start)); AddMenuItem(new cRecMenuItemTime(tr("Series Timer start time"), false, &start));
AddMenuItem(new cRecMenuItemTime(tr("Series Timer stop time"), false, &stop)); 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 cRecMenuItemDay(tr("Day to start"), false, &tstart));
AddMenuItem(new cRecMenuItemInt(tr("Priority"), 0, MAXPRIORITY, false, &priority)); AddMenuItem(new cRecMenuItemInt(tr("Priority"), 0, MAXPRIORITY, false, &priority));
AddMenuItem(new cRecMenuItemInt(tr("Lifetime"), 0, MAXLIFETIME, false, &lifetime)); AddMenuItem(new cRecMenuItemInt(tr("Lifetime"), 0, MAXLIFETIME, false, &lifetime));
@ -724,6 +724,7 @@ cRecMenuSearchTimerEdit::cRecMenuSearchTimerEdit(cTVGuideSearchTimer searchTimer
std::string dir = sT.directory; std::string dir = sT.directory;
strncpy(directory, dir.c_str(), TEXTINPUTLENGTH); strncpy(directory, dir.c_str(), TEXTINPUTLENGTH);
dayOfWeek = DayOfWeek(sT.dayOfWeek); dayOfWeek = DayOfWeek(sT.dayOfWeek);
// dsyslog("Weekday = %i, %i", sT.dayOfWeek, dayOfWeek);
indent = " "; indent = " ";
if (sT.useChannel == 1) { if (sT.useChannel == 1) {
@ -764,7 +765,7 @@ cRecMenuSearchTimerEdit::~cRecMenuSearchTimerEdit(void) {
int cRecMenuSearchTimerEdit::DayOfWeek(int dayofWeek) { int cRecMenuSearchTimerEdit::DayOfWeek(int dayofWeek) {
int vdrDayOfWeek = 0; int vdrDayOfWeek = 0;
if (dayofWeek >= 0) { if (dayofWeek > 0) {
vdrDayOfWeek = pow(2, (dayofWeek + 6) % 7); vdrDayOfWeek = pow(2, (dayofWeek + 6) % 7);
} else if (dayofWeek < 0) { } else if (dayofWeek < 0) {
int absDayOfWeek = abs(dayofWeek); 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)); mainMenuItems.push_back(new cRecMenuItemBool(tr("Use day of week"), false, &sT.useDayOfWeek, rmsSearchTimerSave, true));
if (sT.useDayOfWeek) 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 in Favorites"), false, &sT.useInFavorites, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemBool(tr("Use as search timer"), false, &sT.useAsSearchTimer, rmsSearchTimerSave, true)); mainMenuItems.push_back(new cRecMenuItemBool(tr("Use as search timer"), false, &sT.useAsSearchTimer, rmsSearchTimerSave, true));
if (sT.useAsSearchTimer) { if (sT.useAsSearchTimer) {