diff options
Diffstat (limited to 'recmenus.c')
-rw-r--r-- | recmenus.c | 22 |
1 files changed, 10 insertions, 12 deletions
@@ -1444,28 +1444,26 @@ cRecMenuRecordingSearch::cRecMenuRecordingSearch(std::string search) { } // --- cRecMenuRecordingSearchResults --------------------------------------------------------- -cRecMenuRecordingSearchResults::cRecMenuRecordingSearchResults(std::string searchString, const cRecording **searchResults, int numResults) { +cRecMenuRecordingSearchResults::cRecMenuRecordingSearchResults(std::string searchString, const cRecording **searchResults, int numResults) { // OK + SetWidthPercent(80); + this->searchString = searchString; this->searchResults = searchResults; - SetWidthPercent(80); - cString message1 = tr("Found"); - cString message2 = tr("recording"); - cString message3 = tr("recordings"); - cString message4 = tr("for"); this->numResults = numResults; - cString infoText = cString::sprintf("%s %d %s %s:\n\"%s\"", *message1, numResults, (numResults>1)?(*message3):(*message2), *message4, searchString.c_str()); - cRecMenuItem *infoItem = new cRecMenuItemInfo(*infoText, true); - infoItem->CalculateHeight(width - 2 * border); - SetHeader(infoItem); - cRecMenuItem *buttons = new cRecMenuItemButtonYesNo(tr("Adapt Search"), tr("Close"), rmsRecordingSearch, rmsClose, false); - SetFooter(buttons); + const cString line1 = cString::sprintf("%s %d %s %s:", tr("Found"), numResults, (numResults > 1) ? tr("recordings") : tr("recording"), tr("for")); + const cString line2 = cString::sprintf("\"%s\"", searchString.c_str()); + + AddHeader(new cRecMenuItemInfo(*line1, 2, *line2, "", "", width - 2 * border, true)); + AddFooter(new cRecMenuItemButtonYesNo(tr("Adapt Search"), tr("Close"), rmsRecordingSearch, rmsClose, (numResults) ? false : true)); + if (searchResults && (numResults > 0)) { for (int i = 0; i < numResults; i++) { if (!AddMenuItemInitial(new cRecMenuItemRecording(searchResults[i], (i == 0) ? true : false))) break; } } + CalculateHeight(); CreatePixmap(); Arrange(); |