So, hier erstmal die endgültige Version, wenn niemand Einwände hat, checke ich das die Tage mal ein, damit sich das Durcheinander in meinem view mal auflöst...
Bei Bedarf kann ich noch mal ein image (und oder neutrino/sectionsd) auf yousendit stellen.
Code: Alles auswählen
? .cdtproject
? .externalToolBuilders
? .project
? .settings
? cdk
? apps/tuxbox/tools/kb2rcd/kb2rcd
? apps/tuxbox/tools/misc/avswitch
? driver/ide/.depend
Index: apps/tuxbox/neutrino/daemons/sectionsd/sectionsd.cpp
===================================================================
RCS file: /cvs/tuxbox/apps/tuxbox/neutrino/daemons/sectionsd/sectionsd.cpp,v
retrieving revision 1.230
diff -u -b -B -r1.230 sectionsd.cpp
--- apps/tuxbox/neutrino/daemons/sectionsd/sectionsd.cpp 14 Nov 2006 20:36:30 -0000 1.230
+++ apps/tuxbox/neutrino/daemons/sectionsd/sectionsd.cpp 6 Jan 2007 01:24:34 -0000
@@ -1372,7 +1372,7 @@
return ;
}
-static void sendAllEvents(int connfd, t_channel_id serviceUniqueKey, bool oldFormat = true )
+static void sendAllEvents(int connfd, t_channel_id serviceUniqueKey, bool oldFormat = true,char search = 0,std::string* search_text = NULL )
{
#define MAX_SIZE_EVENTLIST 64*1024
char *evtList = new char[MAX_SIZE_EVENTLIST]; // 64kb should be enough and dataLength is unsigned short
@@ -1407,6 +1407,29 @@
{
serviceIDfound = 1;
+ std::string eName = (*e)->getName();
+ std::string eText = (*e)->getText();
+ std::string eExtendedText = (*e)->getExtendedText();
+
+ bool copy = true;
+ if(search == 0); // nothing to do here
+ else if(search == 1)
+ {
+ if(eName.find(*search_text) == std::string::npos)
+ copy = false;
+ }
+ else if(search == 2)
+ {
+ if(eText.find(*search_text) == std::string::npos)
+ copy = false;
+ }
+ else if(search == 3)
+ {
+ if(eExtendedText.find(*search_text) == std::string::npos)
+ copy = false;
+ }
+
+ if(copy)
for (SItimes::iterator t = (*e)->times.begin(); t != (*e)->times.end(); ++t)
{
// if (t->startzeit > laststart) {
@@ -3594,8 +3617,23 @@
return;
}
-static void commandDummy3(int connfd, char *data, const unsigned dataLength)
+static void commandAllEventsChannelIDSearch(int connfd, char *data, const unsigned dataLength)
{
+ //dprintf("Request of commandDummy3, %d\n",dataLength);
+ if (dataLength > 5)
+ {
+ char *data_ptr = data;
+ char search = 0;
+ std::string search_text;
+
+ t_channel_id channel_id = *(t_channel_id*)data_ptr;
+ data_ptr += sizeof(t_channel_id);
+ search = *data_ptr;
+ data_ptr += sizeof(char);
+ if(search != 0)
+ search_text = data_ptr;
+ sendAllEvents(connfd, channel_id, false,search,&search_text);
+ }
return;
}
@@ -3743,7 +3781,7 @@
{ commandDummy2, "commandDummy2" },
{ commandDumpStatusInformation, "commandDumpStatusInformation" },
//commandAllEventsChannelName,
-{ commandDummy3, "commandDummy3" },
+{ commandAllEventsChannelIDSearch, "commandAllEventsChannelIDSearch" },
{ commandSetHoursToCache, "commandSetHoursToCache" },
{ commandSetEventsAreOldInMinutes, "commandSetEventsAreOldInMinutes" },
{ commandDumpAllServices, "commandDumpAllServices" },
Index: apps/tuxbox/neutrino/data/locale/deutsch.locale
===================================================================
RCS file: /cvs/tuxbox/apps/tuxbox/neutrino/data/locale/deutsch.locale,v
retrieving revision 1.401
diff -u -b -B -r1.401 deutsch.locale
--- apps/tuxbox/neutrino/data/locale/deutsch.locale 12 Sep 2006 19:56:38 -0000 1.401
+++ apps/tuxbox/neutrino/data/locale/deutsch.locale 6 Jan 2007 01:24:38 -0000
@@ -275,6 +275,13 @@
epgviewer.More_Screenings Weitere Termine auf diesem Kanal
epgviewer.nodetailed Keine ausführlichen Informationen verfügbar
epgviewer.notfound keine Programminformationen (EPG) gefunden
+eventfinder.head Stichwortsuche im EPG
+eventfinder.keyword Stichwort
+eventfinder.start_search Starte Suche
+eventfinder.search_wihtin_list Suche in
+eventfinder.search_wihtin_epg Suche in
+eventfinder.search Suche
+eventfinder.searching Suche Stichwort in EPG ...
eventlistbar.channelswitch Umschalten
eventlistbar.eventsort Sortieren
eventlistbar.recordevent Aufnehmen
Index: apps/tuxbox/neutrino/data/locale/english.locale
===================================================================
RCS file: /cvs/tuxbox/apps/tuxbox/neutrino/data/locale/english.locale,v
retrieving revision 1.324
diff -u -b -B -r1.324 english.locale
--- apps/tuxbox/neutrino/data/locale/english.locale 14 Sep 2006 21:20:11 -0000 1.324
+++ apps/tuxbox/neutrino/data/locale/english.locale 6 Jan 2007 01:24:40 -0000
@@ -275,6 +275,13 @@
epgviewer.More_Screenings More Screenings on this Channel
epgviewer.nodetailed No detailed informations available
epgviewer.notfound no epg found
+eventfinder.head Search in EPG
+eventfinder.keyword Keyword
+eventfinder.start_search Start Search
+eventfinder.search_wihtin_list Search within
+eventfinder.search_wihtin_epg Search within
+eventfinder.search Search
+eventfinder.searching Search for keyword in EPG...
eventlistbar.channelswitch schedule
eventlistbar.eventsort sorting
eventlistbar.recordevent record
Index: apps/tuxbox/neutrino/lib/sectionsdclient/sectionsdMsg.h
===================================================================
RCS file: /cvs/tuxbox/apps/tuxbox/neutrino/lib/sectionsdclient/sectionsdMsg.h,v
retrieving revision 1.14
diff -u -b -B -r1.14 sectionsdMsg.h
--- apps/tuxbox/neutrino/lib/sectionsdclient/sectionsdMsg.h 19 May 2006 21:28:09 -0000 1.14
+++ apps/tuxbox/neutrino/lib/sectionsdclient/sectionsdMsg.h 6 Jan 2007 01:24:41 -0000
@@ -60,7 +60,7 @@
dummy2,
dumpStatusinformation,
//allEventsChannelName,
- dummy3,
+ allEventsChannelIDSearch,
setHoursToCache,
setEventsAreOldInMinutes,
dumpAllServices,
Index: apps/tuxbox/neutrino/lib/sectionsdclient/sectionsdclient.cpp
===================================================================
RCS file: /cvs/tuxbox/apps/tuxbox/neutrino/lib/sectionsdclient/sectionsdclient.cpp,v
retrieving revision 1.50
diff -u -b -B -r1.50 sectionsdclient.cpp
--- apps/tuxbox/neutrino/lib/sectionsdclient/sectionsdclient.cpp 8 Jun 2006 20:19:33 -0000 1.50
+++ apps/tuxbox/neutrino/lib/sectionsdclient/sectionsdclient.cpp 6 Jan 2007 01:24:42 -0000
@@ -385,6 +385,76 @@
return eList;
}
+//GU:EPG
+/* This function does initiate a search for a keyword in all EPG Event of the Channel channel_id in sectionsd.
+ The parameter search_typ does specify the search mode
+ 0: none -> all EPG events of the channel are returned
+ 1: keyword search in EPG Title
+ 2: keyword search in EPG short description (INFO1)
+ 3: keyword search in EPG description (INFO2)
+ In case of a match, the EPG event is added to the Eventlist eList.
+ */
+bool CSectionsdClient::getEventsServiceKeySearchAdd(CChannelEventList& eList,const t_channel_id channel_id,char search_typ,std::string& search_text)
+{
+ int nBufSize=0;
+
+ nBufSize += sizeof(t_channel_id);
+ nBufSize += sizeof(char);
+ nBufSize += search_text.size()+1;
+
+ char* pSData = new char[nBufSize];
+ char* pSData_ptr = pSData;
+
+ *(t_channel_id*)pSData_ptr = channel_id;
+ pSData_ptr += sizeof(t_channel_id);
+ *pSData_ptr = search_typ;
+ pSData_ptr += sizeof(char);
+ strcpy(pSData_ptr,search_text.c_str());
+
+ if (send(sectionsd::allEventsChannelIDSearch, pSData, nBufSize))
+ {
+ int nBufSize = readResponse();
+
+ if( nBufSize > 0)
+ {
+ char* pData = new char[nBufSize];
+ receive_data(pData, nBufSize);
+
+ char* dp = pData;
+
+ int a = eList.size();
+
+ while(dp < pData + nBufSize)
+ {
+ CChannelEvent aEvent;
+
+ aEvent.eventID = *((event_id_t *) dp);
+ dp+=sizeof(aEvent.eventID);
+
+ aEvent.startTime = *((time_t *) dp);
+ dp+=sizeof(aEvent.startTime);
+
+ aEvent.duration = *((unsigned *) dp);
+ dp+=sizeof(aEvent.duration);
+
+ aEvent.description= dp;
+ dp+=strlen(dp)+1;
+
+ aEvent.text= dp;
+ dp+=strlen(dp)+1;
+
+ eList.push_back(aEvent);
+ }
+ int b = eList.size() -a;
+ delete[] pData;
+ }
+ }
+ delete[] pSData;
+
+ close_connection();
+ return true;
+}
+
CChannelEventList CSectionsdClient::getEventsServiceKey(const t_channel_id channel_id)
{
CChannelEventList eList;
Index: apps/tuxbox/neutrino/lib/sectionsdclient/sectionsdclient.h
===================================================================
RCS file: /cvs/tuxbox/apps/tuxbox/neutrino/lib/sectionsdclient/sectionsdclient.h,v
retrieving revision 1.39
diff -u -b -B -r1.39 sectionsdclient.h
--- apps/tuxbox/neutrino/lib/sectionsdclient/sectionsdclient.h 8 Jun 2006 20:19:33 -0000 1.39
+++ apps/tuxbox/neutrino/lib/sectionsdclient/sectionsdclient.h 6 Jan 2007 01:24:42 -0000
@@ -176,6 +176,8 @@
CChannelEventList getEventsServiceKey(const t_channel_id channel_id);
+ bool getEventsServiceKeySearchAdd(CChannelEventList& evtlist,const t_channel_id channel_id,char m_search_typ,std::string& m_search_text);
+
bool getEPGid(const event_id_t eventid, const time_t starttime, CEPGData * epgdata);
bool getActualEPGServiceKey(const t_channel_id channel_id, CEPGData * epgdata);
Index: apps/tuxbox/neutrino/src/gui/channellist.h
===================================================================
RCS file: /cvs/tuxbox/apps/tuxbox/neutrino/src/gui/channellist.h,v
retrieving revision 1.70
diff -u -b -B -r1.70 channellist.h
--- apps/tuxbox/neutrino/src/gui/channellist.h 21 Aug 2006 20:58:26 -0000 1.70
+++ apps/tuxbox/neutrino/src/gui/channellist.h 6 Jan 2007 01:24:43 -0000
@@ -104,6 +104,7 @@
void addChannel(int key, int number, const std::string& name, const t_satellite_position satellitePosition, t_channel_id ids = 0); // UTF-8
void addChannel(CChannel* chan);
CChannel* getChannel( int number);
+ CChannel* getChannelFromIndex( uint index) { if (chanlist.size() > index) return chanlist[index]; else return NULL;};
CChannel* operator[]( uint index) { if (chanlist.size() > index) return chanlist[index]; else return NULL;};
int getKey(int);
Index: apps/tuxbox/neutrino/src/gui/eventlist.cpp
===================================================================
RCS file: /cvs/tuxbox/apps/tuxbox/neutrino/src/gui/eventlist.cpp,v
retrieving revision 1.99
diff -u -b -B -r1.99 eventlist.cpp
--- apps/tuxbox/neutrino/src/gui/eventlist.cpp 28 Dec 2006 21:43:00 -0000 1.99
+++ apps/tuxbox/neutrino/src/gui/eventlist.cpp 6 Jan 2007 01:24:45 -0000
@@ -44,6 +44,12 @@
#include <global.h>
#include <neutrino.h>
+#include "widget/hintbox.h"
+#include "gui/bouquetlist.h"
+#include <gui/widget/stringinput.h>
+extern CBouquetList * bouquetList;
+
+
#include <zapit/client/zapitclient.h> /* CZapitClient::Utf8_to_Latin1 */
#include <driver/screen_max.h>
@@ -74,6 +80,12 @@
selected = 0;
current_event = 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;
+
//width = 580;
// //height = 440;
//height = 480;
@@ -214,6 +226,17 @@
int res = menu_return::RETURN_REPAINT;
+ if(m_search_list == SEARCH_LIST_NONE) // init globals once only
+ {
+ m_search_epg_item = SEARCH_EPG_TITLE;
+ //m_search_keyword = "";
+ m_search_list = SEARCH_LIST_CHANNEL;
+ m_search_channel_id = channel_id;
+ m_search_bouquet_id= bouquetList->getActiveBouquetNumber();
+ //m_search_source_text = "";
+ }
+ m_showChannel = false; // do not show the channel in normal mode, we just need it in search mode
+
name = channelname;
sort_mode=0;
paintHead();
@@ -428,6 +451,11 @@
}
}
}
+ else if ( msg==CRCInput::RC_green )
+ {
+ findEvents();
+ timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]);
+ }
else
{
if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all )
@@ -495,6 +523,13 @@
datetime2_str += '.';
+ if ( m_showChannel ) // show the channel if we made a event search only (which could be made through all channels ).
+ {
+ t_channel_id channel = evtlist[liststart+pos].get_channel_id();
+ datetime2_str += " ";
+ datetime2_str += g_Zapit->getChannelName(channel);
+ }
+
sprintf(tmpstr, "[%d min]", evtlist[liststart+pos].duration / 60 );
duration_str = tmpstr;
}
@@ -595,6 +630,13 @@
g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(bx+bdx+cellwidth*pos, by+bh-h_offset, bw-30, g_Locale->getText(LOCALE_EVENTLISTBAR_RECORDEVENT), COL_INFOBAR, 0, true); // UTF-8
}
+ if (1)
+ {
+ pos = 1;
+ frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, bx+8+cellwidth*pos, by+h_offset);
+ g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(bx+bdx+cellwidth*pos, by+bh-h_offset, bw-30, g_Locale->getText(LOCALE_EVENTFINDER_SEARCH), COL_INFOBAR, 0, true); // UTF-8
+ }
+
// Button: Timer Channelswitch
if (g_settings.key_channelList_addremind != (int)CRCInput::RC_nokey)
{
@@ -649,3 +691,283 @@
}
+/************************************************************************************************/
+int EventList::findEvents(void)
+/************************************************************************************************/
+{
+ int res = 0;
+ int event = 0;
+ t_channel_id channel_id; //g_Zapit->getCurrentServiceID()
+
+ CEventFinderMenu menu( &event,
+ &m_search_epg_item,
+ &m_search_keyword,
+ &m_search_list,
+ &m_search_channel_id,
+ &m_search_bouquet_id
+ );
+ hide();
+ menu.exec(NULL,"");
+
+ if(event == 1)
+ {
+ m_showChannel = true; // force the event list to paint the channel name
+ evtlist.clear();
+ if(m_search_list == SEARCH_LIST_CHANNEL)
+ {
+ g_Sectionsd->getEventsServiceKeySearchAdd(evtlist,m_search_channel_id,m_search_epg_item,m_search_keyword);
+ }
+ else if(m_search_list == SEARCH_LIST_BOUQUET)
+ {
+ int channel_nr = bouquetList->Bouquets[m_search_bouquet_id]->channelList->getSize();
+ for(int channel = 0; channel < channel_nr; channel++)
+ {
+ channel_id = bouquetList->Bouquets[m_search_bouquet_id]->channelList->getChannelFromIndex(channel)->channel_id;
+ g_Sectionsd->getEventsServiceKeySearchAdd(evtlist,channel_id,m_search_epg_item,m_search_keyword);
+ }
+ }
+ else if(m_search_list == SEARCH_LIST_ALL)
+ {
+ CHintBox box(LOCALE_TIMING_EPG,g_Locale->getText(LOCALE_EVENTFINDER_SEARCHING));
+ box.paint();
+ int bouquet_nr = bouquetList->Bouquets.size();
+ for(int bouquet = 0; bouquet < bouquet_nr; bouquet++)
+ {
+ int channel_nr = bouquetList->Bouquets[bouquet]->channelList->getSize();
+ for(int channel = 0; channel < channel_nr; channel++)
+ {
+ channel_id = bouquetList->Bouquets[bouquet]->channelList->getChannelFromIndex(channel)->channel_id;
+ g_Sectionsd->getEventsServiceKeySearchAdd(evtlist,channel_id,m_search_epg_item,m_search_keyword);
+ }
+ }
+ box.hide();
+ }
+ sort(evtlist.begin(),evtlist.end(),sortByDateTime);
+ current_event = (unsigned int)-1;
+ time_t azeit=time(NULL);
+
+ CChannelEventList::iterator e;
+ for ( e=evtlist.begin(); e!=evtlist.end(); ++e )
+ {
+ if ( e->startTime > azeit ) {
+ break;
+ }
+ current_event++;
+ }
+ if(evtlist.empty())
+ {
+ if ( evtlist.size() == 0 )
+ {
+ CChannelEvent evt;
+ evt.description = ZapitTools::UTF8_to_Latin1(g_Locale->getText(LOCALE_EPGLIST_NOEVENTS));
+ evt.eventID = 0;
+ evtlist.push_back(evt);
+ }
+ }
+ if (current_event == (unsigned int)-1)
+ current_event = 0;
+ selected= current_event;
+
+ name = g_Locale->getText(LOCALE_EVENTFINDER_SEARCH);
+ name += ": '";
+ name += m_search_keyword;
+ name += "'";
+ }
+ paintHead();
+ paint();
+ showFunctionBar(true);
+ return(res);
+}
+
+/************************************************************************************************/
+/*
+class CSearchNotifier : public CChangeObserver
+{
+ private:
+ CMenuItem* menuItem;
+ public:
+ CSearchNotifier( CMenuItem* i){menuItem=i};
+ bool changeNotify(const neutrino_locale_t t, void * data)
+ {
+ int selected = *(int*)data;
+ menuItem->setActive(1);
+ menuItem
+ }
+};
+*/
+/************************************************************************************************
+bool CEventFinderMenuHandler::changeNotify(const neutrino_locale_t OptionName, void *Data)
+{
+ if(OptionName == )
+ {
+ }
+
+ return true;
+}
+*/
+
+#define SEARCH_LIST_OPTION_COUNT 3
+const CMenuOptionChooser::keyval SEARCH_LIST_OPTIONS[SEARCH_LIST_OPTION_COUNT] =
+{
+// { EventList::SEARCH_LIST_NONE , LOCALE_PICTUREVIEWER_RESIZE_NONE },
+ { EventList::SEARCH_LIST_CHANNEL , LOCALE_TIMERLIST_CHANNEL },
+ { EventList::SEARCH_LIST_BOUQUET , LOCALE_BOUQUETLIST_HEAD },
+ { EventList::SEARCH_LIST_ALL , LOCALE_CHANNELLIST_HEAD }
+};
+
+
+#define SEARCH_EPG_OPTION_COUNT 3
+const CMenuOptionChooser::keyval SEARCH_EPG_OPTIONS[SEARCH_EPG_OPTION_COUNT] =
+{
+// { EventList::SEARCH_EPG_NONE , LOCALE_PICTUREVIEWER_RESIZE_NONE },
+ { EventList::SEARCH_EPG_TITLE , LOCALE_FONTSIZE_EPG_TITLE },
+ { EventList::SEARCH_EPG_INFO1 , LOCALE_FONTSIZE_EPG_INFO1 },
+ { EventList::SEARCH_EPG_INFO2 , LOCALE_FONTSIZE_EPG_INFO2 }
+// ,{ EventList::SEARCH_EPG_GENRE , LOCALE_MOVIEBROWSER_INFO_GENRE_MAJOR }
+};
+
+
+
+/************************************************************************************************/
+CEventFinderMenu::CEventFinderMenu( int* event,
+ int* search_epg_item,
+ std::string* search_keyword,
+ int* search_list,
+ t_channel_id* search_channel_id,
+ t_bouquet_id* search_bouquet_id)
+/************************************************************************************************/
+{
+ m_event = event;
+ m_search_epg_item = search_epg_item;
+ m_search_keyword = search_keyword;
+ m_search_list = search_list;
+ m_search_channel_id = search_channel_id;
+ m_search_bouquet_id = search_bouquet_id;
+}
+
+
+/************************************************************************************************/
+int CEventFinderMenu::exec(CMenuTarget* parent, const std::string &actionkey)
+/************************************************************************************************/
+{
+ int res = menu_return::RETURN_REPAINT;
+
+
+ if(actionkey =="")
+ {
+ if(parent != NULL)
+ parent->hide();
+ //printf("0\n");
+ showMenu();
+ }
+ else if(actionkey =="1")
+ {
+ //printf("1\n");
+ *m_event = true;
+ res = menu_return::RETURN_EXIT_ALL;
+ }
+ else if(actionkey =="2")
+ {
+ //printf("2\n");
+ /*
+ if(*m_search_list == EventList::SEARCH_LIST_CHANNEL)
+ {
+ mf[1]->setActive(true);
+ m_search_channelname = g_Zapit->getChannelName(*m_search_channel_id);;
+ }
+ else if(*m_search_list == EventList::SEARCH_LIST_BOUQUET)
+ {
+ mf[1]->setActive(true);
+ m_search_channelname = bouquetList->Bouquets[*m_search_bouquet_id]->channelList->getName();
+ }
+ else if(*m_search_list == EventList::SEARCH_LIST_ALL)
+ {
+ mf[1]->setActive(false);
+ m_search_channelname = "";
+ }
+ */
+ }
+ else if(actionkey =="3")
+ {
+ //printf("3\n");
+ // get channel id / bouquet id
+ if(*m_search_list == EventList::SEARCH_LIST_CHANNEL)
+ {
+ int nNewChannel;
+ int nNewBouquet;
+ nNewBouquet = bouquetList->show();
+ //printf("new_bouquet_id %d\n",nNewBouquet);
+ if (nNewBouquet > -1)
+ {
+ nNewChannel = bouquetList->Bouquets[nNewBouquet]->channelList->show();
+ //printf("nNewChannel %d\n",nNewChannel);
+ if (nNewChannel > -1)
+ {
+ *m_search_bouquet_id = nNewBouquet;
+ *m_search_channel_id = bouquetList->Bouquets[nNewBouquet]->channelList->getActiveChannel_ChannelID();
+ m_search_channelname = g_Zapit->getChannelName(*m_search_channel_id);
+ }
+ }
+ }
+ else if(*m_search_list == EventList::SEARCH_LIST_BOUQUET)
+ {
+ int nNewBouquet;
+ nNewBouquet = bouquetList->show();
+ //printf("new_bouquet_id %d\n",nNewBouquet);
+ if (nNewBouquet > -1)
+ {
+ *m_search_bouquet_id = nNewBouquet;
+ m_search_channelname = bouquetList->Bouquets[nNewBouquet]->channelList->getName();
+ }
+ }
+ }
+ else if(actionkey =="4")
+ {
+ //printf("4\n");
+ }
+
+ return res;
+}
+
+/************************************************************************************************/
+int CEventFinderMenu::showMenu(void)
+/************************************************************************************************/
+{
+ int res = menu_return::RETURN_REPAINT;
+ *m_event = false;
+
+ if(*m_search_list == EventList::SEARCH_LIST_CHANNEL)
+ {
+ m_search_channelname = g_Zapit->getChannelName(*m_search_channel_id);
+ }
+ else if(*m_search_list == EventList::SEARCH_LIST_BOUQUET)
+ {
+ m_search_channelname = bouquetList->Bouquets[*m_search_bouquet_id]->channelList->getName();
+ }
+ else if(*m_search_list == EventList::SEARCH_LIST_ALL)
+ {
+ m_search_channelname =="";
+ }
+
+ CStringInputSMS stringInput(LOCALE_EVENTFINDER_KEYWORD,m_search_keyword, 20, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-.: ");
+
+ CMenuForwarder* mf0 = new CMenuForwarder(LOCALE_EVENTFINDER_START_SEARCH, true, NULL, this, "1", CRCInput::RC_1 );
+ CMenuOptionChooser* mo0 = new CMenuOptionChooser(LOCALE_EVENTFINDER_SEARCH_WIHTIN_LIST , m_search_list, SEARCH_LIST_OPTIONS, SEARCH_LIST_OPTION_COUNT, true, NULL, CRCInput::RC_2);
+ CMenuForwarderNonLocalized* mf1= new CMenuForwarderNonLocalized("", *m_search_list != EventList::SEARCH_LIST_ALL , m_search_channelname, this, "3", CRCInput::RC_3 );
+ CMenuOptionChooser* mo1 = new CMenuOptionChooser(LOCALE_EVENTFINDER_SEARCH_WIHTIN_EPG, m_search_epg_item, SEARCH_EPG_OPTIONS, SEARCH_EPG_OPTION_COUNT, true, NULL, CRCInput::RC_4);
+ CMenuForwarderNonLocalized* mf2= new CMenuForwarderNonLocalized("",true, *m_search_keyword, &stringInput, NULL, CRCInput::RC_5 );
+
+ CMenuWidget searchMenu(LOCALE_EVENTFINDER_HEAD, "features.raw", 450);
+ searchMenu.addItem(GenericMenuSeparator);
+ searchMenu.addItem(mf0, false);
+ searchMenu.addItem(GenericMenuSeparatorLine);
+ searchMenu.addItem(mo0, false);
+ searchMenu.addItem(mf1, false);
+ searchMenu.addItem(GenericMenuSeparatorLine);
+ searchMenu.addItem(mo1, false);
+ searchMenu.addItem(mf2, false);
+
+ res = searchMenu.exec(NULL,"");
+ return(res);
+}
+
Index: apps/tuxbox/neutrino/src/gui/eventlist.h
===================================================================
RCS file: /cvs/tuxbox/apps/tuxbox/neutrino/src/gui/eventlist.h,v
retrieving revision 1.27
diff -u -b -B -r1.27 eventlist.h
--- apps/tuxbox/neutrino/src/gui/eventlist.h 21 Aug 2006 20:58:26 -0000 1.27
+++ apps/tuxbox/neutrino/src/gui/eventlist.h 6 Jan 2007 01:24:45 -0000
@@ -50,6 +50,36 @@
class EventList
{
+ // 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;
+ int m_search_list;
+ t_channel_id m_search_channel_id;
+ t_bouquet_id m_search_bouquet_id;
+ bool m_showChannel;
+
+ private:
+ int findEvents(void);
+ // Eventfinder end
+
private:
CFrameBuffer *frameBuffer;
CChannelEventList evtlist;
@@ -95,6 +125,27 @@
};
+class CEventFinderMenu : public CMenuTarget
+{
+ private:
+ int* m_event;
+ int* m_search_epg_item;
+ std::string* m_search_keyword;
+ int* m_search_list;
+ std::string m_search_channelname;
+ t_channel_id* m_search_channel_id;
+ t_bouquet_id* m_search_bouquet_id;
+ int showMenu(void);
+ public:
+ CEventFinderMenu( int* event,
+ int* search_epg_item,
+ std::string* search_keyword,
+ int* search_list,
+ t_channel_id* search_channel_id,
+ t_bouquet_id* search_bouquet_id);
+ int exec( CMenuTarget* parent, const std::string &actionkey);
+
+};
#endif
Index: apps/tuxbox/neutrino/src/gui/widget/menue.cpp
===================================================================
RCS file: /cvs/tuxbox/apps/tuxbox/neutrino/src/gui/widget/menue.cpp,v
retrieving revision 1.135
diff -u -b -B -r1.135 menue.cpp
--- apps/tuxbox/neutrino/src/gui/widget/menue.cpp 2 Sep 2006 21:15:53 -0000 1.135
+++ apps/tuxbox/neutrino/src/gui/widget/menue.cpp 6 Jan 2007 01:24:47 -0000
@@ -484,6 +484,7 @@
CMenuOptionChooser::CMenuOptionChooser(const neutrino_locale_t OptionName, int * const OptionValue, const struct keyval * const Options, const unsigned Number_Of_Options, const bool Active, CChangeObserver * const Observ, const neutrino_msg_t DirectKey, const std::string & IconName)
{
height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight();
+ optionNameString = g_Locale->getText(OptionName);
optionName = OptionName;
options = Options;
active = Active;
@@ -494,6 +495,19 @@
iconName = IconName;
}
+CMenuOptionChooser::CMenuOptionChooser(const char* OptionName, int * const OptionValue, const struct keyval * const Options, const unsigned Number_Of_Options, const bool Active, CChangeObserver * const Observ, const neutrino_msg_t DirectKey, const std::string & IconName)
+{
+ height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight();
+ optionNameString = OptionName;
+ optionName = NONEXISTANT_LOCALE;
+ options = Options;
+ active = Active;
+ optionValue = OptionValue;
+ number_of_options = Number_Of_Options;
+ observ = Observ;
+ directKey = DirectKey;
+ iconName = IconName;
+}
void CMenuOptionChooser::setOptionValue(const int newvalue)
{
@@ -575,13 +589,12 @@
int stringstartposName = x + offx + 10;
int stringstartposOption = x + dx - stringwidth - 10; //+ offx
- const char * l_optionName = g_Locale->getText(optionName);
- g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(stringstartposName, y+height,dx- (stringstartposName - x), l_optionName, color, 0, true); // UTF-8
+ g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(stringstartposName, y+height,dx- (stringstartposName - x), optionNameString.c_str(), color, 0, true); // UTF-8
g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(stringstartposOption, y+height,dx- (stringstartposOption - x), l_option, color, 0, true); // UTF-8
if (selected)
{
- CLCD::getInstance()->showMenuText(0, l_optionName, -1, true); // UTF-8
+ CLCD::getInstance()->showMenuText(0, optionNameString.c_str(), -1, true); // UTF-8
CLCD::getInstance()->showMenuText(1, l_option, -1, true); // UTF-8
}
Index: apps/tuxbox/neutrino/src/gui/widget/menue.h
===================================================================
RCS file: /cvs/tuxbox/apps/tuxbox/neutrino/src/gui/widget/menue.h,v
retrieving revision 1.70
diff -u -b -B -r1.70 menue.h
--- apps/tuxbox/neutrino/src/gui/widget/menue.h 2 Sep 2006 21:15:53 -0000 1.70
+++ apps/tuxbox/neutrino/src/gui/widget/menue.h 6 Jan 2007 01:24:48 -0000
@@ -224,9 +224,11 @@
const struct keyval * options;
unsigned number_of_options;
CChangeObserver * observ;
+ std::string optionNameString;
public:
CMenuOptionChooser(const neutrino_locale_t OptionName, int * const OptionValue, const struct keyval * const Options, const unsigned Number_Of_Options, const bool Active = false, CChangeObserver * const Observ = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const std::string & IconName= ""); // UTF-8
+ CMenuOptionChooser(const char* OptionName, int * const OptionValue, const struct keyval * const Options, const unsigned Number_Of_Options, const bool Active = false, CChangeObserver * const Observ = NULL, const neutrino_msg_t DirectKey = CRCInput::RC_nokey, const std::string & IconName= ""); // UTF-8
void setOptionValue(const int newvalue);
int getOptionValue(void) const;
Index: apps/tuxbox/neutrino/src/gui/widget/stringinput.cpp
===================================================================
RCS file: /cvs/tuxbox/apps/tuxbox/neutrino/src/gui/widget/stringinput.cpp,v
retrieving revision 1.84
diff -u -b -B -r1.84 stringinput.cpp
--- apps/tuxbox/neutrino/src/gui/widget/stringinput.cpp 29 Apr 2006 20:29:26 -0000 1.84
+++ apps/tuxbox/neutrino/src/gui/widget/stringinput.cpp 6 Jan 2007 01:24:49 -0000
@@ -494,9 +494,21 @@
paintChar(pos, value[pos]);
}
+CStringInputSMS::CStringInputSMS(const neutrino_locale_t Name, std::string* Value, int Size, const neutrino_locale_t Hint_1, const neutrino_locale_t Hint_2, const char * const Valid_Chars, CChangeObserver* Observ, const char * const Icon)
+ : CStringInput(Name, Value, Size, Hint_1, Hint_2, Valid_Chars, Observ, Icon)
+{
+ initSMS(Valid_Chars);
+}
+
+
CStringInputSMS::CStringInputSMS(const neutrino_locale_t Name, char* Value, int Size, const neutrino_locale_t Hint_1, const neutrino_locale_t Hint_2, const char * const Valid_Chars, CChangeObserver* Observ, const char * const Icon)
: CStringInput(Name, Value, Size, Hint_1, Hint_2, Valid_Chars, Observ, Icon)
{
+ initSMS(Valid_Chars);
+}
+
+void CStringInputSMS::initSMS(const char * const Valid_Chars)
+{
last_digit = -1; // no key pressed yet
const char CharList[10][11] = { "0 -_/()<>=", // 10 characters
"1.,:!?\\",
Index: apps/tuxbox/neutrino/src/gui/widget/stringinput.h
===================================================================
RCS file: /cvs/tuxbox/apps/tuxbox/neutrino/src/gui/widget/stringinput.h,v
retrieving revision 1.38
diff -u -b -B -r1.38 stringinput.h
--- apps/tuxbox/neutrino/src/gui/widget/stringinput.h 29 Apr 2006 20:29:26 -0000 1.38
+++ apps/tuxbox/neutrino/src/gui/widget/stringinput.h 6 Jan 2007 01:24:49 -0000
@@ -113,9 +113,11 @@
virtual void keyRightPressed();
virtual void paint();
+ void initSMS(const char * const Valid_Chars);
public:
CStringInputSMS(const neutrino_locale_t Name, char* Value, int Size, const neutrino_locale_t Hint_1, const neutrino_locale_t Hint_2, const char * const Valid_Chars, CChangeObserver* Observ = NULL, const char * const Icon = NULL);
+ CStringInputSMS(const neutrino_locale_t Name, std::string* Value, int Size, const neutrino_locale_t Hint_1, const neutrino_locale_t Hint_2, const char * const Valid_Chars, CChangeObserver* Observ = NULL, const char * const Icon = NULL);
};
class CPINInput : public CStringInput
Index: apps/tuxbox/neutrino/src/system/locals.h
===================================================================
RCS file: /cvs/tuxbox/apps/tuxbox/neutrino/src/system/locals.h,v
retrieving revision 1.77
diff -u -b -B -r1.77 locals.h
--- apps/tuxbox/neutrino/src/system/locals.h 11 Sep 2006 21:11:35 -0000 1.77
+++ apps/tuxbox/neutrino/src/system/locals.h 6 Jan 2007 01:24:51 -0000
@@ -302,6 +302,13 @@
LOCALE_EPGVIEWER_MORE_SCREENINGS,
LOCALE_EPGVIEWER_NODETAILED,
LOCALE_EPGVIEWER_NOTFOUND,
+ LOCALE_EVENTFINDER_HEAD,
+ LOCALE_EVENTFINDER_KEYWORD,
+ LOCALE_EVENTFINDER_START_SEARCH,
+ LOCALE_EVENTFINDER_SEARCH_WIHTIN_LIST,
+ LOCALE_EVENTFINDER_SEARCH_WIHTIN_EPG ,
+ LOCALE_EVENTFINDER_SEARCH,
+ LOCALE_EVENTFINDER_SEARCHING,
LOCALE_EVENTLISTBAR_CHANNELSWITCH,
LOCALE_EVENTLISTBAR_EVENTSORT,
LOCALE_EVENTLISTBAR_RECORDEVENT,
Index: apps/tuxbox/neutrino/src/system/locals_intern.h
===================================================================
RCS file: /cvs/tuxbox/apps/tuxbox/neutrino/src/system/locals_intern.h,v
retrieving revision 1.78
diff -u -b -B -r1.78 locals_intern.h
--- apps/tuxbox/neutrino/src/system/locals_intern.h 11 Sep 2006 21:11:35 -0000 1.78
+++ apps/tuxbox/neutrino/src/system/locals_intern.h 6 Jan 2007 01:24:53 -0000
@@ -302,6 +302,13 @@
"epgviewer.More_Screenings",
"epgviewer.nodetailed",
"epgviewer.notfound",
+ "eventfinder.head",
+ "eventfinder.keyword",
+ "eventfinder.start_search",
+ "eventfinder.search_wihtin_list",
+ "eventfinder.search_wihtin_epg",
+ "eventfinder.search",
+ "eventfinder.searching",
"eventlistbar.channelswitch",
"eventlistbar.eventsort",
"eventlistbar.recordevent",