From 3f34ab5877cae6b9d78c4bdcfd734272aeb19c3c Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Thu, 30 Sep 2021 22:56:15 +0200 Subject: [PATCH] - change some hintboxes Conflicts: src/neutrino.cpp Signed-off-by: Thilo Graf I'm not enthused of this solution to misuse the CHint destructor since commit 1cb25e7cd378f82e55120c5993114223d8832a97 "- hintbox: add setDelay() prototype". I think such tasks with delay impact are not the designation of destructors and avoidable. Unless it is absolutely necessary. Therefore, I think this is only a temporary solution. --- src/gui/miscsettings_menu.cpp | 4 ++-- src/gui/moviebrowser/mb.cpp | 20 ++++++++++++-------- src/neutrino.cpp | 2 +- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index 417aa053d..8bee67308 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -91,7 +91,7 @@ int CMiscMenue::exec(CMenuTarget* parent, const std::string &actionKey) { printf("init extended settings menu...\n"); - if(parent != NULL) + if ((parent != NULL) && (actionKey.find("epg_read_now") == std::string::npos)) parent->hide(); if(actionKey == "epgdir") @@ -164,6 +164,7 @@ int CMiscMenue::exec(CMenuTarget* parent, const std::string &actionKey) else if(actionKey == "epg_read_now" || actionKey == "epg_read_now_usermenu") { CHint *hint = new CHint(LOCALE_MISCSETTINGS_EPG_READ); + hint->setDelay(1); hint->paint(); struct stat my_stat; @@ -179,7 +180,6 @@ int CMiscMenue::exec(CMenuTarget* parent, const std::string &actionKey) g_Sectionsd->readSIfromXMLTV((*it).c_str()); } - sleep(1); // small delay for very fast hardware delete hint; if (actionKey == "epg_read_now_usermenu") diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 7a4a2d719..2dc58caf2 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -886,11 +886,13 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) } else if (actionKey == "save_movie_info") { - CHintBox loadBox(LOCALE_MOVIEBROWSER_HEAD,g_Locale->getText(LOCALE_MOVIEBROWSER_MENU_SAVE)); - loadBox.paint(); + CHint *loadBox = new CHint(LOCALE_MOVIEBROWSER_MENU_SAVE); + loadBox->setDelay(1); + loadBox->paint(); + m_movieInfo.saveMovieInfo(*m_movieSelectionHandler); - sleep(1); // small delay for very fast hardware - loadBox.hide(); + + delete loadBox; } else if (actionKey == "save_movie_info_all") { @@ -903,8 +905,10 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) if (current_list == NULL || m_movieSelectionHandler == NULL) return returnval; - CHintBox loadBox(LOCALE_MOVIEBROWSER_HEAD,g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_HEAD_UPDATE)); - loadBox.paint(); + CHint *loadBox = new CHint(LOCALE_MOVIEBROWSER_INFO_HEAD_UPDATE); + loadBox->setDelay(1); + loadBox->paint(); + for (unsigned int i = 0; i< current_list->size();i++) { if (!((*current_list)[i]->parentalLockAge != 0 && movieInfoUpdateAllIfDestEmptyOnly == true) && @@ -933,8 +937,8 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) m_movieInfo.saveMovieInfo(*((*current_list)[i])); } - sleep(1); // small delay for very fast hardware - loadBox.hide(); + + delete loadBox; } else if (actionKey == "reload_movie_info") { diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 63d456461..8abd88772 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -5384,6 +5384,7 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) else if (actionKey=="savesettings") { CHint *hint = new CHint(LOCALE_MAINSETTINGS_SAVESETTINGSNOW_HINT); + hint->setDelay(1); hint->paint(); saveSetup(NEUTRINO_SETTINGS_FILE); @@ -5396,7 +5397,6 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) //g_Sectionsd->setEventsAreOldInMinutes((unsigned short) (g_settings.epg_old_hours*60)); //g_Sectionsd->setHoursToCache((unsigned short) (g_settings.epg_cache_days*24)); - sleep(1); // small delay for very fast hardware delete hint; } else if (actionKey=="recording") {