gui/moviebrowser: let page up/down handle search prev/next

Conflicts:
	src/gui/moviebrowser.cpp


Origin commit data
------------------
Commit: ba4b33ea67
Author: martii <m4rtii@gmx.de>
Date: 2013-08-22 (Thu, 22 Aug 2013)
This commit is contained in:
martii
2013-08-22 20:45:02 +02:00
committed by [CST] Focus
parent 71985710eb
commit e2aadf3918

View File

@@ -1722,6 +1722,7 @@ void CMovieBrowser::refreshTitle(void)
title = g_Locale->getText(LOCALE_MOVIEPLAYER_YTPLAYBACK); title = g_Locale->getText(LOCALE_MOVIEPLAYER_YTPLAYBACK);
title += " : "; title += " : ";
title += g_Locale->getText(getFeedLocale()); title += g_Locale->getText(getFeedLocale());
title += " \"" + m_settings.ytsearch + "\"";
} }
TRACE("[mb]->refreshTitle : %s\r\n", title.c_str()); TRACE("[mb]->refreshTitle : %s\r\n", title.c_str());
@@ -2046,27 +2047,55 @@ bool CMovieBrowser::onButtonPressBrowserList(neutrino_msg_t msg)
if(msg==CRCInput::RC_up) if(msg==CRCInput::RC_up)
{ {
m_pcBrowser->scrollLineUp(1); if (show_mode == MB_SHOW_YT && ytparser.HavePrev() && m_pcBrowser->getSelectedLine() == 0) {
CHintBox loadBox(LOCALE_MOVIEPLAYER_YTPLAYBACK, g_Locale->getText(LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES));
loadBox.paint();
ytparser.Cleanup();
loadYTitles(cYTFeedParser::PREV, m_settings.ytsearch, m_settings.ytvid);
loadBox.hide();
refreshBrowserList();
refreshMovieInfo();
} else
m_pcBrowser->scrollLineUp(1);
} }
else if (msg == CRCInput::RC_down) else if (msg == CRCInput::RC_down)
{ {
m_pcBrowser->scrollLineDown(1); if (show_mode == MB_SHOW_YT && ytparser.HaveNext() && m_pcBrowser->getSelectedLine() == m_pcBrowser->getLines() - 1) {
CHintBox loadBox(LOCALE_MOVIEPLAYER_YTPLAYBACK, g_Locale->getText(LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES));
loadBox.paint();
ytparser.Cleanup();
loadYTitles(cYTFeedParser::NEXT, m_settings.ytsearch, m_settings.ytvid);
loadBox.hide();
refreshBrowserList();
refreshMovieInfo();
} else
m_pcBrowser->scrollLineDown(1);
} }
else if (msg == (neutrino_msg_t)g_settings.key_pageup) else if ((msg == (neutrino_msg_t)g_settings.key_pageup) || (msg == CRCInput::RC_left))
{ {
m_pcBrowser->scrollPageUp(1); if (show_mode == MB_SHOW_YT && ytparser.HavePrev() && m_pcBrowser->getSelectedLine() == 0) {
CHintBox loadBox(LOCALE_MOVIEPLAYER_YTPLAYBACK, g_Locale->getText(LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES));
loadBox.paint();
ytparser.Cleanup();
loadYTitles(cYTFeedParser::PREV, m_settings.ytsearch, m_settings.ytvid);
loadBox.hide();
refreshBrowserList();
refreshMovieInfo();
} else
m_pcBrowser->scrollPageUp(1);
} }
else if (msg == (neutrino_msg_t)g_settings.key_pagedown) else if ((msg == (neutrino_msg_t)g_settings.key_pagedown) || (msg == CRCInput::RC_right))
{ {
m_pcBrowser->scrollPageDown(1); if (show_mode == MB_SHOW_YT && ytparser.HaveNext() && m_pcBrowser->getSelectedLine() == m_pcBrowser->getLines() - 1) {
} CHintBox loadBox(LOCALE_MOVIEPLAYER_YTPLAYBACK, g_Locale->getText(LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES));
else if (msg == CRCInput::RC_left) loadBox.paint();
{ ytparser.Cleanup();
m_pcBrowser->scrollPageUp(1); loadYTitles(cYTFeedParser::NEXT, m_settings.ytsearch, m_settings.ytvid);
} loadBox.hide();
else if (msg == CRCInput::RC_right) refreshBrowserList();
{ refreshMovieInfo();
m_pcBrowser->scrollPageDown(1); } else
m_pcBrowser->scrollPageDown(1);
} }
else if (msg == CRCInput::RC_play) else if (msg == CRCInput::RC_play)
{ {
@@ -3944,11 +3973,6 @@ bool CMovieBrowser::showYTMenu()
sprintf(cnt, "%d", cYTFeedParser::RELATED); sprintf(cnt, "%d", cYTFeedParser::RELATED);
mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_YT_RELATED, enabled, NULL, selector, cnt, CRCInput::RC_red)); mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_YT_RELATED, enabled, NULL, selector, cnt, CRCInput::RC_red));
sprintf(cnt, "%d", cYTFeedParser::NEXT);
mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_YT_NEXT_RESULTS, ytparser.HaveNext(), NULL, selector, cnt, CRCInput::RC_green));
sprintf(cnt, "%d", cYTFeedParser::PREV);
mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_YT_PREV_RESULTS, ytparser.HavePrev(), NULL, selector, cnt, CRCInput::RC_nokey, ""));
mainMenu.addItem(GenericMenuSeparatorLine); mainMenu.addItem(GenericMenuSeparatorLine);
std::string search = m_settings.ytsearch; std::string search = m_settings.ytsearch;
@@ -4015,10 +4039,7 @@ bool CMovieBrowser::showYTMenu()
int newmode = -1; int newmode = -1;
if (select >= 0) { if (select >= 0) {
newmode = select; newmode = select;
if (newmode == cYTFeedParser::NEXT || newmode == cYTFeedParser::PREV) { if (select == cYTFeedParser::RELATED) {
reload = true;
}
else if (select == cYTFeedParser::RELATED) {
if (m_settings.ytvid != m_movieSelectionHandler->ytid) { if (m_settings.ytvid != m_movieSelectionHandler->ytid) {
printf("get related for: %s\n", m_movieSelectionHandler->ytid.c_str()); printf("get related for: %s\n", m_movieSelectionHandler->ytid.c_str());
m_settings.ytvid = m_movieSelectionHandler->ytid; m_settings.ytvid = m_movieSelectionHandler->ytid;