From 4440ec9f97b105d222278c7aa09e7e8d396dfd5c Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Sat, 17 Sep 2022 22:33:29 +0200 Subject: [PATCH] - moviebrowser: restore last mode to allow tv/radio while copying, cutting and truncating Signed-off-by: Thilo Graf --- src/gui/moviebrowser/mb.cpp | 38 ++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index f12ff19f4..f73caac36 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -978,8 +978,18 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) hintBox.hide(); framebuffer->paintBackground(); // clear screen + + // restore last mode to allow tv/radio while copying + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, m_LastMode); + + // TODO: signalize running action CMovieCut mc; bool res = mc.copyMovie(m_movieSelectionHandler, onefile); + + // tell neutrino we're in moviebrowser mode again + m_LastMode = CNeutrinoApp::getInstance()->getMode(); + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoModes::mode_moviebrowser | NeutrinoModes::norezap); + //g_RCInput->clearRCMsg(); if (res == 0) ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_MOVIEBROWSER_COPY_FAILED, CMsgBox::mbrCancel, CMsgBox::mbCancel, NEUTRINO_ICON_ERROR); @@ -1003,8 +1013,18 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) hintBox.hide(); framebuffer->paintBackground(); // clear screen + + // restore last mode to allow tv/radio while cutting + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, m_LastMode); + + // TODO: signalize running action CMovieCut mc; bool res = mc.cutMovie(m_movieSelectionHandler); + + // tell neutrino we're in moviebrowser mode again + m_LastMode = CNeutrinoApp::getInstance()->getMode(); + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoModes::mode_moviebrowser | NeutrinoModes::norezap); + //g_RCInput->clearRCMsg(); if (!res) ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_MOVIEBROWSER_CUT_FAILED, CMsgBox::mbrCancel, CMsgBox::mbCancel, NEUTRINO_ICON_ERROR); @@ -1027,11 +1047,23 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) { CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_TRUNCATING); hintBox.paint(); - CMovieCut mc; - bool res = mc.truncateMovie(m_movieSelectionHandler); + sleep(1); //??? hintBox.hide(); - g_RCInput->clearRCMsg(); + framebuffer->paintBackground(); // clear screen + + // restore last mode to allow tv/radio while truncating + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, m_LastMode); + + // TODO: signalize running action + CMovieCut mc; + bool res = mc.truncateMovie(m_movieSelectionHandler); + + // tell neutrino we're in moviebrowser mode again + m_LastMode = CNeutrinoApp::getInstance()->getMode(); + CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoModes::mode_moviebrowser | NeutrinoModes::norezap); + + //g_RCInput->clearRCMsg(); if (!res) ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_MOVIEBROWSER_TRUNCATE_FAILED, CMsgBox::mbrCancel, CMsgBox::mbCancel, NEUTRINO_ICON_ERROR); else