mirror of
https://projects.vdr-developer.org/git/vdr-plugin-tvguide.git
synced 2023-10-05 15:01:48 +02:00
Refactor cRecMenuSearchTimerEdit
This commit is contained in:
parent
54ce728fa5
commit
d24bbefe4c
26
recmenus.c
26
recmenus.c
@ -704,7 +704,9 @@ int cRecMenuSearchTimers::GetTotalNumMenuItems(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// --- cRecMenuSearchTimerEdit ---------------------------------------------------------
|
// --- cRecMenuSearchTimerEdit ---------------------------------------------------------
|
||||||
cRecMenuSearchTimerEdit::cRecMenuSearchTimerEdit(cTVGuideSearchTimer searchTimer, std::vector<std::string> channelGroups) {
|
cRecMenuSearchTimerEdit::cRecMenuSearchTimerEdit(cTVGuideSearchTimer searchTimer, std::vector<std::string> channelGroups) { // OK
|
||||||
|
SetWidthPercent(70);
|
||||||
|
|
||||||
init = true;
|
init = true;
|
||||||
deleteMenuItems = false;
|
deleteMenuItems = false;
|
||||||
this->sT = searchTimer;
|
this->sT = searchTimer;
|
||||||
@ -714,7 +716,6 @@ 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) {
|
||||||
@ -731,18 +732,11 @@ cRecMenuSearchTimerEdit::cRecMenuSearchTimerEdit(cTVGuideSearchTimer searchTimer
|
|||||||
sT.GetDelModes(&delModes);
|
sT.GetDelModes(&delModes);
|
||||||
channelgroupIndex = SplitChannelGroups(&channelGroups, &channelgroups);
|
channelgroupIndex = SplitChannelGroups(&channelGroups, &channelgroups);
|
||||||
|
|
||||||
SetWidthPercent(70);
|
const cString line1 = (sT.GetID() > -1) ? tr("Configure Search Timer Options") : tr("Create Search Timer");
|
||||||
cString infoText;
|
|
||||||
if (sT.GetID() > -1) {
|
AddHeader(new cRecMenuItemInfo(*line1, 1, "", "", "", width - 2 * border, true));
|
||||||
infoText = tr("Configure Search Timer Options");
|
AddFooter(new cRecMenuItemButtonYesNo(tr("Save Search Timer"), tr("Cancel"), rmsSearchTimerSave, rmsSearchTimers, false));
|
||||||
} else {
|
|
||||||
infoText = tr("Create Search Timer");
|
|
||||||
}
|
|
||||||
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText, true);
|
|
||||||
infoItem->CalculateHeight(width - 2 * border);
|
|
||||||
SetHeader(infoItem);
|
|
||||||
cRecMenuItemButtonYesNo *footerButton = new cRecMenuItemButtonYesNo(tr("Save Search Timer"), tr("Cancel"), rmsSearchTimerSave, rmsSearchTimers, false);
|
|
||||||
SetFooter(footerButton);
|
|
||||||
CreateMenuItems();
|
CreateMenuItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -770,9 +764,9 @@ int cRecMenuSearchTimerEdit::DayOfWeek(int dayofWeek) {
|
|||||||
|
|
||||||
int cRecMenuSearchTimerEdit::SetDayOfWeek(int VDRDayOfWeek) {
|
int cRecMenuSearchTimerEdit::SetDayOfWeek(int VDRDayOfWeek) {
|
||||||
int epgSearchDayOfWeek = 0;
|
int epgSearchDayOfWeek = 0;
|
||||||
for (int i=0; i < 7; i++) {
|
for (int i = 0; i < 7; i++) {
|
||||||
if (VDRDayOfWeek & (1 << i)) {
|
if (VDRDayOfWeek & (1 << i)) {
|
||||||
epgSearchDayOfWeek += pow(2, (i+1)%7);
|
epgSearchDayOfWeek += pow(2, (i + 1) % 7);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return epgSearchDayOfWeek * (-1);
|
return epgSearchDayOfWeek * (-1);
|
||||||
|
Loading…
Reference in New Issue
Block a user