Refactor cRecMenuSearch

This commit is contained in:
kamel5 2019-11-09 14:48:47 +01:00
parent a3dc78f70a
commit 5cc50e465d
6 changed files with 37 additions and 34 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 15:32+0200\n" "POT-Creation-Date: 2022-04-29 15:40+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"
@ -525,6 +525,9 @@ msgstr "No s'ha creat el canvi de temporitzador"
msgid "Switch Timer deleted" msgid "Switch Timer deleted"
msgstr "Canvi de temporitzador esborrat" msgstr "Canvi de temporitzador esborrat"
msgid "Perform Search"
msgstr "Realitza la cerca"
msgid "Search Mode" msgid "Search Mode"
msgstr "Mode de cerca" msgstr "Mode de cerca"
@ -543,9 +546,6 @@ msgstr "Cerca a la descripció"
msgid "Show Search Options" msgid "Show Search Options"
msgstr "Mostra opcions de cerca" msgstr "Mostra opcions de cerca"
msgid "Perform Search"
msgstr "Realitza la cerca"
msgid "search results for" msgid "search results for"
msgstr "resultats de cerca per" msgstr "resultats de cerca per"

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 15:32+0200\n" "POT-Creation-Date: 2022-04-29 15:40+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"
@ -522,6 +522,9 @@ msgstr "Umschalttimer NICHT erfolgreich angelegt"
msgid "Switch Timer deleted" msgid "Switch Timer deleted"
msgstr "Umschalttimer gelöscht" msgstr "Umschalttimer gelöscht"
msgid "Perform Search"
msgstr "Suche ausführen"
msgid "Search Mode" msgid "Search Mode"
msgstr "Suchmodus" msgstr "Suchmodus"
@ -540,9 +543,6 @@ msgstr "In Beschreibung suchen"
msgid "Show Search Options" msgid "Show Search Options"
msgstr "Suchoptionen anzeigen" msgstr "Suchoptionen anzeigen"
msgid "Perform Search"
msgstr "Suche ausführen"
msgid "search results for" msgid "search results for"
msgstr "Suchergebnisse für" msgstr "Suchergebnisse für"

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 15:32+0200\n" "POT-Creation-Date: 2022-04-29 15:40+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"
@ -522,6 +522,9 @@ msgstr "Switch Timer NON creato"
msgid "Switch Timer deleted" msgid "Switch Timer deleted"
msgstr "Switch Timer eliminato" msgstr "Switch Timer eliminato"
msgid "Perform Search"
msgstr "Fai una ricerca"
msgid "Search Mode" msgid "Search Mode"
msgstr "Modalità di ricerca" msgstr "Modalità di ricerca"
@ -540,9 +543,6 @@ msgstr "Cerca nella descrizione"
msgid "Show Search Options" msgid "Show Search Options"
msgstr "Mostra opzioni di ricerca" msgstr "Mostra opzioni di ricerca"
msgid "Perform Search"
msgstr "Fai una ricerca"
msgid "search results for" msgid "search results for"
msgstr "cerca risultati per" msgstr "cerca risultati per"

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 15:32+0200\n" "POT-Creation-Date: 2022-04-29 15:40+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"
@ -522,6 +522,9 @@ msgstr "Таймер переключения НЕ был создан!"
msgid "Switch Timer deleted" msgid "Switch Timer deleted"
msgstr "Таймер переключения удален" msgstr "Таймер переключения удален"
msgid "Perform Search"
msgstr "Найти"
msgid "Search Mode" msgid "Search Mode"
msgstr "Режим поиска" msgstr "Режим поиска"
@ -540,9 +543,6 @@ msgstr "Искать в описаниях"
msgid "Show Search Options" msgid "Show Search Options"
msgstr "Показать параметры поиска" msgstr "Показать параметры поиска"
msgid "Perform Search"
msgstr "Найти"
msgid "search results for" msgid "search results for"
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 15:32+0200\n" "POT-Creation-Date: 2022-04-29 15:40+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"
@ -522,6 +522,9 @@ msgstr "Pl
msgid "Switch Timer deleted" msgid "Switch Timer deleted"
msgstr "Plán prepnutia vymazaný" msgstr "Plán prepnutia vymazaný"
msgid "Perform Search"
msgstr "Vykona» vyhµadávanie"
msgid "Search Mode" msgid "Search Mode"
msgstr "Re¾im vyhµadávania" msgstr "Re¾im vyhµadávania"
@ -540,9 +543,6 @@ msgstr "H
msgid "Show Search Options" msgid "Show Search Options"
msgstr "Zobrazi» mo¾nosti vyhµadávania" msgstr "Zobrazi» mo¾nosti vyhµadávania"
msgid "Perform Search"
msgstr "Vykona» vyhµadávanie"
msgid "search results for" msgid "search results for"
msgstr "vyhµadané výsledky pre" msgstr "vyhµadané výsledky pre"

View File

@ -1152,33 +1152,36 @@ cRecMenuSwitchTimerDelete::cRecMenuSwitchTimerDelete(void) { // OK
// --- cRecMenuSearch --------------------------------------------------------- // --- cRecMenuSearch ---------------------------------------------------------
cRecMenuSearch::cRecMenuSearch(std::string searchString, bool withOptions) { cRecMenuSearch::cRecMenuSearch(std::string searchString, bool withOptions) { // OK
SetWidthPercent(60);
strncpy(this->searchString, searchString.c_str(), TEXTINPUTLENGTH); strncpy(this->searchString, searchString.c_str(), TEXTINPUTLENGTH);
mode = 0; mode = 0;
channelNr = 0; channelNr = 0;
useTitle = true; useTitle = true;
useSubTitle = true; useSubTitle = true;
useDescription = false; useDescription = false;
SetWidthPercent(60);
cString infoText = tr("Search"); const cString line1 = tr("Search");
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText, true);
infoItem->CalculateHeight(width - 2 * border); AddHeader(new cRecMenuItemInfo(*line1, 1, "", "", "", width - 2 * border, true));
SetHeader(infoItem); AddFooter(new cRecMenuItemButtonYesNo(tr("Perform Search"), tr("Cancel"), rmsSearchPerform, rmsClose, true));
AddMenuItem(new cRecMenuItemText(tr("Search Expression:"), TEXTINPUTLENGTH, false, this->searchString)); AddMenuItem(new cRecMenuItemText(tr("Search Expression:"), TEXTINPUTLENGTH, false, this->searchString));
if (withOptions) { if (withOptions) {
std::vector<std::string> searchModes; std::vector<std::string> searchModes;
cTVGuideSearchTimer searchTimer; cTVGuideSearchTimer searchTimer;
searchTimer.GetSearchModes(&searchModes); searchTimer.GetSearchModes(&searchModes);
AddMenuItemInitial(new cRecMenuItemSelect(tr("Search Mode"), searchModes, false, &mode)); AddMenuItem(new cRecMenuItemSelect(tr("Search Mode"), searchModes, false, &mode));
AddMenuItemInitial(new cRecMenuItemChannelChooser(tr("Channel to Search"), false, &channelNr)); AddMenuItem(new cRecMenuItemChannelChooser(tr("Channel to Search"), false, &channelNr));
AddMenuItemInitial(new cRecMenuItemBool(tr("Search in title"), false, &useTitle)); AddMenuItem(new cRecMenuItemBool(tr("Search in title"), false, &useTitle));
AddMenuItemInitial(new cRecMenuItemBool(tr("Search in Subtitle"), false, &useSubTitle)); AddMenuItem(new cRecMenuItemBool(tr("Search in Subtitle"), false, &useSubTitle));
AddMenuItemInitial(new cRecMenuItemBool(tr("Search in Description"), false, &useDescription)); AddMenuItem(new cRecMenuItemBool(tr("Search in Description"), false, &useDescription));
} else { } else {
AddMenuItemInitial(new cRecMenuItemButton(tr("Show Search Options"), rmsSearchWithOptions, false)); AddMenuItem(new cRecMenuItemButton(tr("Show Search Options"), rmsSearchWithOptions, false));
} }
cRecMenuItemButtonYesNo *button = new cRecMenuItemButtonYesNo(tr("Perform Search"), tr("Cancel"), rmsSearchPerform, rmsClose, true);
SetFooter(button);
CalculateHeight(); CalculateHeight();
CreatePixmap(); CreatePixmap();
Arrange(); Arrange();