Refactor cRecMenuConfirmSeriesTimer

This commit is contained in:
kamel5 2019-11-09 13:36:46 +01:00
parent 2531526a4d
commit cf9250e50b

View File

@ -574,18 +574,21 @@ void cRecMenuSeriesTimer::CalculateTimes(const cEvent *event) {
} }
// --- cRecMenuConfirmSeriesTimer --------------------------------------------------------- // --- cRecMenuConfirmSeriesTimer ---------------------------------------------------------
cRecMenuConfirmSeriesTimer::cRecMenuConfirmSeriesTimer(cTimer *seriesTimer) { cRecMenuConfirmSeriesTimer::cRecMenuConfirmSeriesTimer(cTimer *seriesTimer) { // OK
SetWidthPercent(50); SetWidthPercent(50);
cString message = tr("Series Timer created");
cString infoText = message; int i = 1;
cString line2 = "";
const cString line1 = tr("Series Timer created");
if (seriesTimer) { if (seriesTimer) {
cString days = cTimer::PrintDay(seriesTimer->Day(), seriesTimer->WeekDays(), true); const cString days = cTimer::PrintDay(seriesTimer->Day(), seriesTimer->WeekDays(), true);
infoText = cString::sprintf("%s\n%s, %s: %s, %s: %s", *message, *days, tr("Start"), *TimeString(seriesTimer->StartTime()), tr("Stop"), *TimeString(seriesTimer->StopTime())); line2 = cString::sprintf("%s, %s: %s, %s: %s", *days, tr("Start"), *TimeString(seriesTimer->StartTime()), tr("Stop"), *TimeString(seriesTimer->StopTime()));
i = 2;
} }
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText);
infoItem->CalculateHeight(width - 2 * border); AddHeader(new cRecMenuItemInfo(*line1, i, *line2, "", "", width - 2 * border, true));
AddMenuItem(infoItem); AddFooter(new cRecMenuItemButton(tr("OK"), rmsClose, true, true));
AddMenuItem(new cRecMenuItemButton(tr("OK"), rmsClose, true, true));
CalculateHeight(); CalculateHeight();
CreatePixmap(); CreatePixmap();
Arrange(); Arrange();