diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 6d6c306af..ec8b2a846 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -316,6 +316,7 @@ epgviewer.nodetailed Keine ausführlichen Informationen verfügbar epgviewer.notfound Keine Programminformationen (EPG) gefunden eventfinder.head EPG-Suche eventfinder.keyword Suche nach Textpassage +eventfinder.search_all_epg Ganze eventfinder.search Suche eventfinder.search_within_epg Suche innerhalb EPG-Daten eventfinder.search_within_list Suche innerhalb Text diff --git a/data/locale/english.locale b/data/locale/english.locale index 12f357934..9046f2087 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -317,6 +317,7 @@ epgviewer.notfound No EPG found eventfinder.head Search in EPG eventfinder.keyword Keyword eventfinder.search Search +eventfinder.search_all_epg whole eventfinder.search_within_epg Search within eventfinder.search_within_list Search within eventfinder.searching Search for keyword in EPG... diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index 95bd0bc38..78d90d089 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -2233,50 +2233,52 @@ printf("SIevent size: %d\n", (int)sizeof(SIevent)); } /* was: commandAllEventsChannelID sendAllEvents */ -void CEitManager::getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search, std::string search_text) +void CEitManager::getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search, std::string search_text,bool all_chann) { dprintf("sendAllEvents for " PRINTF_CHANNEL_ID_TYPE "\n", serviceUniqueKey); - if(!eList.empty() && search == 0)//skip on search mode eList.clear(); t_channel_id serviceUniqueKey64 = serviceUniqueKey& 0xFFFFFFFFFFFFULL; //0xFFFFFFFFFFFFULL for CREATE_CHANNEL_ID64 - if(serviceUniqueKey64 == 0) + if(serviceUniqueKey64 == 0 && !all_chann) return; // service Found readLockEvents(); int serviceIDfound = 0; - if (search_text.length()) std::transform(search_text.begin(), search_text.end(), search_text.begin(), tolower); for (MySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey::iterator e = mySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey.begin(); e != mySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey.end(); ++e) { - if ((*e)->get_channel_id() == serviceUniqueKey64 || (serviceUniqueKey64 == 1)) { + if ((*e)->get_channel_id() == serviceUniqueKey64 || (all_chann)) { serviceIDfound = 1; bool copy = true; - if(search == 0); // nothing to do here - else if(search == 1) { - std::string eName = (*e)->getName(); - std::transform(eName.begin(), eName.end(), eName.begin(), tolower); - if(eName.find(search_text) == std::string::npos) - copy = false; + if(search){ + if((search == 1) || (search == 5)) {//SEARCH_EPG_TITLE == 1 SEARCH_EPG_ALL == 5 defined in eventlist.h + std::string eName = (*e)->getName(); + std::transform(eName.begin(), eName.end(), eName.begin(), tolower); + if(eName.find(search_text) == std::string::npos) + copy = false; + } + if((search == 2) || (!copy && search == 5)) {//SEARCH_EPG_INFO1 == 2 + std::string eText = (*e)->getText(); + std::transform(eText.begin(), eText.end(), eText.begin(), tolower); + if(eText.find(search_text) == std::string::npos) + copy = false; + else if(search == 5) + copy = true; + } + if((search == 3) || (!copy && search == 5)) {//SEARCH_EPG_INFO2 == 3 + std::string eExtendedText = (*e)->getExtendedText(); + std::transform(eExtendedText.begin(), eExtendedText.end(), eExtendedText.begin(), tolower); + if(eExtendedText.find(search_text) == std::string::npos) + copy = false; + else if(search == 5) + copy = true; + } } - else if(search == 2) { - std::string eText = (*e)->getText(); - std::transform(eText.begin(), eText.end(), eText.begin(), tolower); - if(eText.find(search_text) == std::string::npos) - copy = false; - } - else if(search == 3) { - std::string eExtendedText = (*e)->getExtendedText(); - std::transform(eExtendedText.begin(), eExtendedText.end(), eExtendedText.begin(), tolower); - if(eExtendedText.find(search_text) == std::string::npos) - copy = false; - } - if(copy) { for (SItimes::iterator t = (*e)->times.begin(); t != (*e)->times.end(); ++t) { @@ -2289,7 +2291,7 @@ void CEitManager::getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEve aEvent.text = (*e)->getExtendedText().substr(0, 120); else aEvent.text = (*e)->getText(); - if(serviceUniqueKey64 == 1)//hack for all channel search + if(all_chann)//hack for all channel search aEvent.channelID = (*e)->get_channel_id(); else aEvent.channelID = serviceUniqueKey; diff --git a/src/eitd/sectionsd.h b/src/eitd/sectionsd.h index 2181502f6..9f82b216a 100644 --- a/src/eitd/sectionsd.h +++ b/src/eitd/sectionsd.h @@ -55,7 +55,7 @@ class CEitManager : public OpenThreads::Thread, public OpenThreads::Mutex bool Stop(); void SetConfig(CSectionsdClient::epg_config &cfg) { config = cfg; }; - void getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search = 0, std::string search_text = ""); + void getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search = 0, std::string search_text = "", bool all_chann=false); void getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSectionsdClient::responseGetCurrentNextInfoChannelID& current_next ); bool getEPGidShort(event_id_t epgID, CShortEPGData * epgdata); bool getEPGid(const event_id_t epgID, const time_t startzeit, CEPGData * epgdata); diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index c46a491fb..ca9b314b1 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -92,7 +92,6 @@ CNeutrinoEventList::CNeutrinoEventList() sort_mode = 0; m_search_list = SEARCH_LIST_NONE; - m_search_epg_item = SEARCH_LIST_NONE; m_search_epg_item = SEARCH_EPG_TITLE; m_search_channel_id = 1; m_search_bouquet_id= 1; @@ -1034,7 +1033,6 @@ bool CNeutrinoEventList::findEvents(void) hide(); menu.exec(NULL,""); search_head_name = g_Locale->getText(LOCALE_EVENTFINDER_SEARCH); - if(event == 1) { res = true; @@ -1071,7 +1069,7 @@ bool CNeutrinoEventList::findEvents(void) for (it = v.begin(); it != v.end(); ++it){ ch_id_map[*it & 0xFFFFFFFFFFFFULL] = *it; } - CEitManager::getInstance()->getEventsServiceKey(1/*hack*/,evtlist, m_search_epg_item,m_search_keyword); + CEitManager::getInstance()->getEventsServiceKey(0,evtlist, m_search_epg_item,m_search_keyword, true);//all_chann std::map::iterator map_it; CChannelEventList::iterator e; @@ -1167,14 +1165,15 @@ const CMenuOptionChooser::keyval SEARCH_LIST_OPTIONS[SEARCH_LIST_OPTION_COUNT] = }; -#define SEARCH_EPG_OPTION_COUNT 3 +#define SEARCH_EPG_OPTION_COUNT 4 const CMenuOptionChooser::keyval SEARCH_EPG_OPTIONS[SEARCH_EPG_OPTION_COUNT] = { // { CNeutrinoEventList::SEARCH_EPG_NONE, LOCALE_PICTUREVIEWER_RESIZE_NONE }, { CNeutrinoEventList::SEARCH_EPG_TITLE, LOCALE_FONTSIZE_EPG_TITLE }, { CNeutrinoEventList::SEARCH_EPG_INFO1, LOCALE_FONTSIZE_EPG_INFO1 }, - { CNeutrinoEventList::SEARCH_EPG_INFO2, LOCALE_FONTSIZE_EPG_INFO2 } -// ,{ CNeutrinoEventList::SEARCH_EPG_GENRE, LOCALE_MOVIEBROWSER_INFO_GENRE_MAJOR } + { CNeutrinoEventList::SEARCH_EPG_INFO2, LOCALE_FONTSIZE_EPG_INFO2 }, +// { CNeutrinoEventList::SEARCH_EPG_GENRE, LOCALE_MOVIEBROWSER_INFO_GENRE_MAJOR }, + { CNeutrinoEventList::SEARCH_EPG_ALL, LOCALE_EVENTFINDER_SEARCH_ALL_EPG } }; @@ -1203,7 +1202,6 @@ int CEventFinderMenu::exec(CMenuTarget* parent, const std::string &actionkey) { int res = menu_return::RETURN_REPAINT; - if(actionkey =="") { if(parent != NULL) @@ -1335,6 +1333,7 @@ int CEventFinderMenu::showMenu(void) bool CEventFinderMenu::changeNotify(const neutrino_locale_t OptionName, void *) /************************************************************************************************/ { + if (ARE_LOCALES_EQUAL(OptionName, LOCALE_EVENTFINDER_SEARCH_WITHIN_LIST)) { if (*m_search_list == CNeutrinoEventList::SEARCH_LIST_CHANNEL) diff --git a/src/gui/eventlist.h b/src/gui/eventlist.h index c39d5f1eb..8eff085db 100644 --- a/src/gui/eventlist.h +++ b/src/gui/eventlist.h @@ -46,32 +46,32 @@ class CNeutrinoEventList { - // Eventfinder start - public: - typedef enum - { - SEARCH_EPG_NONE, - SEARCH_EPG_TITLE, - SEARCH_EPG_INFO1, - SEARCH_EPG_INFO2, - SEARCH_EPG_GENRE, - SEARCH_EPG_ALL - }SEARCH_EPG; - typedef enum - { - SEARCH_LIST_NONE, - SEARCH_LIST_CHANNEL, - SEARCH_LIST_BOUQUET, - SEARCH_LIST_ALL - }SEARCH_LIST; - private: - int m_search_epg_item; - std::string m_search_keyword; + // Eventfinder start + public: + typedef enum + { + SEARCH_EPG_NONE, + SEARCH_EPG_TITLE, + SEARCH_EPG_INFO1, + SEARCH_EPG_INFO2, + SEARCH_EPG_GENRE, + SEARCH_EPG_ALL + }SEARCH_EPG; + typedef enum + { + SEARCH_LIST_NONE, + SEARCH_LIST_CHANNEL, + SEARCH_LIST_BOUQUET, + SEARCH_LIST_ALL + }SEARCH_LIST; + private: + int m_search_epg_item; + std::string m_search_keyword; std::string m_search_autokeyword; - int m_search_list; - t_channel_id m_search_channel_id; - t_bouquet_id m_search_bouquet_id; - bool m_showChannel; + int m_search_list; + t_channel_id m_search_channel_id; + t_bouquet_id m_search_bouquet_id; + bool m_showChannel; int FunctionBarHeight; int oldIndex; event_id_t oldEventID; diff --git a/src/system/locals.h b/src/system/locals.h index 7e8d1f76c..5ef52ea1e 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -344,6 +344,7 @@ typedef enum LOCALE_EVENTFINDER_HEAD, LOCALE_EVENTFINDER_KEYWORD, LOCALE_EVENTFINDER_SEARCH, + LOCALE_EVENTFINDER_SEARCH_ALL_EPG, LOCALE_EVENTFINDER_SEARCH_WITHIN_EPG, LOCALE_EVENTFINDER_SEARCH_WITHIN_LIST, LOCALE_EVENTFINDER_SEARCHING, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index d241acc6f..fe8eedd57 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -344,6 +344,7 @@ const char * locale_real_names[] = "eventfinder.head", "eventfinder.keyword", "eventfinder.search", + "eventfinder.search_all_epg", "eventfinder.search_within_epg", "eventfinder.search_within_list", "eventfinder.searching",