diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index d7b1be5ab..6dadde798 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -2000,24 +2000,29 @@ int CMenuOptionChooser::getWidth(void) //------------------------------------------------------------------------------------------------------------------------------- -CMenuOptionStringChooser::CMenuOptionStringChooser(const neutrino_locale_t OptionName, std::string* OptionValue, bool Active, CChangeObserver* Observ, - const neutrino_msg_t DirectKey, const char * const IconName, bool Pulldown) - : CMenuItem(Active, DirectKey, IconName) +CMenuOptionStringChooser::CMenuOptionStringChooser( const neutrino_locale_t OptionName, std::string* OptionValue, bool Active, CChangeObserver* Observ, + const neutrino_msg_t DirectKey, const char * const IconName, bool Pulldown) + : CMenuItem(Active, DirectKey, IconName) { - nameString = ""; - name = OptionName; - optionValuePtr = OptionValue ? OptionValue : &optionValue; - observ = Observ; - pulldown = Pulldown; + init("", OptionName, OptionValue, Observ, Pulldown); } -CMenuOptionStringChooser::CMenuOptionStringChooser(const std::string &OptionName, std::string* OptionValue, bool Active, CChangeObserver* Observ, - const neutrino_msg_t DirectKey, const char * const IconName, bool Pulldown) - : CMenuItem(Active, DirectKey, IconName) +CMenuOptionStringChooser::CMenuOptionStringChooser( const std::string &OptionName, std::string* OptionValue, bool Active, CChangeObserver* Observ, + const neutrino_msg_t DirectKey, const char * const IconName, bool Pulldown) + : CMenuItem(Active, DirectKey, IconName) +{ + init(OptionName, NONEXISTANT_LOCALE, OptionValue, Observ, Pulldown); +} + +void CMenuOptionStringChooser::init( const std::string &OptionName, + const neutrino_locale_t Name, + std::string* pOptionValue, + CChangeObserver * const Observ, + bool Pulldown) { nameString = OptionName; - name = NONEXISTANT_LOCALE; - optionValuePtr = OptionValue ? OptionValue : &optionValue; + name = Name; + optionValuePtr = pOptionValue ? pOptionValue : &optionValue; observ = Observ; pulldown = Pulldown; } diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index 73512ac9f..b059ed525 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -453,6 +453,11 @@ class CMenuOptionStringChooser : public CMenuItem std::vector options; CChangeObserver * observ; bool pulldown; + void init( const std::string &OptionName, + const neutrino_locale_t Name, + std::string* pOptionValue, + CChangeObserver * const Observ, + bool Pulldown ); public: CMenuOptionStringChooser(const neutrino_locale_t Name, std::string* OptionValue, bool Active = false,