diff options
author | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2019-11-09 13:36:46 +0100 |
---|---|---|
committer | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2022-06-18 17:03:15 +0200 |
commit | cf9250e50b4a3baf4f808da3bd773bb67870fbcc (patch) | |
tree | 41fd5c560f6914ff2574e0c798c307f3feeaa624 /recmenus.c | |
parent | 2531526a4dd15af0cca96bd49150e05a4c3d2287 (diff) | |
download | vdr-plugin-tvguide-cf9250e50b4a3baf4f808da3bd773bb67870fbcc.tar.gz vdr-plugin-tvguide-cf9250e50b4a3baf4f808da3bd773bb67870fbcc.tar.bz2 |
Refactor cRecMenuConfirmSeriesTimer
Diffstat (limited to 'recmenus.c')
-rw-r--r-- | recmenus.c | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -574,18 +574,21 @@ void cRecMenuSeriesTimer::CalculateTimes(const cEvent *event) { } // --- cRecMenuConfirmSeriesTimer --------------------------------------------------------- -cRecMenuConfirmSeriesTimer::cRecMenuConfirmSeriesTimer(cTimer *seriesTimer) { +cRecMenuConfirmSeriesTimer::cRecMenuConfirmSeriesTimer(cTimer *seriesTimer) { // OK 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) { - 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())); + const cString days = cTimer::PrintDay(seriesTimer->Day(), seriesTimer->WeekDays(), true); + 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); - AddMenuItem(infoItem); - AddMenuItem(new cRecMenuItemButton(tr("OK"), rmsClose, true, true)); + + AddHeader(new cRecMenuItemInfo(*line1, i, *line2, "", "", width - 2 * border, true)); + AddFooter(new cRecMenuItemButton(tr("OK"), rmsClose, true, true)); + CalculateHeight(); CreatePixmap(); Arrange(); |