various improvements in search&rec menus

This commit is contained in:
louis 2014-01-12 16:27:59 +01:00
parent 3121910dc1
commit d0651a4a50
13 changed files with 229 additions and 183 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: 2014-01-11 16:02+0100\n" "POT-Creation-Date: 2014-01-12 16:23+0100\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"
@ -456,6 +456,9 @@ msgstr "resultat de cerca per"
msgid "Adapt Search" msgid "Adapt Search"
msgstr "Cerca adaptada" msgstr "Cerca adaptada"
msgid "Search String has to have at least three letters"
msgstr ""
msgid "Found" msgid "Found"
msgstr "Trobada" msgstr "Trobada"
@ -720,7 +723,7 @@ msgstr "Mida de la Font - Menú Cerca & Enregistra"
msgid "Search & Recording Menu Small Font Size" msgid "Search & Recording Menu Small Font Size"
msgstr "Mida de la Font petita - Menú Cerca & Enregistra" msgstr "Mida de la Font petita - Menú Cerca & Enregistra"
msgid "Search & Recording Main Menu Font Size" msgid "Search & Recording Menu Header Font Size"
msgstr "" msgstr ""
msgid "Create Log Messages for image loading" msgid "Create Log Messages for image loading"

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: 2014-01-11 16:02+0100\n" "POT-Creation-Date: 2014-01-12 16:23+0100\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"
@ -97,7 +97,7 @@ msgid "Edit Timer"
msgstr "Timer bearbeiten" msgstr "Timer bearbeiten"
msgid "Timer Timeline" msgid "Timer Timeline"
msgstr "Timer anzeigen" msgstr "Timer Tagesübersicht"
msgid "Create Search Timer" msgid "Create Search Timer"
msgstr "Suchtimer anlegen" msgstr "Suchtimer anlegen"
@ -453,6 +453,9 @@ msgstr "Suchergebnis für"
msgid "Adapt Search" msgid "Adapt Search"
msgstr "Suche anpassen" msgstr "Suche anpassen"
msgid "Search String has to have at least three letters"
msgstr "Suchausdruck muss mindestens drei Zeichen haben"
msgid "Found" msgid "Found"
msgstr " " msgstr " "
@ -717,8 +720,8 @@ msgstr "Suchen & Aufnehmen Menu Schriftgröße"
msgid "Search & Recording Menu Small Font Size" msgid "Search & Recording Menu Small Font Size"
msgstr "Suchen & Aufnehmen Menu kleine Schriftgröße" msgstr "Suchen & Aufnehmen Menu kleine Schriftgröße"
msgid "Search & Recording Main Menu Font Size" msgid "Search & Recording Menu Header Font Size"
msgstr "Suchen & Aufnehmen Hauptmenü Schriftgröße" msgstr "Suchen & Aufnehmen Menu Header Schriftgröße"
msgid "Create Log Messages for image loading" msgid "Create Log Messages for image loading"
msgstr "Log Nachrichten für das Laden der Bilder erzeugen" msgstr "Log Nachrichten für das Laden der Bilder erzeugen"

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: 2014-01-11 16:02+0100\n" "POT-Creation-Date: 2014-01-12 16:23+0100\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"
@ -453,6 +453,9 @@ msgstr "Найден по запросу"
msgid "Adapt Search" msgid "Adapt Search"
msgstr "Изменить" msgstr "Изменить"
msgid "Search String has to have at least three letters"
msgstr ""
msgid "Found" msgid "Found"
msgstr "Найдено" msgstr "Найдено"
@ -717,7 +720,7 @@ msgstr "Размер шрифта меню Поиск & Запись"
msgid "Search & Recording Menu Small Font Size" msgid "Search & Recording Menu Small Font Size"
msgstr "Размер маленького шрифта меню Поиск & Запись" msgstr "Размер маленького шрифта меню Поиск & Запись"
msgid "Search & Recording Main Menu Font Size" msgid "Search & Recording Menu Header Font Size"
msgstr "" msgstr ""
msgid "Create Log Messages for image loading" msgid "Create Log Messages for image loading"

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: 2014-01-11 16:02+0100\n" "POT-Creation-Date: 2014-01-12 16:23+0100\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"
@ -453,6 +453,9 @@ msgstr "vyh
msgid "Adapt Search" msgid "Adapt Search"
msgstr "Prispôsobi» vyhµadávanie" msgstr "Prispôsobi» vyhµadávanie"
msgid "Search String has to have at least three letters"
msgstr ""
msgid "Found" msgid "Found"
msgstr "Nájdené" msgstr "Nájdené"
@ -717,7 +720,7 @@ msgstr "H
msgid "Search & Recording Menu Small Font Size" msgid "Search & Recording Menu Small Font Size"
msgstr "Hµada» & Nahra» menu malé písmo" msgstr "Hµada» & Nahra» menu malé písmo"
msgid "Search & Recording Main Menu Font Size" msgid "Search & Recording Menu Header Font Size"
msgstr "" msgstr ""
msgid "Create Log Messages for image loading" msgid "Create Log Messages for image loading"

View File

@ -24,7 +24,7 @@ cRecMenu::cRecMenu(void) {
cRecMenu::~cRecMenu(void) { cRecMenu::~cRecMenu(void) {
if (header) if (header)
delete header; delete header;
ClearMenuItems(); ClearMenuItems(true);
if (footer) if (footer)
delete footer; delete footer;
if (pixmapScrollBar) if (pixmapScrollBar)
@ -102,11 +102,12 @@ void cRecMenu::SetFooter(cRecMenuItem *footer) {
height += footerHeight; height += footerHeight;
} }
void cRecMenu::ClearMenuItems(void) { void cRecMenu::ClearMenuItems(bool destructor) {
if (deleteMenuItems) { for (std::list<cRecMenuItem*>::iterator it = menuItems.begin(); it != menuItems.end(); it++) {
for (std::list<cRecMenuItem*>::iterator it = menuItems.begin(); it != menuItems.end(); it++) { if (deleteMenuItems)
delete *it; delete *it;
} else if (!destructor)
(*it)->Hide();
} }
menuItems.clear(); menuItems.clear();
}; };
@ -142,6 +143,7 @@ void cRecMenu::InitMenu(bool complete) {
void cRecMenu::AddMenuItem(cRecMenuItem *item, bool inFront) { void cRecMenu::AddMenuItem(cRecMenuItem *item, bool inFront) {
item->Show();
if (!inFront) if (!inFront)
menuItems.push_back(item); menuItems.push_back(item);
else else
@ -206,7 +208,7 @@ bool cRecMenu::ActivatePrev(void) {
return false; return false;
} }
void cRecMenu::ScrollUp(void) { bool cRecMenu::ScrollUp(void) {
if (footer && footer->isActive()) { if (footer && footer->isActive()) {
if (menuItems.size() > 0) if (menuItems.size() > 0)
Activate(footer, menuItems.back()); Activate(footer, menuItems.back());
@ -238,8 +240,11 @@ void cRecMenu::ScrollUp(void) {
Arrange(deleteMenuItems); Arrange(deleteMenuItems);
Display(deleteMenuItems); Display(deleteMenuItems);
ActivatePrev(); ActivatePrev();
} else {
return false;
} }
} }
return true;
} }
bool cRecMenu::ActivateNext(void) { bool cRecMenu::ActivateNext(void) {
@ -262,7 +267,7 @@ bool cRecMenu::ActivateNext(void) {
if (next) { if (next) {
Activate(activeItem , next); Activate(activeItem , next);
return true; return true;
} else if (!scrollable && footer && footer->isSelectable()) { } else if (!scrollable && footer && footer->isSelectable() && !footer->isActive()) {
Activate(activeItem , footer); Activate(activeItem , footer);
return true; return true;
} }
@ -270,7 +275,7 @@ bool cRecMenu::ActivateNext(void) {
return false; return false;
} }
void cRecMenu::ScrollDown(void) { bool cRecMenu::ScrollDown(void) {
//get next x items //get next x items
int numNewItems = numItems / 2; int numNewItems = numItems / 2;
int numAdded = 0; int numAdded = 0;
@ -299,12 +304,15 @@ void cRecMenu::ScrollDown(void) {
Display(deleteMenuItems); Display(deleteMenuItems);
ActivateNext(); ActivateNext();
} else { } else {
//last item reached, activate footer //last item reached, activate footer if not already active
if (footer) { if ((footer) && !(footer->isActive())) {
cRecMenuItem *activeItem = GetActiveMenuItem(); cRecMenuItem *activeItem = GetActiveMenuItem();
Activate(activeItem , footer); Activate(activeItem , footer);
} else {
return false;
} }
} }
return true;
} }
void cRecMenu::JumpBegin(void) { void cRecMenu::JumpBegin(void) {
@ -532,13 +540,15 @@ eRecMenuState cRecMenu::ProcessKey(eKeys Key) {
switch (Key & ~k_Repeat) { switch (Key & ~k_Repeat) {
case kUp: case kUp:
if (!ActivatePrev()) if (!ActivatePrev())
ScrollUp(); if (!ScrollUp())
state = rmsConsumed; JumpEnd();
state = rmsConsumed;
break; break;
case kDown: case kDown:
if (!ActivateNext()) if (!ActivateNext())
ScrollDown(); if (!ScrollDown())
state = rmsConsumed; JumpBegin();
state = rmsConsumed;
break; break;
case kLeft: case kLeft:
JumpBegin(); JumpBegin();

View File

@ -14,8 +14,8 @@ private:
void Activate(cRecMenuItem *itemOld, cRecMenuItem *item); void Activate(cRecMenuItem *itemOld, cRecMenuItem *item);
bool ActivateNext(void); bool ActivateNext(void);
bool ActivatePrev(void); bool ActivatePrev(void);
void ScrollUp(void); bool ScrollUp(void);
void ScrollDown(void); bool ScrollDown(void);
void JumpBegin(void); void JumpBegin(void);
void JumpEnd(void); void JumpEnd(void);
protected: protected:
@ -37,7 +37,7 @@ protected:
void CreatePixmap(void); void CreatePixmap(void);
void SetHeader(cRecMenuItem *header); void SetHeader(cRecMenuItem *header);
void SetFooter(cRecMenuItem *footer); void SetFooter(cRecMenuItem *footer);
void ClearMenuItems(void); void ClearMenuItems(bool destructor = false);
void InitMenu(bool complete); void InitMenu(bool complete);
bool AddMenuItemInitial(cRecMenuItem *item); bool AddMenuItemInitial(cRecMenuItem *item);
void AddMenuItem(cRecMenuItem *item, bool inFront = false); void AddMenuItem(cRecMenuItem *item, bool inFront = false);

View File

@ -109,13 +109,13 @@ void cRecMenuItemButton::Draw(void) {
} }
void cRecMenuItemButton::Hide(void) { void cRecMenuItemButton::Hide(void) {
pixmap->SetLayer(-1); if (pixmap) pixmap->SetLayer(-1);
pixmapText->SetLayer(-1); if (pixmapText) pixmapText->SetLayer(-1);
} }
void cRecMenuItemButton::Show(void) { void cRecMenuItemButton::Show(void) {
pixmap->SetLayer(4); if (pixmap) pixmap->SetLayer(4);
pixmapText->SetLayer(5); if (pixmapText) pixmapText->SetLayer(5);
} }
eRecMenuState cRecMenuItemButton::ProcessKey(eKeys Key) { eRecMenuState cRecMenuItemButton::ProcessKey(eKeys Key) {
@ -167,13 +167,13 @@ void cRecMenuItemButtonYesNo::SetPixmaps(void) {
} }
void cRecMenuItemButtonYesNo::Hide(void) { void cRecMenuItemButtonYesNo::Hide(void) {
pixmap->SetLayer(-1); if (pixmap) pixmap->SetLayer(-1);
pixmapNo->SetLayer(-1); if (pixmapNo) pixmapNo->SetLayer(-1);
} }
void cRecMenuItemButtonYesNo::Show(void) { void cRecMenuItemButtonYesNo::Show(void) {
pixmap->SetLayer(4); if (pixmap) pixmap->SetLayer(4);
pixmapNo->SetLayer(4); if (pixmapNo) pixmapNo->SetLayer(4);
} }
void cRecMenuItemButtonYesNo::setBackground() { void cRecMenuItemButtonYesNo::setBackground() {
@ -262,10 +262,11 @@ eRecMenuState cRecMenuItemButtonYesNo::ProcessKey(eKeys Key) {
} }
// --- cRecMenuItemInfo ------------------------------------------------------- // --- cRecMenuItemInfo -------------------------------------------------------
cRecMenuItemInfo::cRecMenuItemInfo(const char *text) { cRecMenuItemInfo::cRecMenuItemInfo(const char *text, bool largeFont) {
selectable = false; selectable = false;
active = false; active = false;
this->text = text; this->text = text;
fontInfo = (largeFont) ? fontLarge : font;
border = 10; border = 10;
} }
@ -273,8 +274,8 @@ cRecMenuItemInfo::~cRecMenuItemInfo(void) {
} }
void cRecMenuItemInfo::CalculateHeight(int textWidth) { void cRecMenuItemInfo::CalculateHeight(int textWidth) {
wrapper.Set(*text, font, textWidth); wrapper.Set(*text, fontInfo, textWidth);
height = font->Height() * wrapper.Lines() + 2*border; height = fontInfo->Height() * wrapper.Lines() + 2*border;
} }
void cRecMenuItemInfo::setBackground(void) { void cRecMenuItemInfo::setBackground(void) {
@ -284,12 +285,12 @@ void cRecMenuItemInfo::setBackground(void) {
void cRecMenuItemInfo::Draw(void) { void cRecMenuItemInfo::Draw(void) {
int lines = wrapper.Lines(); int lines = wrapper.Lines();
int lineHeight = font->Height(); int lineHeight = fontInfo->Height();
int x = 0; int x = 0;
int y = border; int y = border;
for (int i = 0; i < lines; i++) { for (int i = 0; i < lines; i++) {
x = (width - font->Width(wrapper.GetLine(i))) / 2; x = (width - fontInfo->Width(wrapper.GetLine(i))) / 2;
pixmap->DrawText(cPoint(x,y), wrapper.GetLine(i), theme.Color(clrFont), clrTransparent, font); pixmap->DrawText(cPoint(x,y), wrapper.GetLine(i), theme.Color(clrFont), clrTransparent, fontInfo);
y += lineHeight; y += lineHeight;
} }
} }
@ -331,13 +332,13 @@ void cRecMenuItemInt::SetPixmaps(void) {
} }
void cRecMenuItemInt::Hide(void) { void cRecMenuItemInt::Hide(void) {
pixmap->SetLayer(-1); if (pixmap) pixmap->SetLayer(-1);
pixmapVal->SetLayer(-1); if (pixmapVal) pixmapVal->SetLayer(-1);
} }
void cRecMenuItemInt::Show(void) { void cRecMenuItemInt::Show(void) {
pixmap->SetLayer(4); if (pixmap) pixmap->SetLayer(4);
pixmapVal->SetLayer(5); if (pixmapVal) pixmapVal->SetLayer(5);
} }
void cRecMenuItemInt::setBackground() { void cRecMenuItemInt::setBackground() {
@ -437,13 +438,13 @@ void cRecMenuItemBool::SetPixmaps(void) {
} }
void cRecMenuItemBool::Hide(void) { void cRecMenuItemBool::Hide(void) {
pixmap->SetLayer(-1); if (pixmap) pixmap->SetLayer(-1);
pixmapVal->SetLayer(-1); if (pixmapVal) pixmapVal->SetLayer(-1);
} }
void cRecMenuItemBool::Show(void) { void cRecMenuItemBool::Show(void) {
pixmap->SetLayer(4); if (pixmap) pixmap->SetLayer(4);
pixmapVal->SetLayer(5); if (pixmapVal) pixmapVal->SetLayer(5);
} }
void cRecMenuItemBool::Draw(void) { void cRecMenuItemBool::Draw(void) {
@ -524,13 +525,13 @@ void cRecMenuItemSelect::SetPixmaps(void) {
} }
void cRecMenuItemSelect::Hide(void) { void cRecMenuItemSelect::Hide(void) {
pixmap->SetLayer(-1); if (pixmap) pixmap->SetLayer(-1);
pixmapVal->SetLayer(-1); if (pixmapVal) pixmapVal->SetLayer(-1);
} }
void cRecMenuItemSelect::Show(void) { void cRecMenuItemSelect::Show(void) {
pixmap->SetLayer(4); if (pixmap) pixmap->SetLayer(4);
pixmapVal->SetLayer(5); if (pixmapVal) pixmapVal->SetLayer(5);
} }
void cRecMenuItemSelect::Draw(void) { void cRecMenuItemSelect::Draw(void) {
@ -660,16 +661,16 @@ void cRecMenuItemText::SetPixmaps(void) {
} }
void cRecMenuItemText::Hide(void) { void cRecMenuItemText::Hide(void) {
pixmap->SetLayer(-1); if (pixmap) pixmap->SetLayer(-1);
pixmapVal->SetLayer(-1); if (pixmapVal) pixmapVal->SetLayer(-1);
pixmapKeyboard->SetLayer(-1); if (pixmapKeyboard) pixmapKeyboard->SetLayer(-1);
pixmapKeyboardHighlight->SetLayer(-1); if (pixmapKeyboardHighlight) pixmapKeyboardHighlight->SetLayer(-1);
pixmapKeyboardIcons->SetLayer(-1); if (pixmapKeyboardIcons) pixmapKeyboardIcons->SetLayer(-1);
} }
void cRecMenuItemText::Show(void) { void cRecMenuItemText::Show(void) {
pixmap->SetLayer(4); if (pixmap) pixmap->SetLayer(4);
pixmapVal->SetLayer(5); if (pixmapVal) pixmapVal->SetLayer(5);
} }
void cRecMenuItemText::setBackground() { void cRecMenuItemText::setBackground() {
@ -1196,13 +1197,13 @@ void cRecMenuItemTime::SetPixmaps(void) {
} }
void cRecMenuItemTime::Hide(void) { void cRecMenuItemTime::Hide(void) {
pixmap->SetLayer(-1); if (pixmap) pixmap->SetLayer(-1);
pixmapVal->SetLayer(-1); if (pixmapVal) pixmapVal->SetLayer(-1);
} }
void cRecMenuItemTime::Show(void) { void cRecMenuItemTime::Show(void) {
pixmap->SetLayer(4); if (pixmap) pixmap->SetLayer(4);
pixmapVal->SetLayer(5); if (pixmapVal) pixmapVal->SetLayer(5);
} }
void cRecMenuItemTime::Draw(void) { void cRecMenuItemTime::Draw(void) {
@ -1336,13 +1337,13 @@ void cRecMenuItemDay::SetPixmaps(void) {
} }
void cRecMenuItemDay::Hide(void) { void cRecMenuItemDay::Hide(void) {
pixmap->SetLayer(-1); if (pixmap) pixmap->SetLayer(-1);
pixmapVal->SetLayer(-1); if (pixmapVal) pixmapVal->SetLayer(-1);
} }
void cRecMenuItemDay::Show(void) { void cRecMenuItemDay::Show(void) {
pixmap->SetLayer(4); if (pixmap) pixmap->SetLayer(4);
pixmapVal->SetLayer(5); if (pixmapVal) pixmapVal->SetLayer(5);
} }
void cRecMenuItemDay::Draw(void) { void cRecMenuItemDay::Draw(void) {
@ -1432,15 +1433,15 @@ void cRecMenuItemTimer::SetPixmaps(void) {
} }
void cRecMenuItemTimer::Hide(void) { void cRecMenuItemTimer::Hide(void) {
pixmap->SetLayer(-1); if (pixmap) pixmap->SetLayer(-1);
pixmapStatus->SetLayer(-1); if (pixmapStatus) pixmapStatus->SetLayer(-1);
pixmapIcons->SetLayer(-1); if (pixmapIcons) pixmapIcons->SetLayer(-1);
} }
void cRecMenuItemTimer::Show(void) { void cRecMenuItemTimer::Show(void) {
pixmap->SetLayer(4); if (pixmap) pixmap->SetLayer(4);
pixmapStatus->SetLayer(5); if (pixmapStatus) pixmapStatus->SetLayer(5);
pixmapIcons->SetLayer(6); if (pixmapIcons) pixmapIcons->SetLayer(6);
} }
void cRecMenuItemTimer::Draw(void) { void cRecMenuItemTimer::Draw(void) {
@ -1605,13 +1606,13 @@ void cRecMenuItemTimerConflictHeader::SetPixmaps(void) {
} }
void cRecMenuItemTimerConflictHeader::Hide(void) { void cRecMenuItemTimerConflictHeader::Hide(void) {
pixmap->SetLayer(-1); if (pixmap) pixmap->SetLayer(-1);
pixmapStatus->SetLayer(-1); if (pixmapStatus) pixmapStatus->SetLayer(-1);
} }
void cRecMenuItemTimerConflictHeader::Show(void) { void cRecMenuItemTimerConflictHeader::Show(void) {
pixmap->SetLayer(4); if (pixmap) pixmap->SetLayer(4);
pixmapStatus->SetLayer(5); if (pixmapStatus) pixmapStatus->SetLayer(5);
} }
void cRecMenuItemTimerConflictHeader::setBackground(void) { void cRecMenuItemTimerConflictHeader::setBackground(void) {
@ -1764,15 +1765,15 @@ int cRecMenuItemEvent::DrawIcons(void) {
} }
void cRecMenuItemEvent::Hide(void) { void cRecMenuItemEvent::Hide(void) {
pixmap->SetLayer(-1); if (pixmap) pixmap->SetLayer(-1);
pixmapText->SetLayer(-1); if (pixmapText) pixmapText->SetLayer(-1);
pixmapIcons->SetLayer(-1); if (pixmapIcons) pixmapIcons->SetLayer(-1);
} }
void cRecMenuItemEvent::Show(void) { void cRecMenuItemEvent::Show(void) {
pixmap->SetLayer(4); if (pixmap) pixmap->SetLayer(4);
pixmapText->SetLayer(5); if (pixmapText) pixmapText->SetLayer(5);
pixmapIcons->SetLayer(6); if (pixmapIcons) pixmapIcons->SetLayer(6);
} }
eRecMenuState cRecMenuItemEvent::ProcessKey(eKeys Key) { eRecMenuState cRecMenuItemEvent::ProcessKey(eKeys Key) {
@ -1854,13 +1855,13 @@ void cRecMenuItemChannelChooser::SetPixmaps(void) {
} }
void cRecMenuItemChannelChooser::Hide(void) { void cRecMenuItemChannelChooser::Hide(void) {
pixmap->SetLayer(-1); if (pixmap) pixmap->SetLayer(-1);
pixmapChannel->SetLayer(-1); if (pixmapChannel) pixmapChannel->SetLayer(-1);
} }
void cRecMenuItemChannelChooser::Show(void) { void cRecMenuItemChannelChooser::Show(void) {
pixmap->SetLayer(4); if (pixmap) pixmap->SetLayer(4);
pixmapChannel->SetLayer(5); if (pixmapChannel) pixmapChannel->SetLayer(5);
} }
void cRecMenuItemChannelChooser::Draw(void) { void cRecMenuItemChannelChooser::Draw(void) {
@ -2013,15 +2014,15 @@ void cRecMenuItemDayChooser::SetPixmaps(void) {
} }
void cRecMenuItemDayChooser::Hide(void) { void cRecMenuItemDayChooser::Hide(void) {
pixmap->SetLayer(-1); if (pixmap) pixmap->SetLayer(-1);
pixmapWeekdays->SetLayer(-1); if (pixmapWeekdays) pixmapWeekdays->SetLayer(-1);
pixmapWeekdaysSelect->SetLayer(-1); if (pixmapWeekdaysSelect) pixmapWeekdaysSelect->SetLayer(-1);
} }
void cRecMenuItemDayChooser::Show(void) { void cRecMenuItemDayChooser::Show(void) {
pixmap->SetLayer(4); if (pixmap) pixmap->SetLayer(4);
pixmapWeekdays->SetLayer(5); if (pixmapWeekdays) pixmapWeekdays->SetLayer(5);
pixmapWeekdaysSelect->SetLayer(6); if (pixmapWeekdaysSelect) pixmapWeekdaysSelect->SetLayer(6);
} }
void cRecMenuItemDayChooser::SetSizes(void) { void cRecMenuItemDayChooser::SetSizes(void) {
@ -2166,13 +2167,13 @@ void cRecMenuItemRecording::Draw(void) {
} }
void cRecMenuItemRecording::Hide(void) { void cRecMenuItemRecording::Hide(void) {
pixmap->SetLayer(-1); if (pixmap) pixmap->SetLayer(-1);
pixmapText->SetLayer(-1); if (pixmapText) pixmapText->SetLayer(-1);
} }
void cRecMenuItemRecording::Show(void) { void cRecMenuItemRecording::Show(void) {
pixmap->SetLayer(4); if (pixmap) pixmap->SetLayer(4);
pixmapText->SetLayer(5); if (pixmapText) pixmapText->SetLayer(5);
} }
// --- cRecMenuItemTimelineHeader ------------------------------------------------------- // --- cRecMenuItemTimelineHeader -------------------------------------------------------
@ -2234,9 +2235,9 @@ void cRecMenuItemTimelineHeader::Draw(void) {
cString headerText = tr("Timers for"); cString headerText = tr("Timers for");
cString dateText = DateString(day); cString dateText = DateString(day);
cString header = cString::sprintf("%s: %s", *headerText, *dateText); cString header = cString::sprintf("%s: %s", *headerText, *dateText);
int xText = (width - font->Width(*header)) / 2; int xText = (width - fontLarge->Width(*header)) / 2;
int yText = (height/4 - font->Height())/2; int yText = (height/4 - fontLarge->Height())/2;
pixmap->DrawText(cPoint(xText, yText), *header, colorText, clrTransparent, font); pixmap->DrawText(cPoint(xText, yText), *header, colorText, clrTransparent, fontLarge);
DrawCurrentTimer(); DrawCurrentTimer();
} }
@ -2347,19 +2348,17 @@ void cRecMenuItemTimelineHeader::DrawTimerConflicts(void) {
} }
void cRecMenuItemTimelineHeader::Hide(void) { void cRecMenuItemTimelineHeader::Hide(void) {
pixmap->SetLayer(-1); if (pixmap) pixmap->SetLayer(-1);
pixmapTimeline->SetLayer(-1); if (pixmapTimeline) pixmapTimeline->SetLayer(-1);
pixmapTimerInfo->SetLayer(-1); if (pixmapTimerInfo) pixmapTimerInfo->SetLayer(-1);
if (pixmapTimerConflicts) if (pixmapTimerConflicts) pixmapTimerConflicts->SetLayer(-1);
pixmapTimerConflicts->SetLayer(-1);
} }
void cRecMenuItemTimelineHeader::Show(void) { void cRecMenuItemTimelineHeader::Show(void) {
pixmap->SetLayer(4); if (pixmap) pixmap->SetLayer(4);
pixmapTimeline->SetLayer(5); if (pixmapTimeline) pixmapTimeline->SetLayer(5);
pixmapTimerInfo->SetLayer(6); if (pixmapTimerInfo) pixmapTimerInfo->SetLayer(6);
if (pixmapTimerConflicts) if (pixmapTimerConflicts) pixmapTimerConflicts->SetLayer(6);
pixmapTimerConflicts->SetLayer(6);
} }
@ -2500,17 +2499,15 @@ void cRecMenuItemTimelineTimer::setInactive(void) {
} }
void cRecMenuItemTimelineTimer::Hide(void) { void cRecMenuItemTimelineTimer::Hide(void) {
pixmap->SetLayer(-1); if (pixmap) pixmap->SetLayer(-1);
pixmapBack->SetLayer(-1); if (pixmapBack) pixmapBack->SetLayer(-1);
if (pixmapTimerConflicts) if (pixmapTimerConflicts) pixmapTimerConflicts->SetLayer(-1);
pixmapTimerConflicts->SetLayer(-1);
} }
void cRecMenuItemTimelineTimer::Show(void) { void cRecMenuItemTimelineTimer::Show(void) {
pixmap->SetLayer(5); if (pixmap) pixmap->SetLayer(5);
pixmapBack->SetLayer(4); if (pixmapBack) pixmapBack->SetLayer(4);
if (pixmapTimerConflicts) if (pixmapTimerConflicts) pixmapTimerConflicts->SetLayer(6);
pixmapTimerConflicts->SetLayer(6);
} }
cTimer *cRecMenuItemTimelineTimer::GetTimerValue(void) { cTimer *cRecMenuItemTimelineTimer::GetTimerValue(void) {
@ -2532,10 +2529,12 @@ eRecMenuState cRecMenuItemTimelineTimer::ProcessKey(eKeys Key) {
cRecMenuItemSearchTimer::cRecMenuItemSearchTimer(cTVGuideSearchTimer timer, cRecMenuItemSearchTimer::cRecMenuItemSearchTimer(cTVGuideSearchTimer timer,
eRecMenuState action1, eRecMenuState action1,
eRecMenuState action2, eRecMenuState action2,
eRecMenuState action3,
bool active) { bool active) {
this->timer = timer; this->timer = timer;
this->action = action1; this->action = action1;
this->action2 = action2; this->action2 = action2;
this->action3 = action3;
pixmapText = NULL; pixmapText = NULL;
pixmapIcons = NULL; pixmapIcons = NULL;
selectable = true; selectable = true;
@ -2584,15 +2583,15 @@ void cRecMenuItemSearchTimer::Draw(void) {
} }
void cRecMenuItemSearchTimer::Hide(void) { void cRecMenuItemSearchTimer::Hide(void) {
pixmap->SetLayer(-1); if (pixmap) pixmap->SetLayer(-1);
pixmapText->SetLayer(-1); if (pixmapText) pixmapText->SetLayer(-1);
pixmapIcons->SetLayer(-1); if (pixmapIcons) pixmapIcons->SetLayer(-1);
} }
void cRecMenuItemSearchTimer::Show(void) { void cRecMenuItemSearchTimer::Show(void) {
pixmap->SetLayer(4); if (pixmap) pixmap->SetLayer(4);
pixmapText->SetLayer(5); if (pixmapText) pixmapText->SetLayer(5);
pixmapIcons->SetLayer(6); if (pixmapIcons) pixmapIcons->SetLayer(6);
} }
int cRecMenuItemSearchTimer::DrawIcons(void) { int cRecMenuItemSearchTimer::DrawIcons(void) {
@ -2600,13 +2599,15 @@ int cRecMenuItemSearchTimer::DrawIcons(void) {
int iconsX = 10; int iconsX = 10;
int iconSize = height / 2; int iconSize = height / 2;
int iconY = (height - iconSize) / 2; int iconY = (height - iconSize) / 2;
std::string iconEdit, iconDelete; std::string iconEdit, iconDelete, iconSearch;
if (active) { if (active) {
iconEdit = (iconActive==0)?"edit_active":"edit_inactive"; iconEdit = (iconActive==0)?"edit_active":"edit_inactive";
iconDelete = (iconActive==1)?"delete_active":"delete_inactive"; iconDelete = (iconActive==1)?"delete_active":"delete_inactive";
iconSearch = (iconActive==2)?"search_active":"search_inactive";
} else { } else {
iconEdit = "edit_inactive"; iconEdit = "edit_inactive";
iconDelete = "delete_inactive"; iconDelete = "delete_inactive";
iconSearch = "search_inactive";
} }
cImage *imgEdit = imgCache.GetIcon(iconEdit, iconSize, iconSize); cImage *imgEdit = imgCache.GetIcon(iconEdit, iconSize, iconSize);
if (imgEdit) { if (imgEdit) {
@ -2618,39 +2619,39 @@ int cRecMenuItemSearchTimer::DrawIcons(void) {
pixmapIcons->DrawImage(cPoint(iconsX, iconY), *imgDel); pixmapIcons->DrawImage(cPoint(iconsX, iconY), *imgDel);
iconsX += iconSize + 10; iconsX += iconSize + 10;
} }
cImage *imgSearch = imgCache.GetIcon(iconSearch, iconSize, iconSize);
if (imgSearch) {
pixmapIcons->DrawImage(cPoint(iconsX, iconY), *imgSearch);
iconsX += iconSize + 10;
}
return iconsX; return iconsX;
} }
eRecMenuState cRecMenuItemSearchTimer::ProcessKey(eKeys Key) { eRecMenuState cRecMenuItemSearchTimer::ProcessKey(eKeys Key) {
bool consumed = false;
switch (Key & ~k_Repeat) { switch (Key & ~k_Repeat) {
case kLeft: case kLeft:
if (iconActive == 1) { if (iconActive > 0) {
iconActive = 0; iconActive--;
consumed = true; DrawIcons();
}
DrawIcons();
if (consumed)
return rmsConsumed; return rmsConsumed;
else }
return rmsNotConsumed; return rmsNotConsumed;
break; break;
case kRight: { case kRight: {
if (iconActive == 0) { if (iconActive < 2) {
iconActive = 1; iconActive++;
consumed = true; DrawIcons();
}
DrawIcons();
if (consumed)
return rmsConsumed; return rmsConsumed;
else }
return rmsNotConsumed; return rmsNotConsumed;
break; } break; }
case kOk: case kOk:
if (iconActive == 0) if (iconActive == 0)
return action; return action;
else if (iconActive == 1) else if (iconActive == 1)
return action2; return action2;
else if (iconActive == 2)
return action3;
break; break;
default: default:
break; break;

View File

@ -106,8 +106,8 @@ public:
bool isActive(void) { return active; } bool isActive(void) { return active; }
virtual void setBackground(void); virtual void setBackground(void);
virtual void Draw(void) {}; virtual void Draw(void) {};
virtual void Hide(void) { pixmap->SetLayer(-1);}; virtual void Hide(void) { if (pixmap) pixmap->SetLayer(-1);};
virtual void Show(void) { pixmap->SetLayer(4);}; virtual void Show(void) { if (pixmap) pixmap->SetLayer(4);};
virtual int GetIntValue(void) { return -1; }; virtual int GetIntValue(void) { return -1; };
virtual time_t GetTimeValue(void) { return 0; }; virtual time_t GetTimeValue(void) { return 0; };
virtual bool GetBoolValue(void) { return false; }; virtual bool GetBoolValue(void) { return false; };
@ -168,8 +168,9 @@ private:
cString text; cString text;
cTextWrapper wrapper; cTextWrapper wrapper;
int border; int border;
const cFont *fontInfo;
public: public:
cRecMenuItemInfo(const char *text); cRecMenuItemInfo(const char *text, bool largeFont = false);
virtual ~cRecMenuItemInfo(void); virtual ~cRecMenuItemInfo(void);
void setBackground(void); void setBackground(void);
void CalculateHeight(int textWidth); void CalculateHeight(int textWidth);
@ -584,6 +585,7 @@ private:
cTVGuideSearchTimer timer; cTVGuideSearchTimer timer;
eRecMenuState action1; eRecMenuState action1;
eRecMenuState action2; eRecMenuState action2;
eRecMenuState action3;
int iconActive; int iconActive;
cPixmap *pixmapText; cPixmap *pixmapText;
cPixmap *pixmapIcons; cPixmap *pixmapIcons;
@ -592,6 +594,7 @@ public:
cRecMenuItemSearchTimer(cTVGuideSearchTimer timer, cRecMenuItemSearchTimer(cTVGuideSearchTimer timer,
eRecMenuState action1, eRecMenuState action1,
eRecMenuState action2, eRecMenuState action2,
eRecMenuState action3,
bool active); bool active);
virtual ~cRecMenuItemSearchTimer(void); virtual ~cRecMenuItemSearchTimer(void);
void SetPixmaps(void); void SetPixmaps(void);

View File

@ -299,11 +299,13 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
activeMenu->Display(); activeMenu->Display();
break; } break; }
case rmsSearchTimerTest: { case rmsSearchTimerTest: {
//caller: cRecMenuSearchTimerEdit, cRecMenuSearchTimerTemplatesCreate //caller: cRecMenuSearchTimerEdit, cRecMenuSearchTimerTemplatesCreate, rmsSearchTimers
//show results of currently choosen search timer //show results of currently choosen search timer
cTVGuideSearchTimer searchTimer; cTVGuideSearchTimer searchTimer;
if (cRecMenuSearchTimerEdit *menu = dynamic_cast<cRecMenuSearchTimerEdit*>(activeMenu)) { if (cRecMenuSearchTimerEdit *menu = dynamic_cast<cRecMenuSearchTimerEdit*>(activeMenu)) {
searchTimer = menu->GetSearchTimer(); searchTimer = menu->GetSearchTimer();
} else if (cRecMenuSearchTimers *menu = dynamic_cast<cRecMenuSearchTimers*>(activeMenu)) {
searchTimer = menu->GetSearchTimer();
} else if (cRecMenuSearchTimerTemplatesCreate *menu = dynamic_cast<cRecMenuSearchTimerTemplatesCreate*>(activeMenu)) { } else if (cRecMenuSearchTimerTemplatesCreate *menu = dynamic_cast<cRecMenuSearchTimerTemplatesCreate*>(activeMenu)) {
searchTimer = menu->GetSearchTimer(); searchTimer = menu->GetSearchTimer();
TVGuideEPGSearchTemplate tmpl = menu->GetTemplate(); TVGuideEPGSearchTemplate tmpl = menu->GetTemplate();
@ -450,12 +452,14 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
***********************************************************************************************/ ***********************************************************************************************/
case rmsSearch: case rmsSearch:
case rmsSearchWithOptions: { case rmsSearchWithOptions: {
//caller: main menu, cRecMenuSearch //caller: main menu, cRecMenuSearch, cRecMenuSearchResults
bool withOptions = false; bool withOptions = false;
std::string searchString = event->Title(); std::string searchString = event->Title();
if (cRecMenuSearch *menu = dynamic_cast<cRecMenuSearch*>(activeMenu)) { if (cRecMenuSearch *menu = dynamic_cast<cRecMenuSearch*>(activeMenu)) {
withOptions = true; withOptions = true;
searchString = menu->GetSearchString(); searchString = menu->GetSearchString();
} else if (cRecMenuSearchResults *menu = dynamic_cast<cRecMenuSearchResults*>(activeMenu)) {
searchString = menu->GetSearchString();
} }
delete activeMenu; delete activeMenu;
activeMenu = new cRecMenuSearch(searchString, withOptions); activeMenu = new cRecMenuSearch(searchString, withOptions);
@ -468,9 +472,10 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
epgSearchData = menu->GetEPGSearchStruct(); epgSearchData = menu->GetEPGSearchStruct();
} else break; } else break;
std::string searchString = epgSearchData.query; std::string searchString = epgSearchData.query;
if (searchString.size() < 4) { if (searchString.size() < 3) {
delete activeMenu; activeMenuBuffer = activeMenu;
activeMenu = new cRecMenuSearch(event->Title(), false); activeMenuBuffer->Hide();
activeMenu = new cRecMenuSearchNothingFound(searchString, true);
} else { } else {
int numSearchResults = 0; int numSearchResults = 0;
const cEvent **searchResult = recManager->PerformSearch(epgSearchData, numSearchResults); const cEvent **searchResult = recManager->PerformSearch(epgSearchData, numSearchResults);

View File

@ -60,7 +60,7 @@ cRecMenuAskFolder::cRecMenuAskFolder(const cEvent *event, eRecMenuState nextActi
NextAction = nextAction; NextAction = nextAction;
cString message = tr("Set Folder for"); cString message = tr("Set Folder for");
cString headerText = cString::sprintf("%s\n\"%s\"", *message, event->Title()); cString headerText = cString::sprintf("%s\n\"%s\"", *message, event->Title());
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*headerText); cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*headerText, true);
infoItem->CalculateHeight(width - 2 * border); infoItem->CalculateHeight(width - 2 * border);
SetHeader(infoItem); SetHeader(infoItem);
@ -207,7 +207,7 @@ cRecMenuTimerConflicts::cRecMenuTimerConflicts(cTVGuideTimerConflicts *conflicts
} else { } else {
text = cString::sprintf("%d %s %s", conflicts->NumConflicts(), tr("Timer Conflicts"), tr("detected")); text = cString::sprintf("%d %s %s", conflicts->NumConflicts(), tr("Timer Conflicts"), tr("detected"));
} }
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*text); cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*text, true);
for (int i=0; i<numConflicts; i++) { for (int i=0; i<numConflicts; i++) {
cTVGuideTimerConflict *conflict = conflicts->GetConflict(i); cTVGuideTimerConflict *conflict = conflicts->GetConflict(i);
@ -316,7 +316,7 @@ cRecMenuRerunResults::cRecMenuRerunResults(const cEvent *original, const cEvent
cString message2 = tr("rerun for"); cString message2 = tr("rerun for");
cString message3 = tr("found"); cString message3 = tr("found");
cString infoText = cString::sprintf("%d %s:\n\"%s\" %s", numReruns, (numReruns>1)?(*message1):(*message2), original->Title(), *message3); cString infoText = cString::sprintf("%d %s:\n\"%s\" %s", numReruns, (numReruns>1)?(*message1):(*message2), original->Title(), *message3);
cRecMenuItem *infoItem = new cRecMenuItemInfo(*infoText); cRecMenuItem *infoItem = new cRecMenuItemInfo(*infoText, true);
infoItem->CalculateHeight(width - 2 * border); infoItem->CalculateHeight(width - 2 * border);
SetHeader(infoItem); SetHeader(infoItem);
@ -407,7 +407,7 @@ cRecMenuEditTimer::cRecMenuEditTimer(cTimer *timer, eRecMenuState nextState) {
if (timer->Channel()) if (timer->Channel())
channelName = timer->Channel()->Name(); channelName = timer->Channel()->Name();
cString infoText = cString::sprintf("%s:\n %s, %s", tr("Edit Timer"), *title, *channelName); cString infoText = cString::sprintf("%s:\n %s, %s", tr("Edit Timer"), *title, *channelName);
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText); cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText, true);
infoItem->CalculateHeight(width - 2 * border); infoItem->CalculateHeight(width - 2 * border);
AddMenuItem(infoItem); AddMenuItem(infoItem);
@ -483,11 +483,11 @@ cRecMenuSeriesTimer::cRecMenuSeriesTimer(cChannel *initialChannel, const cEvent
SetWidthPercent(70); SetWidthPercent(70);
cString title = tr("Create Series Timer based on"); cString title = tr("Create Series Timer based on");
cString infoText = cString::sprintf("%s:\n%s", *title, event->Title()); cString infoText = cString::sprintf("%s:\n%s", *title, event->Title());
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText); cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText, true);
infoItem->CalculateHeight(width - 2 * border); infoItem->CalculateHeight(width - 2 * border);
SetHeader(infoItem); SetHeader(infoItem);
AddMenuItem(new cRecMenuItemBool(tr("Timer Active"), timerActive, false, true, &timerActive)); AddMenuItem(new cRecMenuItemBool(tr("Timer Active"), timerActive, false, false, &timerActive));
AddMenuItem(new cRecMenuItemChannelChooser(tr("Channel"), initialChannel, false, &channel)); AddMenuItem(new cRecMenuItemChannelChooser(tr("Channel"), initialChannel, false, &channel));
AddMenuItem(new cRecMenuItemTime(tr("Series Timer start time"), start, false, &start)); AddMenuItem(new cRecMenuItemTime(tr("Series Timer start time"), start, false, &start));
AddMenuItem(new cRecMenuItemTime(tr("Series Timer stop time"), stop, false, &stop)); AddMenuItem(new cRecMenuItemTime(tr("Series Timer stop time"), stop, false, &stop));
@ -496,7 +496,7 @@ cRecMenuSeriesTimer::cRecMenuSeriesTimer(cChannel *initialChannel, const cEvent
AddMenuItem(new cRecMenuItemInt(tr("Priority"), priority, 0, MAXPRIORITY, false, &priority)); AddMenuItem(new cRecMenuItemInt(tr("Priority"), priority, 0, MAXPRIORITY, false, &priority));
AddMenuItem(new cRecMenuItemInt(tr("Lifetime"), lifetime, 0, MAXLIFETIME, false, &lifetime)); AddMenuItem(new cRecMenuItemInt(tr("Lifetime"), lifetime, 0, MAXLIFETIME, false, &lifetime));
AddMenuItem(new cRecMenuItemButtonYesNo(tr("Create Timer"), tr("Cancel"), rmsSeriesTimerCreate, rmsClose, false)); AddMenuItem(new cRecMenuItemButtonYesNo(tr("Create Timer"), tr("Cancel"), rmsSeriesTimerCreate, rmsClose, true));
CalculateHeight(); CalculateHeight();
CreatePixmap(); CreatePixmap();
@ -567,7 +567,7 @@ cRecMenuSearchTimer::cRecMenuSearchTimer(const cEvent *event) {
SetWidthPercent(70); SetWidthPercent(70);
cString message = tr("Configure Search Timer based on"); cString message = tr("Configure Search Timer based on");
cString infoText = cString::sprintf("%s:\n\"%s\"", *message, event->Title()); cString infoText = cString::sprintf("%s:\n\"%s\"", *message, event->Title());
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText); cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText, true);
infoItem->CalculateHeight(width - 2 * border); infoItem->CalculateHeight(width - 2 * border);
SetHeader(infoItem); SetHeader(infoItem);
strncpy(searchString, event->Title(), TEXTINPUTLENGTH); strncpy(searchString, event->Title(), TEXTINPUTLENGTH);
@ -585,7 +585,7 @@ cRecMenuSearchTimerTemplates::cRecMenuSearchTimerTemplates(cTVGuideSearchTimer s
SetWidthPercent(70); SetWidthPercent(70);
cString message = tr("Configure Search Timer for Search String"); cString message = tr("Configure Search Timer for Search String");
cString infoText = cString::sprintf("%s:\n%s", *message, searchTimer.SearchString().c_str()); cString infoText = cString::sprintf("%s:\n%s", *message, searchTimer.SearchString().c_str());
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText); cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText, true);
infoItem->CalculateHeight(width - 2 * border); infoItem->CalculateHeight(width - 2 * border);
SetHeader(infoItem); SetHeader(infoItem);
@ -635,7 +635,7 @@ cRecMenuSearchTimers::cRecMenuSearchTimers(std::vector<cTVGuideSearchTimer> sear
} else { } else {
headline = tr("No Search Timers Configured"); headline = tr("No Search Timers Configured");
} }
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*headline); cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*headline, true);
infoItem->CalculateHeight(width - 2 * border); infoItem->CalculateHeight(width - 2 * border);
SetHeader(infoItem); SetHeader(infoItem);
if (numSearchTimers > 0) if (numSearchTimers > 0)
@ -653,7 +653,7 @@ cRecMenuSearchTimers::~cRecMenuSearchTimers(void) {
void cRecMenuSearchTimers::SetMenuItems(void) { void cRecMenuSearchTimers::SetMenuItems(void) {
for (int i = 0; i < numSearchTimers; i++) { for (int i = 0; i < numSearchTimers; i++) {
AddMenuItemInitial(new cRecMenuItemSearchTimer(searchTimers[i], rmsSearchTimerEdit, rmsSearchTimerDeleteConfirm, (i==0)?true:false)); AddMenuItemInitial(new cRecMenuItemSearchTimer(searchTimers[i], rmsSearchTimerEdit, rmsSearchTimerDeleteConfirm, rmsSearchTimerTest, (i==0)?true:false));
} }
} }
@ -665,7 +665,7 @@ cTVGuideSearchTimer cRecMenuSearchTimers::GetSearchTimer(void) {
cRecMenuItem *cRecMenuSearchTimers::GetMenuItem(int number) { cRecMenuItem *cRecMenuSearchTimers::GetMenuItem(int number) {
if (number < 0 || number >= numSearchTimers) if (number < 0 || number >= numSearchTimers)
return NULL; return NULL;
return new cRecMenuItemSearchTimer(searchTimers[number], rmsSearchTimerEdit, rmsSearchTimerDelete, false); return new cRecMenuItemSearchTimer(searchTimers[number], rmsSearchTimerEdit, rmsSearchTimerDelete, rmsSearchTimerTest, false);
} }
int cRecMenuSearchTimers::GetTotalNumMenuItems(void) { int cRecMenuSearchTimers::GetTotalNumMenuItems(void) {
@ -709,10 +709,10 @@ cRecMenuSearchTimerEdit::cRecMenuSearchTimerEdit(cTVGuideSearchTimer searchTimer
} else { } else {
infoText = tr("Create Search Timer"); infoText = tr("Create Search Timer");
} }
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText); cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText, true);
infoItem->CalculateHeight(width - 2 * border); infoItem->CalculateHeight(width - 2 * border);
SetHeader(infoItem); SetHeader(infoItem);
cRecMenuItemButtonYesNo *footerButton = new cRecMenuItemButtonYesNo(tr("Save Search Timer"), tr("Cancel"), rmsSearchTimerSave, rmsSearchTimers, false); cRecMenuItemButtonYesNo *footerButton = new cRecMenuItemButtonYesNo(tr("Save Search Timer"), tr("Cancel"), rmsSearchTimerSave, rmsSearchTimers, (advancedOptions)?false:true);
SetFooter(footerButton); SetFooter(footerButton);
InitMenuItems(); InitMenuItems();
CreateMenuItems(); CreateMenuItems();
@ -818,7 +818,7 @@ void cRecMenuSearchTimerEdit::CreateMenuItems(void) {
int numMenuItemsAll = currentMenuItems.size(); int numMenuItemsAll = currentMenuItems.size();
int start = GetStartIndex(); int start = GetStartIndex();
for (int i = start; i < numMenuItemsAll; i++) { for (int i = start; i < numMenuItemsAll; i++) {
if ((i == start) && !reDraw) { if ((i == start) && !reDraw && advancedOptions) {
currentMenuItems[i]->setActive(); currentMenuItems[i]->setActive();
} }
if (!AddMenuItemInitial(currentMenuItems[i])) { if (!AddMenuItemInitial(currentMenuItems[i])) {
@ -891,7 +891,7 @@ cRecMenuSearchTimerDeleteConfirm::cRecMenuSearchTimerDeleteConfirm(cTVGuideSearc
SetWidthPercent(70); SetWidthPercent(70);
cString message = tr("Really delete Search Timer"); cString message = tr("Really delete Search Timer");
cString infoText = cString::sprintf("%s \"%s\"?", *message, searchTimer.SearchString().c_str()); cString infoText = cString::sprintf("%s \"%s\"?", *message, searchTimer.SearchString().c_str());
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText); cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText, true);
infoItem->CalculateHeight(width - 2 * border); infoItem->CalculateHeight(width - 2 * border);
SetHeader(infoItem); SetHeader(infoItem);
AddMenuItem(new cRecMenuItemButton(tr("Delete only Search Timer"), rmsSearchTimerDelete, true)); AddMenuItem(new cRecMenuItemButton(tr("Delete only Search Timer"), rmsSearchTimerDelete, true));
@ -968,7 +968,7 @@ cRecMenuSearchTimerResults::cRecMenuSearchTimerResults(std::string searchString,
} else { } else {
infoText = cString::sprintf("%d %s:\n\"%s\"", numResults, (numResults>1)?(*message1):(*message2), searchString.c_str()); infoText = cString::sprintf("%d %s:\n\"%s\"", numResults, (numResults>1)?(*message1):(*message2), searchString.c_str());
} }
cRecMenuItem *infoItem = new cRecMenuItemInfo(*infoText); cRecMenuItem *infoItem = new cRecMenuItemInfo(*infoText, true);
infoItem->CalculateHeight(width - 2 * border); infoItem->CalculateHeight(width - 2 * border);
SetHeader(infoItem); SetHeader(infoItem);
@ -1033,7 +1033,7 @@ cRecMenuSwitchTimer::cRecMenuSwitchTimer(void) {
SetWidthPercent(60); SetWidthPercent(60);
cString infoText = tr("Configure Options for Switchtimer"); cString infoText = tr("Configure Options for Switchtimer");
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText); cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText, true);
infoItem->CalculateHeight(width - 2 * border); infoItem->CalculateHeight(width - 2 * border);
AddMenuItem(infoItem); AddMenuItem(infoItem);
@ -1107,7 +1107,7 @@ cRecMenuSearch::cRecMenuSearch(std::string searchString, bool withOptions) {
useDescription = false; useDescription = false;
SetWidthPercent(60); SetWidthPercent(60);
cString infoText = tr("Search"); cString infoText = tr("Search");
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText); cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText, true);
infoItem->CalculateHeight(width - 2 * border); infoItem->CalculateHeight(width - 2 * border);
SetHeader(infoItem); SetHeader(infoItem);
AddMenuItem(new cRecMenuItemText(tr("Search Expression:"), this->searchString, TEXTINPUTLENGTH, false, this->searchString)); AddMenuItem(new cRecMenuItemText(tr("Search Expression:"), this->searchString, TEXTINPUTLENGTH, false, this->searchString));
@ -1146,11 +1146,12 @@ Epgsearch_searchresults_v1_0 cRecMenuSearch::GetEPGSearchStruct(void) {
cRecMenuSearchResults::cRecMenuSearchResults(std::string searchString, const cEvent **searchResults, int numResults) { cRecMenuSearchResults::cRecMenuSearchResults(std::string searchString, const cEvent **searchResults, int numResults) {
this->searchResults = searchResults; this->searchResults = searchResults;
SetWidthPercent(70); SetWidthPercent(70);
this->searchString = searchString;
this->numResults = numResults; this->numResults = numResults;
cString message1 = tr("search results for"); cString message1 = tr("search results for");
cString message2 = tr("search result for"); cString message2 = tr("search result for");
cString infoText = cString::sprintf("%d %s:\n\"%s\"", numResults, (numResults>1)?(*message1):(*message2), searchString.c_str()); cString infoText = cString::sprintf("%d %s:\n\"%s\"", numResults, (numResults>1)?(*message1):(*message2), searchString.c_str());
cRecMenuItem *infoItem = new cRecMenuItemInfo(*infoText); cRecMenuItem *infoItem = new cRecMenuItemInfo(*infoText, true);
infoItem->CalculateHeight(width - 2 * border); infoItem->CalculateHeight(width - 2 * border);
SetHeader(infoItem); SetHeader(infoItem);
@ -1210,12 +1211,21 @@ cRecMenuSearchConfirmTimer::cRecMenuSearchConfirmTimer(const cEvent *event) {
} }
// --- cRecMenuSearchNothingFound --------------------------------------------------------- // --- cRecMenuSearchNothingFound ---------------------------------------------------------
cRecMenuSearchNothingFound::cRecMenuSearchNothingFound(std::string searchString) { cRecMenuSearchNothingFound::cRecMenuSearchNothingFound(std::string searchString, bool tooShort) {
SetWidthPercent(50); SetWidthPercent(50);
cString message = tr("Nothing found for Search String"); cString text;
cString text = cString::sprintf("%s\n\"%s\"", if (!tooShort) {
*message, cString message = tr("Nothing found for Search String");
searchString.c_str()); 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); cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*text);
infoItem->CalculateHeight(width - 2 * border); infoItem->CalculateHeight(width - 2 * border);
AddMenuItem(infoItem); AddMenuItem(infoItem);
@ -1234,7 +1244,7 @@ cRecMenuRecordingSearch::cRecMenuRecordingSearch(std::string search) {
strncpy(searchString, search.c_str(), TEXTINPUTLENGTH); strncpy(searchString, search.c_str(), TEXTINPUTLENGTH);
SetWidthPercent(60); SetWidthPercent(60);
cString infoText = tr("Search in Recordings"); cString infoText = tr("Search in Recordings");
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText); cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*infoText, true);
infoItem->CalculateHeight(width - 2 * border); infoItem->CalculateHeight(width - 2 * border);
SetHeader(infoItem); SetHeader(infoItem);
@ -1256,7 +1266,7 @@ cRecMenuRecordingSearchResults::cRecMenuRecordingSearchResults(std::string searc
cString message4 = tr("for"); cString message4 = tr("for");
this->numResults = numResults; this->numResults = numResults;
cString infoText = cString::sprintf("%s %d %s %s:\n\"%s\"", *message1, numResults, (numResults>1)?(*message3):(*message2), *message4, searchString.c_str()); 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); cRecMenuItem *infoItem = new cRecMenuItemInfo(*infoText, true);
infoItem->CalculateHeight(width - 2 * border); infoItem->CalculateHeight(width - 2 * border);
SetHeader(infoItem); SetHeader(infoItem);

View File

@ -361,6 +361,7 @@ public:
// --- cRecMenuSearchResults --------------------------------------------------------- // --- cRecMenuSearchResults ---------------------------------------------------------
class cRecMenuSearchResults: public cRecMenu { class cRecMenuSearchResults: public cRecMenu {
private: private:
std::string searchString;
const cEvent **searchResults; const cEvent **searchResults;
int numResults; int numResults;
public: public:
@ -371,6 +372,7 @@ public:
delete[] searchResults; delete[] searchResults;
}; };
const cEvent *GetEvent(void); const cEvent *GetEvent(void);
std::string GetSearchString(void) { return searchString; };
}; };
// --- cRecMenuSearchConfirmTimer --------------------------------------------------------- // --- cRecMenuSearchConfirmTimer ---------------------------------------------------------
@ -383,7 +385,7 @@ public:
// --- cRecMenuSearchNothingFound --------------------------------------------------------- // --- cRecMenuSearchNothingFound ---------------------------------------------------------
class cRecMenuSearchNothingFound: public cRecMenu { class cRecMenuSearchNothingFound: public cRecMenu {
public: public:
cRecMenuSearchNothingFound(std::string searchString); cRecMenuSearchNothingFound(std::string searchString, bool tooShort = false);
virtual ~cRecMenuSearchNothingFound(void) {}; virtual ~cRecMenuSearchNothingFound(void) {};
}; };

View File

@ -198,8 +198,11 @@ bool cTVGuideSearchTimer::Parse(bool readTemplate) {
ID = atoi(values[value].c_str()); ID = atoi(values[value].c_str());
break; break;
case 1: case 1:
if (!readTemplate) if (!readTemplate) {
searchString = values[value]; std::string searchStringMasked = values[value];
std::replace(searchStringMasked.begin(), searchStringMasked.end(), '|', ':');
searchString = searchStringMasked;
}
break; break;
case 2: case 2:
useTime = atoi(values[value].c_str()); useTime = atoi(values[value].c_str());

View File

@ -338,7 +338,7 @@ void cMenuSetupFont::Set(void) {
Add(new cMenuEditIntItem(tr("Search & Recording Menu Font Size"), &tmpTvguideConfig->FontRecMenuItemDelta, -30, 30)); Add(new cMenuEditIntItem(tr("Search & Recording Menu Font Size"), &tmpTvguideConfig->FontRecMenuItemDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Search & Recording Menu Small Font Size"), &tmpTvguideConfig->FontRecMenuItemSmallDelta, -30, 30)); Add(new cMenuEditIntItem(tr("Search & Recording Menu Small Font Size"), &tmpTvguideConfig->FontRecMenuItemSmallDelta, -30, 30));
Add(new cMenuEditIntItem(tr("Search & Recording Main Menu Font Size"), &tmpTvguideConfig->FontRecMenuItemLargeDelta, -30, 30)); Add(new cMenuEditIntItem(tr("Search & Recording Menu Header Font Size"), &tmpTvguideConfig->FontRecMenuItemLargeDelta, -30, 30));
SetCurrent(Get(currentItem)); SetCurrent(Get(currentItem));
Display(); Display();