CMenueWidget: add overloaded version of addIntroItems()

Allows additional usage of strings as text parameter.


Origin commit data
------------------
Branch: ni/coolstream
Commit: 167531e412
Author: Thilo Graf <dbt@novatux.de>
Date: 2019-03-30 (Sat, 30 Mar 2019)



------------------
This commit was generated by Migit
This commit is contained in:
2019-03-30 00:06:26 +01:00
committed by vanhofen
parent d79e52e849
commit 79276c81eb
2 changed files with 11 additions and 4 deletions

View File

@@ -1486,12 +1486,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);
@@ -1514,6 +1514,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)

View File

@@ -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);