From 66b32e5ddb4ed18ae134ac99bf0d70f2a998b7cf Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 5 Mar 2017 14:41:15 +0100 Subject: [PATCH 1/5] src/gui/widget/msgbox.cpp init result Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d5cf6527638b9c389e824418fb89f39dab8e0bd6 Author: Jacek Jendrzej Date: 2017-03-05 (Sun, 05 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/msgbox.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index bc364fd9f..28657be05 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -103,7 +103,8 @@ void CMsgBox::init(const int& Height, const int& ShowButtons, const msg_result_t //set result if (Default_result != mbrNone) result = default_result = Default_result; - + else + result = mbrNone; //add and initialize footer buttons with required buttons and basic properties if (ShowButtons > -1) mb_show_button = ShowButtons; From 589ffd92e530c7839b158f64a46381497077c0b0 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 5 Mar 2017 17:06:22 +0100 Subject: [PATCH 2/5] try fix YT cache wirite to root Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b3f69009af719c6a72c9db28d359095645eaefd8 Author: Jacek Jendrzej Date: 2017-03-05 (Sun, 05 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/movieinfo.cpp | 1 + src/system/ytcache.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index f06e68c9b..269d613f9 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -546,6 +546,7 @@ void MI_MOVIE_INFO::clear(void) marked = false; delAsk = true; + source = UNKNOWN; } bool CMovieInfo::loadFile(CFile &file, std::string &buffer) diff --git a/src/system/ytcache.cpp b/src/system/ytcache.cpp index 0f04358f4..66b52832d 100644 --- a/src/system/ytcache.cpp +++ b/src/system/ytcache.cpp @@ -70,7 +70,7 @@ std::string cYTCache::getName(MI_MOVIE_INFO *mi, std::string ext) case MI_MOVIE_INFO::NK: return g_settings.downloadcache_dir + "/nk-" + mi->ytid + "." + ext; default: - return ""; + return g_settings.downloadcache_dir + "/error-" + mi->ytid + "." + ext;; } } From 56ddedaa39b3938fe15bf2f332e57dce0b2dc0a0 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 4 Mar 2017 19:49:48 +0100 Subject: [PATCH 3/5] unbreak msgbox the "if (msg)" was basically always true, killing all keys that were not handled in this clause (e.g. it was not possible to switch the box from standby if a plugin with output was running during standby) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f9b7fca210978a90cadd9cbdfd5cd8b85e2b38cf Author: Stefan Seyfried Date: 2017-03-04 (Sat, 04 Mar 2017) ------------------ This commit was generated by Migit --- src/gui/widget/msgbox.cpp | 82 +++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 42 deletions(-) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 28657be05..12caa52ef 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -276,53 +276,51 @@ int CMsgBox::exec() { scroll_down(); } - else if (msg){ - //***navi buttons for button selection*** - if(msg==CRCInput::RC_right || msg==CRCInput::RC_left) - { - if(msg==CRCInput::RC_right){ - ccw_footer->setSelectedButton(selected+1); - mb_show_button = ccw_footer->getSelectedButtonObject()->getButtonAlias(); - } - if(msg==CRCInput::RC_left){ - ccw_footer->setSelectedButton(selected-1); - mb_show_button = ccw_footer->getSelectedButtonObject()->getButtonAlias(); - } - selected = ccw_footer->getSelectedButton(); + //***navi buttons for button selection*** + else if(msg == CRCInput::RC_right || msg == CRCInput::RC_left) + { + if (msg == CRCInput::RC_right) { + ccw_footer->setSelectedButton(selected+1); + mb_show_button = ccw_footer->getSelectedButtonObject()->getButtonAlias(); + } + if (msg == CRCInput::RC_left) { + ccw_footer->setSelectedButton(selected-1); + mb_show_button = ccw_footer->getSelectedButtonObject()->getButtonAlias(); + } + selected = ccw_footer->getSelectedButton(); - //***refresh buttons only if we have more than one button, this avoids unnecessary repaints with possible flicker effects*** - if (ccw_footer->getButtonChainObject()->size()>1) - refreshFoot(); + //***refresh buttons only if we have more than one button, this avoids unnecessary repaints with possible flicker effects*** + if (ccw_footer->getButtonChainObject()->size()>1) + refreshFoot(); - //***refresh timeout on any pressed navi key! This resets current timeout end to initial value*** - if (timeout > 0){ - timeout_pb->setValues(0, timeout); - timeoutEnd = CRCInput::calcTimeoutEnd(timeout); - } + //***refresh timeout on any pressed navi key! This resets current timeout end to initial value*** + if (timeout > 0) { + timeout_pb->setValues(0, timeout); + timeoutEnd = CRCInput::calcTimeoutEnd(timeout); + } + dprintf(DEBUG_INFO, "\033[32m[CMsgBox] [%s - %d] result = %d, mb_show_button = %d\033[0m\n", __func__, __LINE__, result, mb_show_button); + } + + //***action buttons without preselection*** + for (size_t i = 0; i< ccw_footer->getButtonChainObject()->size(); i++){ + CComponentsButton* btn_action = static_cast(ccw_footer->getButtonChainObject()->getCCItem(i)); + if (msg == btn_action->getButtonDirectKey() || msg == btn_action->getButtonDirectKeyA()){ + result = (msg_result_t)btn_action->getButtonResult(); dprintf(DEBUG_INFO, "\033[32m[CMsgBox] [%s - %d] result = %d, mb_show_button = %d\033[0m\n", __func__, __LINE__, result, mb_show_button); - } - - //***action buttons without preselection*** - for (size_t i = 0; i< ccw_footer->getButtonChainObject()->size(); i++){ - CComponentsButton* btn_action = static_cast(ccw_footer->getButtonChainObject()->getCCItem(i)); - if (msg == btn_action->getButtonDirectKey() || msg == btn_action->getButtonDirectKeyA()){ - result = (msg_result_t)btn_action->getButtonResult(); - dprintf(DEBUG_INFO, "\033[32m[CMsgBox] [%s - %d] result = %d, mb_show_button = %d\033[0m\n", __func__, __LINE__, result, mb_show_button); - loop = false; - } - } - //***action button ok with preselected button*** - if ((msg == CRCInput::RC_ok) && (ccw_footer->getSelectedButtonObject()->getButtonAlias() == mb_show_button)){ - result = (msg_result_t)ccw_footer->getSelectedButtonObject()->getButtonResult(); loop = false; } - else if (msg == NeutrinoMessages::RECORD_START || msg == NeutrinoMessages::RECORD_STOP) { - CNeutrinoApp::getInstance()->handleMsg(msg, data); - } - //***ignore*** - else if (CNeutrinoApp::getInstance()->listModeKey(msg)){ - // do nothing //TODO: if passed rc messages are ignored rc messaages: has no effect here too!! - } + } + //***action button ok with preselected button*** + if ((msg == CRCInput::RC_ok) && (ccw_footer->getSelectedButtonObject()->getButtonAlias() == mb_show_button)){ + result = (msg_result_t)ccw_footer->getSelectedButtonObject()->getButtonResult(); + loop = false; + } + else if (msg == NeutrinoMessages::RECORD_START || msg == NeutrinoMessages::RECORD_STOP) { + CNeutrinoApp::getInstance()->handleMsg(msg, data); + } + //***ignore*** + else if (CNeutrinoApp::getInstance()->listModeKey(msg)){ + // do nothing //TODO: if passed rc messages are ignored rc messaages: has no effect here too!! } else if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all) { From c7de70d0c7c42144803e5c2cc6b11c5c5e2b4885 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 4 Mar 2017 19:55:59 +0100 Subject: [PATCH 4/5] msgbox: remove duplicated code Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c3ab1b91d8f8f37db510106cb321d5c9a1c8cde0 Author: Stefan Seyfried Date: 2017-03-04 (Sat, 04 Mar 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/msgbox.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 12caa52ef..4bed64224 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -279,14 +279,11 @@ int CMsgBox::exec() //***navi buttons for button selection*** else if(msg == CRCInput::RC_right || msg == CRCInput::RC_left) { - if (msg == CRCInput::RC_right) { + if (msg == CRCInput::RC_right) ccw_footer->setSelectedButton(selected+1); - mb_show_button = ccw_footer->getSelectedButtonObject()->getButtonAlias(); - } - if (msg == CRCInput::RC_left) { + else ccw_footer->setSelectedButton(selected-1); - mb_show_button = ccw_footer->getSelectedButtonObject()->getButtonAlias(); - } + mb_show_button = ccw_footer->getSelectedButtonObject()->getButtonAlias(); selected = ccw_footer->getSelectedButton(); //***refresh buttons only if we have more than one button, this avoids unnecessary repaints with possible flicker effects*** From b504d299fd01381ac54648983dfb7c3892659eb4 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 4 Mar 2017 19:56:41 +0100 Subject: [PATCH 5/5] msgbox: remove explicit handling of record events these are handled in the last else clause anyway Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f80f69c232e4b5d0bfbed5b6f4c889b730154a22 Author: Stefan Seyfried Date: 2017-03-04 (Sat, 04 Mar 2017) ------------------ This commit was generated by Migit --- src/gui/widget/msgbox.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 4bed64224..48921105b 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -312,9 +312,6 @@ int CMsgBox::exec() result = (msg_result_t)ccw_footer->getSelectedButtonObject()->getButtonResult(); loop = false; } - else if (msg == NeutrinoMessages::RECORD_START || msg == NeutrinoMessages::RECORD_STOP) { - CNeutrinoApp::getInstance()->handleMsg(msg, data); - } //***ignore*** else if (CNeutrinoApp::getInstance()->listModeKey(msg)){ // do nothing //TODO: if passed rc messages are ignored rc messaages: has no effect here too!!