diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 7810cef1f..8f097885e 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1302,7 +1302,7 @@ void CMoviePlayerGui::quickZap(neutrino_msg_t msg) if ((msg == CRCInput::RC_right) || msg == (neutrino_msg_t) g_settings.key_quickzap_up) { //printf("CMoviePlayerGui::%s: CRCInput::RC_right or g_settings.key_quickzap_up\n", __func__); - if (isLuaPlay) + if (isLuaPlay || isUPNP) { playstate = CMoviePlayerGui::STOPPED; keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_NEXT; @@ -1329,7 +1329,7 @@ void CMoviePlayerGui::quickZap(neutrino_msg_t msg) else if ((msg == CRCInput::RC_left) || msg == (neutrino_msg_t) g_settings.key_quickzap_down) { //printf("CMoviePlayerGui::%s: CRCInput::RC_left or g_settings.key_quickzap_down\n", __func__); - if (isLuaPlay) + if (isLuaPlay || isUPNP) { playstate = CMoviePlayerGui::STOPPED; keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_PREV; diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index a2dfa2f32..790e18a8b 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -1121,9 +1121,12 @@ int CTestMenu::showTestMenu() w_test.setFooter(footerButtons, 2); w_test.addKey(CRCInput::RC_red, this, "footer_key"); w_test.addKey(CRCInput::RC_green, this, "footer_key"); - + int res = w_test.exec(NULL, ""); + delete w_hw; + delete w_cc; + delete w_msg; //exit - return w_test.exec(NULL, "");; + return res; } void CTestMenu::showCCTests(CMenuWidget *widget) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index bd9faabb8..13f2916ef 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -315,6 +315,8 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) remotebox_user.forceSaveScreen(true); CKeyboardInput remotebox_pass(LOCALE_REMOTEBOX_PASS, &pass, 15); remotebox_pass.forceSaveScreen(true); + + //menu add remote box CMenuWidget * rbsetup = new CMenuWidget(LOCALE_REMOTEBOX_HEAD, NEUTRINO_ICON_TIMER); rbsetup->addItem(new CMenuForwarder(LOCALE_REMOTEBOX_RBNAME, true, rbname, &remotebox_name)); rbsetup->addItem(new CMenuForwarder(LOCALE_REMOTEBOX_RBADDR, true, rbaddress, &remotebox_address)); @@ -325,8 +327,6 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) if ((rbsetup->exec(NULL,"") == true) && (!rbaddress.empty())) { remboxmenu->addItem(new CMenuForwarder(rbname, true, NULL, this, "cha_ip")); - rbsetup->hide(); - remboxmenu->enableSaveScreen(false); remboxmenu->hide(); timer_remotebox_item timer_rb; timer_rb.rbaddress = rbaddress; @@ -377,6 +377,8 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) remotebox_user.forceSaveScreen(true); CKeyboardInput remotebox_pass(LOCALE_REMOTEBOX_PASS, &it->pass, 15); remotebox_pass.forceSaveScreen(true); + + //remote box edit CMenuWidget * rbsetup = new CMenuWidget(LOCALE_REMOTEBOX_HEAD, NEUTRINO_ICON_TIMER); rbsetup->addItem(new CMenuForwarder(LOCALE_REMOTEBOX_RBNAME, true, it->rbname, &remotebox_name)); rbsetup->addItem(new CMenuForwarder(LOCALE_REMOTEBOX_RBADDR, true, it->rbaddress, &remotebox_address)); @@ -388,8 +390,6 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) { it->port = atoi(port); f->setName(it->rbname); - rbsetup->hide(); - remboxmenu->enableSaveScreen(false); remboxmenu->hide(); changed = true; } @@ -1097,7 +1097,7 @@ void CTimerList::hide() bool CTimerList::RemoteBoxSetup() { bool ret = false; - remboxmenu = new CMenuWidget(LOCALE_REMOTEBOX_HEAD, NEUTRINO_ICON_TIMER); + remboxmenu = new CMenuWidget(LOCALE_REMOTEBOX_HEAD, NEUTRINO_ICON_TIMER, 50); remboxmenu->addKey(CRCInput::RC_red, this, "del_ip"); remboxmenu->addKey(CRCInput::RC_green, this, "add_ip"); diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 2f31d4709..ba7c1ffd5 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -159,6 +159,8 @@ void CUpnpBrowserGui::Init() m_item_y = m_header_y + m_header_height; m_footer_y = m_item_y + (m_listmaxshow * m_item_height); m_infobox_y = m_footer_y + m_footer_height + OFFSET_SHADOW + OFFSET_INTER; + video_key_msg = CMoviePlayerGui::PLUGIN_PLAYSTATE_NORMAL; + } CUpnpBrowserGui::~CUpnpBrowserGui() @@ -297,15 +299,13 @@ bool CUpnpBrowserGui::getResults(std::string id, unsigned int start, unsigned in std::vector *CUpnpBrowserGui::decodeResult(std::string result) { xmlNodePtr root, node, snode; - std::vector *entries; - xmlDocPtr parser = parseXml(result.c_str(),"UTF-8"); root = xmlDocGetRootElement(parser); if (!root) { xmlFreeDoc(parser); return NULL; } - entries = new std::vector; + std::vector *entries = new std::vector; for (node=xmlChildrenNode(root); node; node=xmlNextNode(node)) { @@ -558,6 +558,7 @@ void CUpnpBrowserGui::selectDevice() { m_folderplay = false; selectItem("0"); + m_frameBuffer->Clear(); refresh=true; } else if (msg == CRCInput::RC_blue) @@ -638,17 +639,27 @@ void CUpnpBrowserGui::playnext(void) playAudio((*entries)[0].resources[preferred].url, (*entries)[0].type); } else if (mime.substr(0,6) == "video/") { + m_frameBuffer->Clear(); + m_folderplay = true; playVideo((*entries)[0].title, (*entries)[0].resources[preferred].url); - m_folderplay = false; // FIXME else no way to stop in video folder } else if (mime.substr(0,6) == "image/") { if (m_folderplay) timeout = time(NULL) + g_settings.picviewer_slide_time; showPicture((*entries)[0].resources[preferred].url); } + delete entries; + entries = NULL; return; + }else{ + delete entries; + entries = NULL; } } else { + if(entries){ + delete entries; + entries = NULL; + } neutrino_msg_t msg; neutrino_msg_data_t data; g_RCInput->getMsg(&msg, &data, 10); // 1 sec timeout to update play/stop state display @@ -660,7 +671,10 @@ void CUpnpBrowserGui::playnext(void) } } } - delete entries; + if(entries){ + delete entries; + entries = NULL; + } m_frameBuffer->Clear(); } @@ -692,9 +706,13 @@ bool CUpnpBrowserGui::getItems(std::string id, unsigned int index, std::vectorsize() || returned == 0) + if (!entries || !nfound || !tfound || !rfound || returned != entries->size() || returned == 0){ + if(entries){ + delete entries; + entries = NULL; + } return false; - + } return true; } @@ -732,6 +750,7 @@ bool CUpnpBrowserGui::selectItem(std::string id) unsigned int liststart = 0; unsigned int selected = 0; unsigned int total = 0; + video_key_msg = CMoviePlayerGui::PLUGIN_PLAYSTATE_NORMAL; printf("selectItem: [%s]\n", id.c_str()); if (!getItems(id, liststart, entries, total)) @@ -863,19 +882,22 @@ bool CUpnpBrowserGui::selectItem(std::string id) m_folderplay = false; stopAudio(); } - else if (m_folderplay && msg == (neutrino_msg_t) CRCInput::RC_stop) { + else if (m_folderplay && (msg == (neutrino_msg_t) CRCInput::RC_stop + || video_key_msg == CMoviePlayerGui::PLUGIN_PLAYSTATE_STOP + || video_key_msg == CMoviePlayerGui::PLUGIN_PLAYSTATE_LEAVE_ALL)){ timeout = 0; m_folderplay = false; m_frameBuffer->Clear(); refresh = true; } - else if (m_folderplay && msg == (neutrino_msg_t) CRCInput::RC_prev) { + else if (m_folderplay && ((msg == (neutrino_msg_t) CRCInput::RC_prev) || video_key_msg == CMoviePlayerGui::PLUGIN_PLAYSTATE_PREV)){ timeout = 0; m_playid -= 2; if (m_playid < 0) m_playid = 0; } - else if (m_folderplay && msg == (neutrino_msg_t) CRCInput::RC_next) { + else if (m_folderplay && (msg == (neutrino_msg_t) CRCInput::RC_next + || video_key_msg == CMoviePlayerGui::PLUGIN_PLAYSTATE_NEXT)){ timeout = 0; stopAudio(); } @@ -921,6 +943,7 @@ bool CUpnpBrowserGui::selectItem(std::string id) #endif delete entries; + entries = NULL; timeout = 0; return endall; @@ -1232,8 +1255,11 @@ void CUpnpBrowserGui::paintDetails(UPnPEntry *entry, bool use_playing) void CUpnpBrowserGui::paintItem2DetailsLine(int pos) { if (pos < 0){ - if (dline) + if (dline){ dline->kill(); + infobox.kill(); + timebox.kill(); + } return; } @@ -1324,6 +1350,7 @@ void CUpnpBrowserGui::playVideo(std::string name, std::string url) m_frameBuffer->stopFrame(); CMoviePlayerGui::getInstance().SetFile(name, url); CMoviePlayerGui::getInstance().exec(NULL, "upnp"); + video_key_msg = CMoviePlayerGui::getInstance().getKeyPressed(); CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoMessages::mode_upnp | NeutrinoMessages::norezap); } diff --git a/src/gui/upnpbrowser.h b/src/gui/upnpbrowser.h index eff6326ad..758613cc0 100644 --- a/src/gui/upnpbrowser.h +++ b/src/gui/upnpbrowser.h @@ -96,6 +96,7 @@ class CUpnpBrowserGui : public CMenuTarget, public CListHelpers time_t m_time_played; bool m_playing_entry_is_shown; time_t timeout; + int video_key_msg; CComponentsDetailsLine * dline; CComponentsFooter footer; CComponentsInfoBox topbox, infobox, timebox; diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 31711bea6..8e8ae3412 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1487,10 +1487,8 @@ void CMenuWidget::enableSaveScreen(bool enable) void CMenuWidget::paintHint(int pos) { - if (!g_settings.show_menu_hints){ - //ResetModules(); //ensure clean up on changed setting + if (!g_settings.show_menu_hints) return; - } if (pos < 0 && !hint_painted) return;