diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 5cc9085b5..172419468 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -196,6 +196,10 @@ int CHintBox::exec() neutrino_msg_t msg; neutrino_msg_data_t data; int res = messages_return::none; + + if (timeout == NO_TIMEOUT || timeout == 0) + timeout = HINTBOX_DEFAULT_TIMEOUT; + uint64_t timeoutEnd = CRCInput::calcTimeoutEnd( timeout ); if (timeout > 0) diff --git a/src/gui/widget/hintbox.h b/src/gui/widget/hintbox.h index 641bb6411..310aeb8b2 100644 --- a/src/gui/widget/hintbox.h +++ b/src/gui/widget/hintbox.h @@ -35,7 +35,8 @@ #define HINTBOX_MIN_WIDTH 420 #define HINTBOX_MIN_HEIGHT 125 #define HINTBOX_MAX_HEIGHT 520 -#define HINTBOX_DEFAULT_TIMEOUT 5 +#define HINTBOX_DEFAULT_TIMEOUT g_settings.timing[SNeutrinoSettings::TIMING_POPUP_MESSAGES] +#define NO_TIMEOUT -1 //frame around hint container as indent #define W_FRAME std::max(HINTBOX_MIN_WIDTH, HINTBOX_MIN_HEIGHT) * 2/100 //frame color around hint/message box @@ -328,7 +329,7 @@ class CHint : public CHintBox * Simplified methodes to show hintboxes without titlebar and footer * Text is UTF-8 encoded * @param[in] timeout -* @li optional: exepts type int as seconds, default = HINTBOX_DEFAULT_TIMEOUT (5 sec) +* @li optional: exepts type int as seconds, default = HINTBOX_DEFAULT_TIMEOUT (get from settings) * @param[in] show_background * @li optional: exepts type bool, enable/disable backround paint, default = true * @see for possible text parameters take a look to CHintBox() diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 567780794..a8bc796fd 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -236,6 +236,9 @@ int CMsgBox::exec() ccw_footer->getSelectedButtonObject()->setButtonAlias(mb_show_button); int selected = ccw_footer->getSelectedButton(); + if (timeout == NO_TIMEOUT) + timeout = 0; + uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(timeout); if (timeout > 0) @@ -432,7 +435,7 @@ int ShowMsg2UTF( const neutrino_locale_t Title, const int& Text_mode, fb_pixel_t color_frame) { - int result = ShowMsg( g_Locale->getText(Title), Text, Default, ShowButtons, Icon, Width, Timeout, returnDefaultOnTimeout, Text_mode, color_frame); + int result = ShowMsg2UTF(g_Locale->getText(Title), Text, Default, ShowButtons, Icon, Width, Timeout, returnDefaultOnTimeout, Text_mode, color_frame); return (result); } diff --git a/src/gui/widget/msgbox.h b/src/gui/widget/msgbox.h index 028bba5d5..cd0fd2a44 100644 --- a/src/gui/widget/msgbox.h +++ b/src/gui/widget/msgbox.h @@ -321,7 +321,7 @@ int ShowMsg2UTF( const neutrino_locale_t Title, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = MSGBOX_MIN_WIDTH, - const int Timeout = -1, + const int Timeout = NO_TIMEOUT, bool returnDefaultOnTimeout = false, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = HINTBOX_DEFAULT_FRAME_COLOR); // UTF-8 @@ -332,7 +332,7 @@ int ShowMsg2UTF( const char * const Title, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = MSGBOX_MIN_WIDTH, - const int Timeout = -1, + const int Timeout = NO_TIMEOUT, bool returnDefaultOnTimeout = false, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = HINTBOX_DEFAULT_FRAME_COLOR); // UTF-8 @@ -343,7 +343,7 @@ int ShowMsg( const neutrino_locale_t Title, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = MSGBOX_MIN_WIDTH, - const int Timeout = -1, + const int Timeout = NO_TIMEOUT, bool returnDefaultOnTimeout = false, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = HINTBOX_DEFAULT_FRAME_COLOR); // UTF-8 @@ -354,7 +354,7 @@ int ShowMsg( const char * const Title, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = MSGBOX_MIN_WIDTH, - const int Timeout = -1, + const int Timeout = NO_TIMEOUT, bool returnDefaultOnTimeout = false, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = HINTBOX_DEFAULT_FRAME_COLOR); // UTF-8 @@ -365,7 +365,7 @@ int ShowMsg( const neutrino_locale_t Title, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = MSGBOX_MIN_WIDTH, - const int Timeout = -1, + const int Timeout = NO_TIMEOUT, bool returnDefaultOnTimeout = false, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = HINTBOX_DEFAULT_FRAME_COLOR); // UTF-8 @@ -376,7 +376,7 @@ int ShowMsg( const neutrino_locale_t Title, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = MSGBOX_MIN_WIDTH, - const int Timeout = -1, + const int Timeout = NO_TIMEOUT, bool returnDefaultOnTimeout = false, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = HINTBOX_DEFAULT_FRAME_COLOR); // UTF-8 @@ -387,7 +387,7 @@ int ShowMsg( const std::string & Title, const uint32_t ShowButtons, const char * const Icon = NULL, const int Width = MSGBOX_MIN_WIDTH, - const int Timeout = -1, + const int Timeout = NO_TIMEOUT, bool returnDefaultOnTimeout = false, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = HINTBOX_DEFAULT_FRAME_COLOR); // UTF-8 diff --git a/src/neutrino.cpp b/src/neutrino.cpp index c6bc48e70..a4eae6220 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3350,7 +3350,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) } else if (msg == NeutrinoMessages::EVT_POPUP || msg == NeutrinoMessages::EVT_EXTMSG) { if (mode != mode_scart && mode != mode_standby) { - int timeout = HINTBOX_DEFAULT_TIMEOUT; + int timeout = NO_TIMEOUT; std::string text = (char*)data; std::string::size_type pos; diff --git a/src/system/locals.h b/src/system/locals.h index b29341ef7..5621aa1e5 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -2433,6 +2433,7 @@ typedef enum LOCALE_TIMING_INFOBAR_RADIO, LOCALE_TIMING_MENU, LOCALE_TIMING_NUMERICZAP, + LOCALE_TIMING_POPUP_MESSAGES, LOCALE_TIMING_VOLUMEBAR, LOCALE_TMDB_API_KEY, LOCALE_TMDB_ENABLED, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index bf61c27ac..875066c28 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -2433,6 +2433,7 @@ const char * locale_real_names[] = "timing.infobar_radio", "timing.menu", "timing.numericzap", + "timing.popup_messages", "timing.volumebar", "tmdb.api_key", "tmdb.enabled", diff --git a/src/system/settings.h b/src/system/settings.h index 359bbd4af..fbb47ee6e 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -405,6 +405,7 @@ struct SNeutrinoSettings TIMING_VOLUMEBAR = 6, TIMING_FILEBROWSER = 7, TIMING_NUMERICZAP = 8, + TIMING_POPUP_MESSAGES = 9, TIMING_SETTING_COUNT }; @@ -873,7 +874,8 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO { 6, LOCALE_TIMING_INFOBAR_MOVIEPLAYER}, { 3, LOCALE_TIMING_VOLUMEBAR }, { 60, LOCALE_TIMING_FILEBROWSER }, - { 3, LOCALE_TIMING_NUMERICZAP } + { 3, LOCALE_TIMING_NUMERICZAP }, + { 6, LOCALE_TIMING_POPUP_MESSAGES} }; // lcdd