Refactor cRecMenuSearchTimerTemplatesCreate

This commit is contained in:
kamel5 2019-11-09 14:32:26 +01:00
parent 7f7a16498c
commit 4f95cffdb2

View File

@ -998,23 +998,21 @@ cRecMenuSearchTimerCreateConfirm::cRecMenuSearchTimerCreateConfirm(bool success)
} }
// --- cRecMenuSearchTimerTemplatesCreate --------------------------------------------------------- // --- cRecMenuSearchTimerTemplatesCreate ---------------------------------------------------------
cRecMenuSearchTimerTemplatesCreate::cRecMenuSearchTimerTemplatesCreate(TVGuideEPGSearchTemplate templ, cTVGuideSearchTimer searchTimer) { cRecMenuSearchTimerTemplatesCreate::cRecMenuSearchTimerTemplatesCreate(TVGuideEPGSearchTemplate templ, cTVGuideSearchTimer searchTimer) { // OK
this->templ = templ;
this->searchTimer = searchTimer;
SetWidthPercent(70); SetWidthPercent(70);
cString message1 = tr("Creating Search Timer"); this->templ = templ;
cString message2 = tr("Search Term"); this->searchTimer = searchTimer;
cString message3 = tr("Using Template");
const cString line1 = tr("Creating Search Timer");
cString infoText = cString::sprintf("%s\n%s: \"%s\"\n%s \"%s\"", *message1, *message2, searchTimer.GetSearchString().c_str(), *message3, templ.name.c_str()); const cString line2 = cString::sprintf("%s: \"%s\"", tr("Search Term"), searchTimer.GetSearchString().c_str());
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText); const cString line3 = cString::sprintf("%s \"%s\"", tr("Using Template"), templ.name.c_str());
infoItem->CalculateHeight(width - 2 * border);
AddMenuItem(infoItem); AddHeader(new cRecMenuItemInfo(*line1, 3, *line2, *line3, "", width - 2 * border));
AddFooter(new cRecMenuItemButtonYesNo(tr("Create Search Timer"), tr("Use other Template"), rmsSearchTimerSave, rmsSearchTimerOptions, false));
AddMenuItem(new cRecMenuItemButton(tr("Display Results for Search Timer"), rmsSearchTimerTest, true)); AddMenuItem(new cRecMenuItemButton(tr("Display Results for Search Timer"), rmsSearchTimerTest, true));
AddMenuItem(new cRecMenuItemButtonYesNo(tr("Create Search Timer"), tr("Use other Template"), rmsSearchTimerSave, rmsSearchTimerOptions, false));
CalculateHeight(); CalculateHeight();
CreatePixmap(); CreatePixmap();
Arrange(); Arrange();