diff options
author | YuSanka <yusanka@gmail.com> | 2019-11-21 15:12:06 +0300 |
---|---|---|
committer | YuSanka <yusanka@gmail.com> | 2019-11-21 15:12:06 +0300 |
commit | cb395460c4103ab5da18e8cf52bd097ed96943ff (patch) | |
tree | af35a6ef3a9e3b83ede3e41856299ef2e6159571 /src/slic3r/GUI/ConfigWizard_private.hpp | |
parent | 15251397b883e86d72ca497b2339d2ccb5a4937e (diff) |
Implemented aliases for filaments
Diffstat (limited to 'src/slic3r/GUI/ConfigWizard_private.hpp')
-rw-r--r-- | src/slic3r/GUI/ConfigWizard_private.hpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/slic3r/GUI/ConfigWizard_private.hpp b/src/slic3r/GUI/ConfigWizard_private.hpp index 995957816..500488bc9 100644 --- a/src/slic3r/GUI/ConfigWizard_private.hpp +++ b/src/slic3r/GUI/ConfigWizard_private.hpp @@ -75,7 +75,8 @@ struct Materials template<class F> void filter_presets(const std::string &type, const std::string &vendor, F cb) { for (const Preset *preset : presets) { - if ((type.empty() || get_type(preset) == type) && (vendor.empty() || get_vendor(preset) == vendor)) { + if ((type.empty() || get_type(preset) == type) && (vendor.empty() || get_vendor(preset) == vendor)//) { + && preset->alias.empty()) { cb(preset); } } @@ -404,6 +405,8 @@ wxDEFINE_EVENT(EVT_INDEX_PAGE, wxCommandEvent); // ConfigWizard private data +typedef std::map<std::string, std::set<std::string>> PresetAliases; + struct ConfigWizard::priv { ConfigWizard *q; @@ -415,6 +418,7 @@ struct ConfigWizard::priv // PrinterPickers state. Materials filaments; // Holds available filament presets and their types & vendors Materials sla_materials; // Ditto for SLA materials + PresetAliases aliases; // Map of aliase to preset names std::unique_ptr<DynamicPrintConfig> custom_config; // Backing for custom printer definition bool any_fff_selected; // Used to decide whether to display Filaments page bool any_sla_selected; // Used to decide whether to display SLA Materials page @@ -473,6 +477,9 @@ struct ConfigWizard::priv void on_3rdparty_install(const VendorProfile *vendor, bool install); void apply_config(AppConfig *app_config, PresetBundle *preset_bundle, const PresetUpdater *updater); + // #ys_FIXME_alise + void add_presets(const std::string& section, const std::string& alias_key); + void del_presets(const std::string& section, const std::string& alias_key); int em() const { return index->em(); } }; |