mirror of
https://projects.vdr-developer.org/git/vdr-plugin-tvguide.git
synced 2023-10-05 15:01:48 +02:00
Refactor cRecMenuSearchTimerResults
This commit is contained in:
parent
4f95cffdb2
commit
66659a865d
@ -3,7 +3,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: vdr-tvguide 0.0.1\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"
|
||||
"Last-Translator: My friend <Sampep> Thanks David <Gabychan> <gbonich@gmail.com>\n"
|
||||
"Language-Team: \n"
|
||||
@ -483,12 +483,12 @@ msgstr "Utilitza una altra plantilla"
|
||||
msgid "search results for Favorite"
|
||||
msgstr ""
|
||||
|
||||
msgid "search result for Favorite"
|
||||
msgstr ""
|
||||
|
||||
msgid "search results for Search Timer"
|
||||
msgstr "cerca resultats per temporitzador"
|
||||
|
||||
msgid "search result for Favorite"
|
||||
msgstr ""
|
||||
|
||||
msgid "search result for Search Timer"
|
||||
msgstr "cerca resultat per temporitzador"
|
||||
|
||||
|
@ -3,7 +3,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: vdr-tvguide 0.0.1\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"
|
||||
"Last-Translator: Horst\n"
|
||||
"Language-Team: \n"
|
||||
@ -480,12 +480,12 @@ msgstr "Anderes Template benutzen"
|
||||
msgid "search results for Favorite"
|
||||
msgstr "Suchergebnisse für Favorit"
|
||||
|
||||
msgid "search result for Favorite"
|
||||
msgstr "Suchergebnis für Favorit"
|
||||
|
||||
msgid "search results for Search Timer"
|
||||
msgstr "Treffer für Suchtimer"
|
||||
|
||||
msgid "search result for Favorite"
|
||||
msgstr "Suchergebnis für Favorit"
|
||||
|
||||
msgid "search result for Search Timer"
|
||||
msgstr "Treffer für Suchtimer"
|
||||
|
||||
|
@ -3,7 +3,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: vdr-tvguide 0.0.1\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"
|
||||
"Last-Translator: fiveten_59\n"
|
||||
"Language-Team: \n"
|
||||
@ -480,12 +480,12 @@ msgstr "Anderes Template benutzen"
|
||||
msgid "search results for Favorite"
|
||||
msgstr "Suchergebnisse für Favorit"
|
||||
|
||||
msgid "search result for Favorite"
|
||||
msgstr "Suchergebnis für Favorit"
|
||||
|
||||
msgid "search results for Search Timer"
|
||||
msgstr "Treffer für Suchtimer"
|
||||
|
||||
msgid "search result for Favorite"
|
||||
msgstr "Suchergebnis für Favorit"
|
||||
|
||||
msgid "search result for Search Timer"
|
||||
msgstr "Treffer für Suchtimer"
|
||||
|
||||
|
@ -3,7 +3,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: vdr-tvguide 1.0.0\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"
|
||||
"Last-Translator: AmiD, ilya\n"
|
||||
"Language-Team: Russia-Cherepovets(wm.amid@gmail.com)\n"
|
||||
@ -480,12 +480,12 @@ msgstr "Использовать другие шаблоны"
|
||||
msgid "search results for Favorite"
|
||||
msgstr ""
|
||||
|
||||
msgid "search result for Favorite"
|
||||
msgstr ""
|
||||
|
||||
msgid "search results for Search Timer"
|
||||
msgstr "Совпадений найдено"
|
||||
|
||||
msgid "search result for Favorite"
|
||||
msgstr ""
|
||||
|
||||
msgid "search result for Search Timer"
|
||||
msgstr "Совпадение найдено"
|
||||
|
||||
|
@ -3,7 +3,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: vdr-tvguide 1.1.0\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"
|
||||
"Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n"
|
||||
"Language-Team: \n"
|
||||
@ -480,12 +480,12 @@ msgstr "Pou
|
||||
msgid "search results for Favorite"
|
||||
msgstr ""
|
||||
|
||||
msgid "search result for Favorite"
|
||||
msgstr ""
|
||||
|
||||
msgid "search results for Search Timer"
|
||||
msgstr "nájdené výsledky vyhµadávania plánu"
|
||||
|
||||
msgid "search result for Favorite"
|
||||
msgstr ""
|
||||
|
||||
msgid "search result for Search Timer"
|
||||
msgstr "nájdený výsledok vyhµadávania plánu"
|
||||
|
||||
|
53
recmenus.c
53
recmenus.c
@ -1020,37 +1020,32 @@ cRecMenuSearchTimerTemplatesCreate::cRecMenuSearchTimerTemplatesCreate(TVGuideEP
|
||||
|
||||
|
||||
// --- 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->action2 = action2;
|
||||
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);
|
||||
SetFooter(buttons);
|
||||
|
||||
int i = (templateName.size() > 0) ? 3 : 2;
|
||||
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)) {
|
||||
for (int i=0; i<numResults; i++) {
|
||||
if (!AddMenuItemInitial(new cRecMenuItemEvent(searchResults[i], rmsSearchShowInfo, action2, (i==0)?true:false)))
|
||||
for (int i = 0; i < numResults; i++) {
|
||||
if (!AddMenuItemInitial(new cRecMenuItemEvent(searchResults[i], rmsSearchShowInfo, action2, (i == 0) ? true : false)))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
CalculateHeight();
|
||||
CreatePixmap();
|
||||
Arrange();
|
||||
@ -1058,8 +1053,8 @@ cRecMenuSearchTimerResults::cRecMenuSearchTimerResults(std::string searchString,
|
||||
|
||||
cRecMenuItem *cRecMenuSearchTimerResults::GetMenuItem(int number) {
|
||||
if ((number >= 0) && (number < numResults)) {
|
||||
cRecMenuItem *result = new cRecMenuItemEvent(searchResults[number], rmsSearchShowInfo, action2, false);
|
||||
return result;
|
||||
if (cRecMenuItem *result = new cRecMenuItemEvent(searchResults[number], rmsSearchShowInfo, action2, false))
|
||||
return result;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@ -1069,10 +1064,9 @@ int cRecMenuSearchTimerResults::GetTotalNumMenuItems(void) {
|
||||
}
|
||||
|
||||
const cEvent *cRecMenuSearchTimerResults::GetEvent(void) {
|
||||
const cEvent *ev = NULL;
|
||||
if (cRecMenuItemEvent *activeItem = dynamic_cast<cRecMenuItemEvent*>(GetActiveMenuItem()))
|
||||
ev = activeItem->GetEventValue();
|
||||
return ev;
|
||||
return activeItem->GetEventValue();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// --- cRecMenuSearchTimerNothingFound ---------------------------------------------------------
|
||||
@ -1504,7 +1498,6 @@ const cTimer *cRecMenuTimeline::GetTimer(void) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
eRecMenuState cRecMenuTimeline::ProcessKey(eKeys Key) {
|
||||
eRecMenuState state = rmsContinue;
|
||||
switch (Key & ~k_Repeat) {
|
||||
|
Loading…
Reference in New Issue
Block a user