diff options
author | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2019-07-18 16:41:04 +0200 |
---|---|---|
committer | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2019-07-19 11:38:04 +0200 |
commit | 31f72f2ad82506cd33e25ea3ab2da415d25fc9cb (patch) | |
tree | 5bb5f7fb1c494aed70dcef6ae4980b1290b18216 /recmenus.c | |
parent | a1aa30025958754feadc4313f56b63cc1d260fc0 (diff) | |
download | vdr-plugin-tvguide-31f72f2ad82506cd33e25ea3ab2da415d25fc9cb.tar.gz vdr-plugin-tvguide-31f72f2ad82506cd33e25ea3ab2da415d25fc9cb.tar.bz2 |
Rework cRecMenuItemChannelChooser
Diffstat (limited to 'recmenus.c')
-rw-r--r-- | recmenus.c | 31 |
1 files changed, 11 insertions, 20 deletions
@@ -523,11 +523,7 @@ cRecMenuSeriesTimer::cRecMenuSeriesTimer(const cChannel *initialChannel, const c SetHeader(infoItem); AddMenuItem(new cRecMenuItemBool(tr("Timer Active"), timerActive, false, &timerActive)); -#if VDRVERSNUM >= 20301 - AddMenuItem(new cRecMenuItemChannelChooser(tr("Channel"), initialChannel, false, &channel)); -#else - AddMenuItem(new cRecMenuItemChannelChooser(tr("Channel"), (cChannel*)initialChannel, false, &channel)); -#endif + AddMenuItem(new cRecMenuItemChannelChooser(tr("Channel"), false, &channel)); AddMenuItem(new cRecMenuItemTime(tr("Series Timer start time"), start, false, &start)); AddMenuItem(new cRecMenuItemTime(tr("Series Timer stop time"), stop, false, &stop)); AddMenuItem(new cRecMenuItemDayChooser(tr("Days to record"), dayOfWeek, false, &dayOfWeek)); @@ -730,6 +726,13 @@ cRecMenuSearchTimerEdit::cRecMenuSearchTimerEdit(cTVGuideSearchTimer searchTimer dayOfWeek = DayOfWeek(sT.dayOfWeek); indent = " "; + if (sT.useChannel == 1) { + startChannel = (sT.channelMin) ? sT.channelMin->Number() : 0; + stopChannel = (sT.channelMax) ? sT.channelMax->Number() : 0; + if (startChannel == 0) startChannel = 1; + if (stopChannel == 0) stopChannel = 1; + } + sT.GetSearchModes(&searchModes); sT.GetUseChannelModes(&useChannelModes); sT.GetCompareDateModes(&compareDateModes); @@ -828,20 +831,8 @@ void cRecMenuSearchTimerEdit::CreateMenuItems(void) { // mainMenuItems.push_back(new cRecMenuItemBool(tr("Use content descriptor"), sT.useContentDescriptors, false, &sT.useContentDescriptors, rmsSearchTimerSave)); mainMenuItems.push_back(new cRecMenuItemSelect(tr("Use channel"), useChannelModes, sT.useChannel, false, &sT.useChannel, rmsSearchTimerSave, true)); if (sT.useChannel == 1) { - startChannel = (sT.channelMin) ? sT.channelMin->Number() : 0; - stopChannel = (sT.channelMax) ? sT.channelMax->Number() : 0; - if (startChannel == 0) startChannel = 1; - if (stopChannel == 0) stopChannel = 1; -#if VDRVERSNUM >= 20301 - { - LOCK_CHANNELS_READ; - mainMenuItems.push_back(new cRecMenuItemChannelChooser(cString::sprintf("%s%s", *indent, tr("from channel")), Channels->GetByNumber(startChannel), false, &startChannel, rmsSearchTimerSave)); - mainMenuItems.push_back(new cRecMenuItemChannelChooser(cString::sprintf("%s%s", *indent, tr("to channel")), Channels->GetByNumber(stopChannel), false, &stopChannel, rmsSearchTimerSave)); - } -#else - mainMenuItems.push_back(new cRecMenuItemChannelChooser(cString::sprintf("%s%s", *indent, tr("from channel")), Channels.GetByNumber(startChannel), false, &startChannel, rmsSearchTimerSave)); - mainMenuItems.push_back(new cRecMenuItemChannelChooser(cString::sprintf("%s%s", *indent, tr("to channel")), Channels.GetByNumber(stopChannel), false, &stopChannel, rmsSearchTimerSave)); -#endif + mainMenuItems.push_back(new cRecMenuItemChannelChooser(cString::sprintf("%s%s", *indent, tr("from channel")), false, &startChannel, rmsSearchTimerSave)); + mainMenuItems.push_back(new cRecMenuItemChannelChooser(cString::sprintf("%s%s", *indent, tr("to channel")), false, &stopChannel, rmsSearchTimerSave)); } else if ((sT.useChannel == 2) && (channelgroups.size() > 0)) { mainMenuItems.push_back(new cRecMenuItemSelect(cString::sprintf("%s%s", *indent, tr("Channel group")), channelgroups, channelgroupIndex, false, &channelgroupIndex, rmsSearchTimerSave, false)); @@ -1211,7 +1202,7 @@ cRecMenuSearch::cRecMenuSearch(std::string searchString, bool withOptions) { cTVGuideSearchTimer searchTimer; searchTimer.GetSearchModes(&searchModes); AddMenuItemInitial(new cRecMenuItemSelect(tr("Search Mode"), searchModes, 0, false, &mode)); - AddMenuItemInitial(new cRecMenuItemChannelChooser(tr("Channel to Search"), NULL, false, &channelNr)); + AddMenuItemInitial(new cRecMenuItemChannelChooser(tr("Channel to Search"), false, &channelNr)); AddMenuItemInitial(new cRecMenuItemBool(tr("Search in title"), true, false, &useTitle)); AddMenuItemInitial(new cRecMenuItemBool(tr("Search in Subtitle"), true, false, &useSubTitle)); AddMenuItemInitial(new cRecMenuItemBool(tr("Search in Description"), false, false, &useDescription)); |