diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index a0e154bad..e50cd1262 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1350,9 +1350,7 @@ CMenuOptionChooser::CMenuOptionChooser(const neutrino_locale_t OptionName, int * for (unsigned int i = 0; i < number_of_options; i++) { struct keyval_ext opt; - opt.key = Options[i].key; - opt.value = Options[i].value; - opt.valname = NULL; + opt = Options[i]; options.push_back(opt); } } @@ -1373,9 +1371,7 @@ CMenuOptionChooser::CMenuOptionChooser(const std::string &OptionName, int * cons for (unsigned int i = 0; i < number_of_options; i++) { struct keyval_ext opt; - opt.key = Options[i].key; - opt.value = Options[i].value; - opt.valname = NULL; + opt = Options[i]; options.push_back(opt); } } @@ -1450,10 +1446,33 @@ CMenuOptionChooser::CMenuOptionChooser(const std::string &OptionName, int * cons CMenuOptionChooser::~CMenuOptionChooser() { - options.clear(); clearChooserOptions(); } +void CMenuOptionChooser::setOptions(const struct keyval * const Options, const unsigned Number_Of_Options) +{ + options.clear(); + number_of_options = Number_Of_Options; + for (unsigned int i = 0; i < number_of_options; i++) + { + struct keyval_ext opt; + opt = Options[i]; + options.push_back(opt); + } + if (used && x != -1) + paint(false); +} + +void CMenuOptionChooser::setOptions(const struct keyval_ext * const Options, const unsigned Number_Of_Options) +{ + options.clear(); + number_of_options = Number_Of_Options; + for (unsigned int i = 0; i < number_of_options; i++) + options.push_back(Options[i]); + if (used && x != -1) + paint(false); +} + void CMenuOptionChooser::setOption(const int newvalue) { *optionValue = newvalue; diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index 4208490f1..816eff9ee 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -353,17 +353,24 @@ struct CMenuOptionChooserCompareItem: public std::binary_function