diff options
author | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2019-11-09 15:04:52 +0100 |
---|---|---|
committer | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2022-06-18 17:03:15 +0200 |
commit | 380e84afcdbeccc2fc1899f1a92e3ab97bf3819d (patch) | |
tree | bf291c8635eaa3b06afe7e2635fb3a5175983587 | |
parent | 412a78a112ea3ebe689cbbe9a30d3483f97fe54a (diff) | |
download | vdr-plugin-tvguide-380e84afcdbeccc2fc1899f1a92e3ab97bf3819d.tar.gz vdr-plugin-tvguide-380e84afcdbeccc2fc1899f1a92e3ab97bf3819d.tar.bz2 |
Refactor cRecMenuSearchNothingFound
-rw-r--r-- | recmenus.c | 39 |
1 files changed, 14 insertions, 25 deletions
@@ -1243,6 +1243,20 @@ const cEvent *cRecMenuSearchResults::GetEvent(void) { return NULL; } +// --- cRecMenuSearchNothingFound --------------------------------------------------------- +cRecMenuSearchNothingFound::cRecMenuSearchNothingFound(std::string searchString, bool tooShort) { // OK + SetWidthPercent(50); + + const cString line1 = cString::sprintf("%s", (!tooShort) ? tr("Nothing found for Search String") : tr("Search String has to have at least three letters")); + const cString line2 = cString::sprintf("\"%s\"", searchString.c_str()); + + AddHeader(new cRecMenuItemInfo(*line1, 2, *line2, "", "", width - 2 * border)); + AddFooter(new cRecMenuItemButton(tr("OK"), rmsSearchNothingFoundConfirm, true, true)); + + CalculateHeight(); + CreatePixmap(); + Arrange(); +} // --- cRecMenuSearchConfirmTimer --------------------------------------------------------- cRecMenuSearchConfirmTimer::cRecMenuSearchConfirmTimer(const cEvent *event, eRecMenuState nextAction) { @@ -1271,31 +1285,6 @@ cRecMenuSearchConfirmTimer::cRecMenuSearchConfirmTimer(const cEvent *event, eRec Arrange(); } -// --- cRecMenuSearchNothingFound --------------------------------------------------------- -cRecMenuSearchNothingFound::cRecMenuSearchNothingFound(std::string searchString, bool tooShort) { - SetWidthPercent(50); - cString text; - if (!tooShort) { - cString message = tr("Nothing found for Search String"); - text = cString::sprintf("%s\n\"%s\"", - *message, - searchString.c_str()); - } else { - cString message = tr("Search String has to have at least three letters"); - 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"), rmsSearchNothingFoundConfirm, true, true)); - CalculateHeight(); - CreatePixmap(); - Arrange(); -} - /****************************************************************************************** * Recording Search Menus ******************************************************************************************/ |