diff options
author | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2019-11-09 14:01:19 +0100 |
---|---|---|
committer | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2022-06-18 17:03:15 +0200 |
commit | 54ce728fa5a81cd5c5415ecf0f4e32a0eeb265af (patch) | |
tree | 5e44fa8d1069468f5822298e64c513a31208ecdf /recmenus.c | |
parent | a4cc2a4fa86fa9ff78323f6d25e7d58871a732a8 (diff) | |
download | vdr-plugin-tvguide-54ce728fa5a81cd5c5415ecf0f4e32a0eeb265af.tar.gz vdr-plugin-tvguide-54ce728fa5a81cd5c5415ecf0f4e32a0eeb265af.tar.bz2 |
Refactor cRecMenuSearchTimers
Diffstat (limited to 'recmenus.c')
-rw-r--r-- | recmenus.c | 40 |
1 files changed, 15 insertions, 25 deletions
@@ -665,37 +665,27 @@ TVGuideEPGSearchTemplate cRecMenuSearchTimerTemplates::GetTemplate(void) { } // --- cRecMenuSearchTimers --------------------------------------------------------- -cRecMenuSearchTimers::cRecMenuSearchTimers(std::vector<cTVGuideSearchTimer> searchTimers) { +cRecMenuSearchTimers::cRecMenuSearchTimers(std::vector<cTVGuideSearchTimer> searchTimers) { // OK + SetWidthPercent(70); + this->searchTimers = searchTimers; numSearchTimers = searchTimers.size(); - SetWidthPercent(70); - cString headline; - if (numSearchTimers > 0) { - headline = tr("EPGSearch Search Timers"); - } else { - headline = tr("No Search Timers Configured"); - } - cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*headline, true); - infoItem->CalculateHeight(width - 2 * border); - SetHeader(infoItem); - cRecMenuItem *button = new cRecMenuItemButton(tr("Close"), rmsClose, (!numSearchTimers)?true:false); - SetFooter(button); - if (numSearchTimers > 0) - SetMenuItems(); - CalculateHeight(); - CreatePixmap(); - Arrange(); -} -cRecMenuSearchTimers::~cRecMenuSearchTimers(void) { + const cString line1 = (numSearchTimers > 0) ? tr("EPGSearch Search Timers") : tr("No Search Timers Configured"); -} + AddHeader(new cRecMenuItemInfo(*line1, 1, "", "", "", width - 2 * border, true)); + AddFooter(new cRecMenuItemButton(tr("Close"), rmsClose, (!numSearchTimers) ? true : false)); -void cRecMenuSearchTimers::SetMenuItems(void) { - for (int i = 0; i < numSearchTimers; i++) { - if (!AddMenuItemInitial(new cRecMenuItemSearchTimer(searchTimers[i], rmsSearchTimerTest, rmsSearchTimerEdit, rmsSearchTimerDeleteConfirm, (i==0)?true:false))) - break; + if (numSearchTimers > 0) { + for (int i = 0; i < numSearchTimers; i++) { + if (!AddMenuItemInitial(new cRecMenuItemSearchTimer(searchTimers[i], rmsSearchTimerTest, rmsSearchTimerEdit, rmsSearchTimerDeleteConfirm, (i == 0) ? true : false))) + break; + } } + + CalculateHeight(); + CreatePixmap(); + Arrange(); } cTVGuideSearchTimer cRecMenuSearchTimers::GetSearchTimer(void) { |