diff options
author | YuSanka <yusanka@gmail.com> | 2019-08-22 14:19:01 +0300 |
---|---|---|
committer | YuSanka <yusanka@gmail.com> | 2019-08-22 14:19:01 +0300 |
commit | 8828ec78608e9a9efae05cea2a980750f2346888 (patch) | |
tree | 42c343d0d986a98152cee2c4c3ec94d7f2d36029 /src/slic3r/GUI/Tab.hpp | |
parent | 7ff68ad210386a8d77fe247c201f098127aae933 (diff) |
Code refactoring: ConfigManipulation moved to separate files.
Use of ConfigManipulation inside of TabPrint(TabSLAPrint)::update().
Diffstat (limited to 'src/slic3r/GUI/Tab.hpp')
-rw-r--r-- | src/slic3r/GUI/Tab.hpp | 40 |
1 files changed, 4 insertions, 36 deletions
diff --git a/src/slic3r/GUI/Tab.hpp b/src/slic3r/GUI/Tab.hpp index bd6ee4825..f57558c45 100644 --- a/src/slic3r/GUI/Tab.hpp +++ b/src/slic3r/GUI/Tab.hpp @@ -32,6 +32,7 @@ #include "ButtonsDescription.hpp" #include "Event.hpp" #include "wxExtensions.hpp" +#include "ConfigManipulation.hpp" namespace Slic3r { namespace GUI { @@ -313,6 +314,9 @@ protected: void update_frequently_changed_parameters(); void fill_icon_descriptions(); void set_tooltips_text(); + + ConfigManipulation m_config_manipulation; + ConfigManipulation get_config_manipulation(); }; class TabPrint : public Tab @@ -444,42 +448,6 @@ public: std::string get_name() { return m_chosen_name; } }; -class ConfigManipulation -{ - bool is_msg_dlg_already_exist{ false }; - bool support_material_overhangs_queried {false}; - - // function to loading of changed configuration - std::function<void()> load_config = nullptr; - std::function<Field* (const std::string&)> get_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&)> get_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_value_change(cb_value_change), - local_config(local_config) {} - - ~ConfigManipulation() { - load_config = nullptr; - get_field = nullptr; - cb_value_change = nullptr; - } - - void apply(DynamicPrintConfig* config, DynamicPrintConfig* new_config); - void toggle_field(const std::string& field_key, const bool toggle); - void update_print_fff_config(DynamicPrintConfig* config, const bool is_global_config = false); - void toggle_print_fff_options(DynamicPrintConfig* config); - void update_print_sla_config(DynamicPrintConfig* config, const bool is_global_config = false); - void toggle_print_sla_options(DynamicPrintConfig* config); -}; - } // GUI } // Slic3r |