mirror of
https://projects.vdr-developer.org/git/vdr-plugin-tvguide.git
synced 2023-10-05 15:01:48 +02:00
Refactor cRecMenuSearchNothingFound
This commit is contained in:
parent
412a78a112
commit
380e84afcd
39
recmenus.c
39
recmenus.c
@ -1243,6 +1243,20 @@ const cEvent *cRecMenuSearchResults::GetEvent(void) {
|
|||||||
return NULL;
|
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::cRecMenuSearchConfirmTimer(const cEvent *event, eRecMenuState nextAction) {
|
cRecMenuSearchConfirmTimer::cRecMenuSearchConfirmTimer(const cEvent *event, eRecMenuState nextAction) {
|
||||||
@ -1271,31 +1285,6 @@ cRecMenuSearchConfirmTimer::cRecMenuSearchConfirmTimer(const cEvent *event, eRec
|
|||||||
Arrange();
|
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
|
* Recording Search Menus
|
||||||
******************************************************************************************/
|
******************************************************************************************/
|
||||||
|
Loading…
Reference in New Issue
Block a user