From c52e82a5b2a2e9daa9b9c71b50f41dbff15fb727 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 7 Mar 2023 23:20:43 +0100 Subject: [PATCH] widget/msgbox: add overloaded version of setButtonText() Allows usage of locale as parameter. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/820f1986f2e0d6ed520b5b3081d6900587ddb079 Author: Thilo Graf Date: 2023-03-07 (Tue, 07 Mar 2023) --- src/gui/widget/msgbox.cpp | 7 ++++++- src/gui/widget/msgbox.h | 14 +++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 99c858c93..4f699096f 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -7,7 +7,7 @@ Günther@tuxbox.berlios.org Implementation of CComponent Window class. - Copyright (C) 2014-2017 Thilo Graf 'dbt' + Copyright (C) 2014-2017, 2023 Thilo Graf 'dbt' License: GPL @@ -419,6 +419,11 @@ void CMsgBox::setButtonText(const int& showed_button, const std::string& text) initButtons(); } +void CMsgBox::setButtonText(const int &showed_button, const neutrino_locale_t &Locale) +{ + setButtonText(showed_button, g_Locale->getText(Locale)); +} + inline std::string CMsgBox::BTN_TEXT(const int& showed_button) { string ret = ""; diff --git a/src/gui/widget/msgbox.h b/src/gui/widget/msgbox.h index 0134323c5..744dab14b 100644 --- a/src/gui/widget/msgbox.h +++ b/src/gui/widget/msgbox.h @@ -328,7 +328,19 @@ class CMsgBox : public CHintBox * @param[in] text * @li expects type std::string, sets the new text for button */ - void setButtonText(const int& showed_button, const std::string& text); + void setButtonText(const int &showed_button, const std::string &text); + + /** + * Default defined button text is already predefiend with parameter 'ShowButtons' from constructor. + * This member allows to define an alternate text for an already defined button, + * Result values are not touched! + * @param[in] showed_button + * @li expects type int + * @see setShowedButtons() + * @param[in] text + * @li expects type neutrino_locale_t, sets the new text for button + */ + void setButtonText(const int &showed_button, const neutrino_locale_t &Locale); /** * enables background of buttons