Refactor cRecMenuSearchTimerResults

This commit is contained in:
kamel5 2019-11-11 14:30:10 +01:00
parent 4f95cffdb2
commit 66659a865d
6 changed files with 43 additions and 50 deletions

View File

@ -3,7 +3,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vdr-tvguide 0.0.1\n" "Project-Id-Version: vdr-tvguide 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n" "Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2022-04-29 14:48+0200\n" "POT-Creation-Date: 2022-04-29 15:29+0200\n"
"PO-Revision-Date: 2013-09-21 17:49+0200\n" "PO-Revision-Date: 2013-09-21 17:49+0200\n"
"Last-Translator: My friend <Sampep> Thanks David <Gabychan> <gbonich@gmail.com>\n" "Last-Translator: My friend <Sampep> Thanks David <Gabychan> <gbonich@gmail.com>\n"
"Language-Team: \n" "Language-Team: \n"
@ -483,12 +483,12 @@ msgstr "Utilitza una altra plantilla"
msgid "search results for Favorite" msgid "search results for Favorite"
msgstr "" msgstr ""
msgid "search result for Favorite"
msgstr ""
msgid "search results for Search Timer" msgid "search results for Search Timer"
msgstr "cerca resultats per temporitzador" msgstr "cerca resultats per temporitzador"
msgid "search result for Favorite"
msgstr ""
msgid "search result for Search Timer" msgid "search result for Search Timer"
msgstr "cerca resultat per temporitzador" msgstr "cerca resultat per temporitzador"

View File

@ -3,7 +3,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vdr-tvguide 0.0.1\n" "Project-Id-Version: vdr-tvguide 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n" "Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2022-04-29 14:48+0200\n" "POT-Creation-Date: 2022-04-29 15:29+0200\n"
"PO-Revision-Date: 2012-08-25 17:49+0200\n" "PO-Revision-Date: 2012-08-25 17:49+0200\n"
"Last-Translator: Horst\n" "Last-Translator: Horst\n"
"Language-Team: \n" "Language-Team: \n"
@ -480,12 +480,12 @@ msgstr "Anderes Template benutzen"
msgid "search results for Favorite" msgid "search results for Favorite"
msgstr "Suchergebnisse für Favorit" msgstr "Suchergebnisse für Favorit"
msgid "search result for Favorite"
msgstr "Suchergebnis für Favorit"
msgid "search results for Search Timer" msgid "search results for Search Timer"
msgstr "Treffer für Suchtimer" msgstr "Treffer für Suchtimer"
msgid "search result for Favorite"
msgstr "Suchergebnis für Favorit"
msgid "search result for Search Timer" msgid "search result for Search Timer"
msgstr "Treffer für Suchtimer" msgstr "Treffer für Suchtimer"

View File

@ -3,7 +3,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vdr-tvguide 0.0.1\n" "Project-Id-Version: vdr-tvguide 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n" "Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2022-04-29 14:48+0200\n" "POT-Creation-Date: 2022-04-29 15:29+0200\n"
"PO-Revision-Date: 2012-08-25 17:49+0200\n" "PO-Revision-Date: 2012-08-25 17:49+0200\n"
"Last-Translator: fiveten_59\n" "Last-Translator: fiveten_59\n"
"Language-Team: \n" "Language-Team: \n"
@ -480,12 +480,12 @@ msgstr "Anderes Template benutzen"
msgid "search results for Favorite" msgid "search results for Favorite"
msgstr "Suchergebnisse für Favorit" msgstr "Suchergebnisse für Favorit"
msgid "search result for Favorite"
msgstr "Suchergebnis für Favorit"
msgid "search results for Search Timer" msgid "search results for Search Timer"
msgstr "Treffer für Suchtimer" msgstr "Treffer für Suchtimer"
msgid "search result for Favorite"
msgstr "Suchergebnis für Favorit"
msgid "search result for Search Timer" msgid "search result for Search Timer"
msgstr "Treffer für Suchtimer" msgstr "Treffer für Suchtimer"

View File

@ -3,7 +3,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vdr-tvguide 1.0.0\n" "Project-Id-Version: vdr-tvguide 1.0.0\n"
"Report-Msgid-Bugs-To: <see README>\n" "Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2022-04-29 14:48+0200\n" "POT-Creation-Date: 2022-04-29 15:29+0200\n"
"PO-Revision-Date: 2013-09-25 17:49+0400\n" "PO-Revision-Date: 2013-09-25 17:49+0400\n"
"Last-Translator: AmiD, ilya\n" "Last-Translator: AmiD, ilya\n"
"Language-Team: Russia-Cherepovets(wm.amid@gmail.com)\n" "Language-Team: Russia-Cherepovets(wm.amid@gmail.com)\n"
@ -480,12 +480,12 @@ msgstr "Использовать другие шаблоны"
msgid "search results for Favorite" msgid "search results for Favorite"
msgstr "" msgstr ""
msgid "search result for Favorite"
msgstr ""
msgid "search results for Search Timer" msgid "search results for Search Timer"
msgstr "Совпадений найдено" msgstr "Совпадений найдено"
msgid "search result for Favorite"
msgstr ""
msgid "search result for Search Timer" msgid "search result for Search Timer"
msgstr "Совпадение найдено" msgstr "Совпадение найдено"

View File

@ -3,7 +3,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: vdr-tvguide 1.1.0\n" "Project-Id-Version: vdr-tvguide 1.1.0\n"
"Report-Msgid-Bugs-To: <see README>\n" "Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2022-04-29 14:48+0200\n" "POT-Creation-Date: 2022-04-29 15:29+0200\n"
"PO-Revision-Date: 2013-09-15 00:12+0100\n" "PO-Revision-Date: 2013-09-15 00:12+0100\n"
"Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n" "Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n"
"Language-Team: \n" "Language-Team: \n"
@ -480,12 +480,12 @@ msgstr "Pou
msgid "search results for Favorite" msgid "search results for Favorite"
msgstr "" msgstr ""
msgid "search result for Favorite"
msgstr ""
msgid "search results for Search Timer" msgid "search results for Search Timer"
msgstr "nájdené výsledky vyhµadávania plánu" msgstr "nájdené výsledky vyhµadávania plánu"
msgid "search result for Favorite"
msgstr ""
msgid "search result for Search Timer" msgid "search result for Search Timer"
msgstr "nájdený výsledok vyhµadávania plánu" msgstr "nájdený výsledok vyhµadávania plánu"

View File

@ -1020,37 +1020,32 @@ cRecMenuSearchTimerTemplatesCreate::cRecMenuSearchTimerTemplatesCreate(TVGuideEP
// --- cRecMenuSearchTimerResults --------------------------------------------------------- // --- cRecMenuSearchTimerResults ---------------------------------------------------------
cRecMenuSearchTimerResults::cRecMenuSearchTimerResults(std::string searchString, const cEvent **searchResults, int numResults, std::string templateName, eRecMenuState action2) { cRecMenuSearchTimerResults::cRecMenuSearchTimerResults(std::string searchString, const cEvent **searchResults, int numResults, std::string templateName, eRecMenuState action2) { // OK
SetWidthPercent(70);
this->searchResults = searchResults; this->searchResults = searchResults;
this->action2 = action2; this->action2 = action2;
this->numResults = numResults; this->numResults = numResults;
SetWidthPercent(70);
cString message1 = "", message2 = "", message3 = "", infoText = "";
if (action2 == rmsFavoritesRecord) {
message1 = tr("search results for Favorite");
message2 = tr("search result for Favorite");
} else {
message1 = tr("search results for Search Timer");
message2 = tr("search result for Search Timer");
message3 = tr("Using Template");
}
if (templateName.size() > 0) {
infoText = cString::sprintf("%d %s:\n\"%s\"\n%s \"%s\"", numResults, (numResults>1)?(*message1):(*message2), searchString.c_str(), *message3, templateName.c_str());
} else {
infoText = cString::sprintf("%d %s:\n\"%s\"", numResults, (numResults>1)?(*message1):(*message2), searchString.c_str());
}
cRecMenuItem *infoItem = new cRecMenuItemInfo(*infoText, true);
infoItem->CalculateHeight(width - 2 * border);
SetHeader(infoItem);
cRecMenuItem *buttons = new cRecMenuItemButton(tr("Close"), rmsClose, false); int i = (templateName.size() > 0) ? 3 : 2;
SetFooter(buttons); const cString line1 = cString::sprintf("%d %s:", numResults, (numResults > 1) ?
(action2 == rmsFavoritesRecord) ? tr("search results for Favorite")
: tr("search results for Search Timer") :
(action2 == rmsFavoritesRecord) ? tr("search result for Favorite")
: tr("search result for Search Timer"));
const cString line2 = cString::sprintf("\"%s\"", searchString.c_str());
const cString line3 = (i == 3) ? cString::sprintf("%s \"%s\"", tr("Using Template"), templateName.c_str()) : "";
AddHeader(new cRecMenuItemInfo(*line1, i, *line2, *line3, "", width - 2 * border, true));
AddFooter(new cRecMenuItemButton(tr("Close"), rmsClose, false));
if (searchResults && (numResults > 0)) { if (searchResults && (numResults > 0)) {
for (int i = 0; i < numResults; i++) { for (int i = 0; i < numResults; i++) {
if (!AddMenuItemInitial(new cRecMenuItemEvent(searchResults[i], rmsSearchShowInfo, action2, (i == 0) ? true : false))) if (!AddMenuItemInitial(new cRecMenuItemEvent(searchResults[i], rmsSearchShowInfo, action2, (i == 0) ? true : false)))
break; break;
} }
} }
CalculateHeight(); CalculateHeight();
CreatePixmap(); CreatePixmap();
Arrange(); Arrange();
@ -1058,7 +1053,7 @@ cRecMenuSearchTimerResults::cRecMenuSearchTimerResults(std::string searchString,
cRecMenuItem *cRecMenuSearchTimerResults::GetMenuItem(int number) { cRecMenuItem *cRecMenuSearchTimerResults::GetMenuItem(int number) {
if ((number >= 0) && (number < numResults)) { if ((number >= 0) && (number < numResults)) {
cRecMenuItem *result = new cRecMenuItemEvent(searchResults[number], rmsSearchShowInfo, action2, false); if (cRecMenuItem *result = new cRecMenuItemEvent(searchResults[number], rmsSearchShowInfo, action2, false))
return result; return result;
} }
return NULL; return NULL;
@ -1069,10 +1064,9 @@ int cRecMenuSearchTimerResults::GetTotalNumMenuItems(void) {
} }
const cEvent *cRecMenuSearchTimerResults::GetEvent(void) { const cEvent *cRecMenuSearchTimerResults::GetEvent(void) {
const cEvent *ev = NULL;
if (cRecMenuItemEvent *activeItem = dynamic_cast<cRecMenuItemEvent*>(GetActiveMenuItem())) if (cRecMenuItemEvent *activeItem = dynamic_cast<cRecMenuItemEvent*>(GetActiveMenuItem()))
ev = activeItem->GetEventValue(); return activeItem->GetEventValue();
return ev; return NULL;
} }
// --- cRecMenuSearchTimerNothingFound --------------------------------------------------------- // --- cRecMenuSearchTimerNothingFound ---------------------------------------------------------
@ -1504,7 +1498,6 @@ const cTimer *cRecMenuTimeline::GetTimer(void) {
return NULL; return NULL;
} }
eRecMenuState cRecMenuTimeline::ProcessKey(eKeys Key) { eRecMenuState cRecMenuTimeline::ProcessKey(eKeys Key) {
eRecMenuState state = rmsContinue; eRecMenuState state = rmsContinue;
switch (Key & ~k_Repeat) { switch (Key & ~k_Repeat) {