diff --git a/recmenuitem.c b/recmenuitem.c index b5c8379..1cd9fbc 100644 --- a/recmenuitem.c +++ b/recmenuitem.c @@ -405,14 +405,13 @@ eRecMenuState cRecMenuItemInt::ProcessKey(eKeys Key) { // --- cRecMenuItemBool ------------------------------------------------------- cRecMenuItemBool::cRecMenuItemBool(cString text, - bool initialVal, bool active, bool *callback, eRecMenuState action, bool refresh) { selectable = true; this->text = text; - this->yes = initialVal; + this->yes = *callback; this->refresh = refresh; this->active = active; this->callback = callback; @@ -422,14 +421,13 @@ cRecMenuItemBool::cRecMenuItemBool(cString text, } cRecMenuItemBool::cRecMenuItemBool(cString text, - bool initialVal, bool active, int *callback, eRecMenuState action, bool refresh) { selectable = true; this->text = text; - this->yes = initialVal; + this->yes = *callback; this->refresh = refresh; this->active = active; this->callback = (bool*)callback; diff --git a/recmenuitem.h b/recmenuitem.h index c411bbf..3bdfb6e 100644 --- a/recmenuitem.h +++ b/recmenuitem.h @@ -225,13 +225,11 @@ private: void DrawValue(void); public: cRecMenuItemBool(cString text, - bool initialVal, bool active = false, bool *callback = NULL, eRecMenuState action = rmsNotConsumed, bool refresh = false); cRecMenuItemBool(cString text, - bool initialVal, bool active = false, int *callback = NULL, eRecMenuState action = rmsNotConsumed, diff --git a/recmenus.c b/recmenus.c index cc6d33e..ef4143e 100644 --- a/recmenus.c +++ b/recmenus.c @@ -444,7 +444,7 @@ cRecMenuEditTimer::cRecMenuEditTimer(const cTimer *timer, eRecMenuState nextStat lifetime = timer->Lifetime(); strncpy(folder, GetDirectoryFromTimer(timer->File()).c_str(), TEXTINPUTLENGTH); - AddMenuItemInitial(new cRecMenuItemBool(tr("Timer Active"), timerActive, true, &timerActive)); + AddMenuItemInitial(new cRecMenuItemBool(tr("Timer Active"), true, &timerActive)); AddMenuItemInitial(new cRecMenuItemInt(tr("Priority"), 0, MAXPRIORITY, false, &prio)); AddMenuItemInitial(new cRecMenuItemInt(tr("Lifetime"), 0, MAXLIFETIME, false, &lifetime)); AddMenuItemInitial(new cRecMenuItemDay(tr("Day"), day, false, &day)); @@ -522,7 +522,7 @@ cRecMenuSeriesTimer::cRecMenuSeriesTimer(const cChannel *initialChannel, const c infoItem->CalculateHeight(width - 2 * border); SetHeader(infoItem); - AddMenuItem(new cRecMenuItemBool(tr("Timer Active"), timerActive, false, &timerActive)); + AddMenuItem(new cRecMenuItemBool(tr("Timer Active"), false, &timerActive)); 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)); @@ -819,16 +819,16 @@ void cRecMenuSearchTimerEdit::CreateMenuItems(void) { } mainMenuItems.push_back(new cRecMenuItemText(tr("Search term"), searchString, TEXTINPUTLENGTH, init, searchString)); - mainMenuItems.push_back(new cRecMenuItemBool(tr("Active"), sT.useAsSearchTimer, false, &sT.useAsSearchTimer, rmsSearchTimerSave, true)); + mainMenuItems.push_back(new cRecMenuItemBool(tr("Active"), false, &sT.useAsSearchTimer, rmsSearchTimerSave, true)); mainMenuItems.push_back(new cRecMenuItemSelect(tr("Search mode"), searchModes, false, &sT.mode, rmsSearchTimerSave, true)); if (sT.mode == 5) { mainMenuItems.push_back(new cRecMenuItemInt(cString::sprintf("%s%s", *indent, tr("Tolerance")), 1, 9, false, &sT.fuzzyTolerance, rmsSearchTimerSave)); } - mainMenuItems.push_back(new cRecMenuItemBool(tr("Match case"), sT.useCase, false, &sT.useCase, rmsSearchTimerSave)); - mainMenuItems.push_back(new cRecMenuItemBool(tr("Use title"), sT.useTitle, false, &sT.useTitle, rmsSearchTimerSave)); - mainMenuItems.push_back(new cRecMenuItemBool(tr("Use subtitle"), sT.useSubtitle, false, &sT.useSubtitle, rmsSearchTimerSave)); - mainMenuItems.push_back(new cRecMenuItemBool(tr("Use description"), sT.useDescription, false, &sT.useDescription, rmsSearchTimerSave)); -// mainMenuItems.push_back(new cRecMenuItemBool(tr("Use content descriptor"), sT.useContentDescriptors, false, &sT.useContentDescriptors, rmsSearchTimerSave)); + mainMenuItems.push_back(new cRecMenuItemBool(tr("Match case"), false, &sT.useCase, rmsSearchTimerSave)); + mainMenuItems.push_back(new cRecMenuItemBool(tr("Use title"), false, &sT.useTitle, rmsSearchTimerSave)); + mainMenuItems.push_back(new cRecMenuItemBool(tr("Use subtitle"), false, &sT.useSubtitle, rmsSearchTimerSave)); + mainMenuItems.push_back(new cRecMenuItemBool(tr("Use description"), false, &sT.useDescription, rmsSearchTimerSave)); +// mainMenuItems.push_back(new cRecMenuItemBool(tr("Use content descriptor"), false, &sT.useContentDescriptors, rmsSearchTimerSave)); mainMenuItems.push_back(new cRecMenuItemSelect(tr("Use channel"), useChannelModes, false, &sT.useChannel, rmsSearchTimerSave, true)); if (sT.useChannel == 1) { mainMenuItems.push_back(new cRecMenuItemChannelChooser(cString::sprintf("%s%s", *indent, tr("from channel")), false, &startChannel, rmsSearchTimerSave)); @@ -837,48 +837,48 @@ void cRecMenuSearchTimerEdit::CreateMenuItems(void) { else if ((sT.useChannel == 2) && (channelgroups.size() > 0)) { mainMenuItems.push_back(new cRecMenuItemSelect(cString::sprintf("%s%s", *indent, tr("Channel group")), channelgroups, false, &channelgroupIndex, rmsSearchTimerSave, false)); } - mainMenuItems.push_back(new cRecMenuItemBool(tr("Use time"), sT.useTime, false, &sT.useTime, rmsSearchTimerSave, true)); + mainMenuItems.push_back(new cRecMenuItemBool(tr("Use time"), false, &sT.useTime, rmsSearchTimerSave, true)); if (sT.useTime) { mainMenuItems.push_back(new cRecMenuItemTime(cString::sprintf("%s%s", *indent, tr("Start after")), sT.startTime, false, &sT.startTime, rmsSearchTimerSave)); mainMenuItems.push_back(new cRecMenuItemTime(cString::sprintf("%s%s", *indent, tr("Start before")), sT.stopTime, false, &sT.stopTime, rmsSearchTimerSave)); } - mainMenuItems.push_back(new cRecMenuItemBool(tr("Use duration"), sT.useDuration, false, &sT.useDuration, rmsSearchTimerSave, true)); + mainMenuItems.push_back(new cRecMenuItemBool(tr("Use duration"), false, &sT.useDuration, rmsSearchTimerSave, true)); if (sT.useDuration) { mainMenuItems.push_back(new cRecMenuItemTime(cString::sprintf("%s%s", *indent, tr("Min. duration")), sT.minDuration, false, &sT.minDuration, rmsSearchTimerSave)); mainMenuItems.push_back(new cRecMenuItemTime(cString::sprintf("%s%s", *indent, tr("Max. duration")), sT.maxDuration, false, &sT.maxDuration, rmsSearchTimerSave)); } - mainMenuItems.push_back(new cRecMenuItemBool(tr("Use day of week"), sT.useDayOfWeek, false, &sT.useDayOfWeek, rmsSearchTimerSave, true)); + 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 cRecMenuItemBool(tr("Use in Favorites"), sT.useInFavorites, false, &sT.useInFavorites, rmsSearchTimerSave)); - mainMenuItems.push_back(new cRecMenuItemBool(tr("Use as search timer"), sT.useAsSearchTimer, false, &sT.useAsSearchTimer, rmsSearchTimerSave, true)); + 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) { mainMenuItems.push_back(new cRecMenuItemSelect(cString::sprintf("%s%s", *indent, tr("Action")), searchTimerModes, false, &sT.action, rmsSearchTimerSave, true)); if (sT.action == searchTimerActionSwitchOnly) { mainMenuItems.push_back(new cRecMenuItemInt(cString::sprintf("%s%s%s", *indent, *indent, tr("Switch ... minutes before start")), 0, 99, false, &sT.switchMinsBefore, rmsSearchTimerSave)); - mainMenuItems.push_back(new cRecMenuItemBool(cString::sprintf("%s%s%s", *indent, *indent, tr("Unmute sound")), sT.unmuteSoundOnSwitch, false, &sT.unmuteSoundOnSwitch, rmsSearchTimerSave)); + mainMenuItems.push_back(new cRecMenuItemBool(cString::sprintf("%s%s%s", *indent, *indent, tr("Unmute sound")), false, &sT.unmuteSoundOnSwitch, rmsSearchTimerSave)); } if (sT.action == searchTimerActionAnnounceAndSwitch) { mainMenuItems.push_back(new cRecMenuItemInt(cString::sprintf("%s%s%s", *indent, *indent, tr("Ask ... minutes before start")), 0, 99, false, &sT.switchMinsBefore, rmsSearchTimerSave)); - mainMenuItems.push_back(new cRecMenuItemBool(cString::sprintf("%s%s%s", *indent, *indent, tr("Unmute sound")), sT.unmuteSoundOnSwitch, false, &sT.unmuteSoundOnSwitch, rmsSearchTimerSave)); + mainMenuItems.push_back(new cRecMenuItemBool(cString::sprintf("%s%s%s", *indent, *indent, tr("Unmute sound")), false, &sT.unmuteSoundOnSwitch, rmsSearchTimerSave)); } if ((sT.action == searchTimerActionRecord) || (sT.action == searchTimerActionInactiveRecord)) { - mainMenuItems.push_back(new cRecMenuItemBool(cString::sprintf("%s%s%s", *indent, *indent, tr("Series Recording")), sT.useEpisode, false, &sT.useEpisode, rmsSearchTimerSave)); + mainMenuItems.push_back(new cRecMenuItemBool(cString::sprintf("%s%s%s", *indent, *indent, tr("Series Recording")), false, &sT.useEpisode, rmsSearchTimerSave)); mainMenuItems.push_back(new cRecMenuItemSelectDirectory(cString::sprintf("%s%s%s", *indent, *indent, tr("Directory")), std::string(directory), false, directory, rmsSearchTimerSave, true)); mainMenuItems.push_back(new cRecMenuItemInt(cString::sprintf("%s%s%s", *indent, *indent, tr("Delete recordings after ... days")), 0, 999, false, &sT.delAfterDays, rmsSearchTimerSave)); if (sT.delAfterDays > 0) { mainMenuItems.push_back(new cRecMenuItemInt(cString::sprintf("%s%s%s%s", *indent, *indent, *indent, tr("Keep ... recordings")), 0, 999, false, &sT.recordingsKeep, rmsSearchTimerSave)); } mainMenuItems.push_back(new cRecMenuItemInt(cString::sprintf("%s%s%s", *indent, *indent, tr("Pause when ... recordings exist")), 0, 999, false, &sT.pauseOnNrRecordings, rmsSearchTimerSave)); - mainMenuItems.push_back(new cRecMenuItemBool(cString::sprintf("%s%s%s", *indent, *indent, tr("Avoid Repeats")), sT.avoidRepeats, false, &sT.avoidRepeats, rmsSearchTimerSave, true)); + mainMenuItems.push_back(new cRecMenuItemBool(cString::sprintf("%s%s%s", *indent, *indent, tr("Avoid Repeats")), false, &sT.avoidRepeats, rmsSearchTimerSave, true)); if (sT.avoidRepeats) { mainMenuItems.push_back(new cRecMenuItemInt(cString::sprintf("%s%s%s%s", *indent, *indent, *indent, tr("Allowed repeats")), 0, 99, false, &sT.allowedRepeats, rmsSearchTimerSave)); if (sT.allowedRepeats > 0) { mainMenuItems.push_back(new cRecMenuItemInt(cString::sprintf("%s%s%s%s%s", *indent, *indent, *indent, *indent, tr("Only repeats within ... days")), 0, 999, false, &sT.repeatsWithinDays, rmsSearchTimerSave)); } - mainMenuItems.push_back(new cRecMenuItemBool(cString::sprintf("%s%s%s%s", *indent, *indent, *indent, tr("Compare Title")), sT.compareTitle, false, &sT.compareTitle, rmsSearchTimerSave)); - mainMenuItems.push_back(new cRecMenuItemBool(cString::sprintf("%s%s%s%s", *indent, *indent, *indent, tr("Compare Subtitle")), sT.compareSubtitle, false, &sT.compareSubtitle, rmsSearchTimerSave)); - mainMenuItems.push_back(new cRecMenuItemBool(cString::sprintf("%s%s%s%s", *indent, *indent, *indent, tr("Compare Description")), sT.compareSummary, false, &sT.compareSummary, rmsSearchTimerSave, true)); + mainMenuItems.push_back(new cRecMenuItemBool(cString::sprintf("%s%s%s%s", *indent, *indent, *indent, tr("Compare Title")), false, &sT.compareTitle, rmsSearchTimerSave)); + mainMenuItems.push_back(new cRecMenuItemBool(cString::sprintf("%s%s%s%s", *indent, *indent, *indent, tr("Compare Subtitle")), false, &sT.compareSubtitle, rmsSearchTimerSave)); + mainMenuItems.push_back(new cRecMenuItemBool(cString::sprintf("%s%s%s%s", *indent, *indent, *indent, tr("Compare Description")), false, &sT.compareSummary, rmsSearchTimerSave, true)); if (sT.compareSummary) { mainMenuItems.push_back(new cRecMenuItemInt(cString::sprintf("%s%s%s%s%s", *indent, *indent, *indent, *indent, tr("Min. match in %")), 1, 100, false, &sT.compareSummaryMatchInPercent, rmsSearchTimerSave)); } @@ -888,7 +888,7 @@ void cRecMenuSearchTimerEdit::CreateMenuItems(void) { mainMenuItems.push_back(new cRecMenuItemInt(cString::sprintf("%s%s%s", *indent, *indent, tr("Lifetime")), 0, 99, false, &sT.lifetime, rmsSearchTimerSave)); mainMenuItems.push_back(new cRecMenuItemInt(cString::sprintf("%s%s%s", *indent, *indent, tr("Time margin for start in minutes")), 0, 30, false, &sT.marginStart, rmsSearchTimerSave)); mainMenuItems.push_back(new cRecMenuItemInt(cString::sprintf("%s%s%s", *indent, *indent, tr("Time margin for stop in minutes")), 0, 30, false, &sT.marginStop, rmsSearchTimerSave)); - mainMenuItems.push_back(new cRecMenuItemBool(cString::sprintf("%s%s%s", *indent, *indent, tr("Use VPS")), sT.useVPS, false, &sT.useVPS, rmsSearchTimerSave)); + mainMenuItems.push_back(new cRecMenuItemBool(cString::sprintf("%s%s%s", *indent, *indent, tr("Use VPS")), false, &sT.useVPS, rmsSearchTimerSave)); mainMenuItems.push_back(new cRecMenuItemSelect(cString::sprintf("%s%s%s", *indent, *indent, tr("Auto delete")), delModes, false, &sT.delMode, rmsSearchTimerSave, true)); if (sT.delMode == 1) mainMenuItems.push_back(new cRecMenuItemInt(cString::sprintf("%s%s%s%s", *indent, *indent, *indent, tr("after ... recordings")), 0, 999, false, &sT.delAfterCountRecs, rmsSearchTimerSave)); @@ -1203,9 +1203,9 @@ cRecMenuSearch::cRecMenuSearch(std::string searchString, bool withOptions) { searchTimer.GetSearchModes(&searchModes); AddMenuItemInitial(new cRecMenuItemSelect(tr("Search Mode"), searchModes, false, &mode)); 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)); + AddMenuItemInitial(new cRecMenuItemBool(tr("Search in title"), false, &useTitle)); + AddMenuItemInitial(new cRecMenuItemBool(tr("Search in Subtitle"), false, &useSubTitle)); + AddMenuItemInitial(new cRecMenuItemBool(tr("Search in Description"), false, &useDescription)); } else { AddMenuItemInitial(new cRecMenuItemButton(tr("Show Search Options"), rmsSearchWithOptions, false)); }