Code refactoring of the OptionsGroup class:

Controls are created only for the active page now
This commit is contained in:
YuSanka 2020-09-22 11:17:43 +02:00
parent aedb3892ba
commit 398ff9053d
11 changed files with 568 additions and 386 deletions

View file

@ -21,25 +21,25 @@ class ConfigManipulation
// function to loading of changed configuration
std::function<void()> load_config = nullptr;
std::function<Field* (const std::string&, int opt_index)> get_field = nullptr;
std::function<void (const std::string&, bool toggle, int opt_index)> cb_toggle_field = nullptr;
// callback to propagation of changed value, if needed
std::function<void(const std::string&, const boost::any&)> cb_value_change = nullptr;
DynamicPrintConfig* local_config = nullptr;
public:
ConfigManipulation(std::function<void()> load_config,
std::function<Field* (const std::string&, int opt_index)> get_field,
std::function<void(const std::string&, bool toggle, int opt_index)> cb_toggle_field,
std::function<void(const std::string&, const boost::any&)> cb_value_change,
DynamicPrintConfig* local_config = nullptr) :
load_config(load_config),
get_field(get_field),
cb_toggle_field(cb_toggle_field),
cb_value_change(cb_value_change),
local_config(local_config) {}
ConfigManipulation() {}
~ConfigManipulation() {
load_config = nullptr;
get_field = nullptr;
cb_toggle_field = nullptr;
cb_value_change = nullptr;
}