mirror of
https://projects.vdr-developer.org/git/vdr-plugin-tvguide.git
synced 2023-10-05 15:01:48 +02:00
Rework cRecMenuItemDayChooser
This commit is contained in:
parent
b17fd9b7aa
commit
152662d519
@ -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;
|
||||
|
@ -538,7 +538,6 @@ private:
|
||||
bool WeekDaySet(unsigned day);
|
||||
public:
|
||||
cRecMenuItemDayChooser (cString text,
|
||||
int weekdays,
|
||||
bool active = false,
|
||||
int *callback = NULL);
|
||||
virtual ~cRecMenuItemDayChooser(void);
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user