From bb7d03c7ed49723420d78f30205592b3441c8a1e Mon Sep 17 00:00:00 2001 From: kamel5 Date: Sat, 9 Nov 2019 15:38:48 +0100 Subject: [PATCH] Refactor cRecMenuRecordingSearchNotFound --- recmenus.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/recmenus.c b/recmenus.c index d13b96c..bf97774 100644 --- a/recmenus.c +++ b/recmenus.c @@ -1482,16 +1482,15 @@ int cRecMenuRecordingSearchResults::GetTotalNumMenuItems(void) { } // --- cRecMenuRecordingSearchNotFound --------------------------------------------------------- -cRecMenuRecordingSearchNotFound::cRecMenuRecordingSearchNotFound(std::string searchString) { +cRecMenuRecordingSearchNotFound::cRecMenuRecordingSearchNotFound(std::string searchString) { // OK SetWidthPercent(50); - cString message = tr("No recordings found for"); - cString text = cString::sprintf("%s\n\"%s\"", - *message, - searchString.c_str()); - cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*text); - infoItem->CalculateHeight(width - 2 * border); - AddMenuItem(infoItem); - AddMenuItem(new cRecMenuItemButton(tr("OK"), rmsClose, true, true)); + + const cString line1 = cString::sprintf("%s", tr("No recordings found for")); + const cString line2 = cString::sprintf("\"%s\"", searchString.c_str()); + + AddHeader(new cRecMenuItemInfo(tr("No recordings found for"), 2, *line2, "", "", width - 2 * border)); + AddFooter(new cRecMenuItemButton(tr("OK"), rmsClose, true, true)); + CalculateHeight(); CreatePixmap(); Arrange();