diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 693b6285f..77db63148 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1491,12 +1491,12 @@ void CMenuWidget::paintItems() } /*adds the typical menu intro with optional subhead, separator, back or cancel button and separatorline to menu*/ -void CMenuWidget::addIntroItems(neutrino_locale_t subhead_text, neutrino_locale_t section_text, int buttontype, bool brief_hint) +void CMenuWidget::addIntroItems(const std::string& s_subhead_text, neutrino_locale_t section_text, int buttontype, bool brief_hint) { brief_hints = brief_hint; - if (subhead_text != NONEXISTANT_LOCALE) - addItem(new CMenuSeparator(CMenuSeparator::ALIGN_LEFT | CMenuSeparator::SUB_HEAD | CMenuSeparator::STRING, subhead_text)); + if (!s_subhead_text.empty()) + addItem(new CMenuSeparator(CMenuSeparator::ALIGN_LEFT | CMenuSeparator::SUB_HEAD | CMenuSeparator::STRING, s_subhead_text)); addItem(GenericMenuSeparator); @@ -1519,6 +1519,12 @@ void CMenuWidget::addIntroItems(neutrino_locale_t subhead_text, neutrino_locale_ addItem(GenericMenuSeparatorLine); } +void CMenuWidget::addIntroItems(neutrino_locale_t l_subhead_text, neutrino_locale_t section_text, int buttontype, bool brief_hint) +{ + std::string str = l_subhead_text == NONEXISTANT_LOCALE ? "" : g_Locale->getText(l_subhead_text); + addIntroItems(str, section_text, buttontype, brief_hint); +} + void CMenuWidget::saveScreen() { if(!savescreen) diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index 4af27c829..318742607 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -630,7 +630,8 @@ class CMenuWidget : public CMenuTarget, public CComponentsSignals BRIEF_HINT_NO = 0, BRIEF_HINT_YES = 1 }; - virtual void addIntroItems(neutrino_locale_t subhead_text = NONEXISTANT_LOCALE, neutrino_locale_t section_text = NONEXISTANT_LOCALE, int buttontype = BTN_TYPE_BACK, bool brief_hint = BRIEF_HINT_NO); + void addIntroItems(neutrino_locale_t l_subhead_text = NONEXISTANT_LOCALE, neutrino_locale_t section_text = NONEXISTANT_LOCALE, int buttontype = BTN_TYPE_BACK, bool brief_hint = BRIEF_HINT_NO); + void addIntroItems(const std::string& s_subhead_text, neutrino_locale_t section_text = NONEXISTANT_LOCALE, int buttontype = BTN_TYPE_BACK, bool brief_hint = BRIEF_HINT_NO); bool hasItem(); void resetWidget(bool delete_items = false); void insertItem(const uint& item_id, CMenuItem* menuItem);