mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Fixed editing of the extruder's settings (SPE-735)
This commit is contained in:
parent
cfff3832dc
commit
591d42fd76
3 changed files with 12 additions and 10 deletions
|
@ -218,7 +218,7 @@ public:
|
||||||
|
|
||||||
const T& get_at(size_t i) const { return const_cast<ConfigOptionVector<T>*>(this)->get_at(i); }
|
const T& get_at(size_t i) const { return const_cast<ConfigOptionVector<T>*>(this)->get_at(i); }
|
||||||
|
|
||||||
// Resize this vector by duplicating the last value.
|
// Resize this vector by duplicating the /*last*/first value.
|
||||||
// If the current vector is empty, the default value is used instead.
|
// If the current vector is empty, the default value is used instead.
|
||||||
void resize(size_t n, const ConfigOption *opt_default = nullptr) override
|
void resize(size_t n, const ConfigOption *opt_default = nullptr) override
|
||||||
{
|
{
|
||||||
|
@ -238,7 +238,7 @@ public:
|
||||||
this->values.resize(n, static_cast<const ConfigOptionVector<T>*>(opt_default)->values.front());
|
this->values.resize(n, static_cast<const ConfigOptionVector<T>*>(opt_default)->values.front());
|
||||||
} else {
|
} else {
|
||||||
// Resize by duplicating the last value.
|
// Resize by duplicating the last value.
|
||||||
this->values.resize(n, this->values.back());
|
this->values.resize(n, this->values./*back*/front());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,13 +154,15 @@ void change_opt_value(DynamicPrintConfig& config, const t_config_option_key& opt
|
||||||
}
|
}
|
||||||
else if (config.def()->get(opt_key)->gui_flags.compare("serialized") == 0) {
|
else if (config.def()->get(opt_key)->gui_flags.compare("serialized") == 0) {
|
||||||
std::string str = boost::any_cast<std::string>(value);
|
std::string str = boost::any_cast<std::string>(value);
|
||||||
if (str.back() == ';') str.pop_back();
|
std::vector<std::string> values {};
|
||||||
// Split a string to multiple strings by a semi - colon.This is the old way of storing multi - string values.
|
if (!str.empty()) {
|
||||||
// Currently used for the post_process config value only.
|
if (str.back() == ';') str.pop_back();
|
||||||
std::vector<std::string> values;
|
// Split a string to multiple strings by a semi - colon.This is the old way of storing multi - string values.
|
||||||
boost::split(values, str, boost::is_any_of(";"));
|
// Currently used for the post_process config value only.
|
||||||
if (values.size() == 1 && values[0] == "")
|
boost::split(values, str, boost::is_any_of(";"));
|
||||||
values.resize(0);//break;
|
if (values.size() == 1 && values[0] == "")
|
||||||
|
values.resize(0);
|
||||||
|
}
|
||||||
config.option<ConfigOptionStrings>(opt_key)->values = values;
|
config.option<ConfigOptionStrings>(opt_key)->values = values;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|
|
@ -1053,7 +1053,7 @@ std::vector<std::string> PresetCollection::dirty_options(const Preset *edited, c
|
||||||
std::vector<std::string> changed;
|
std::vector<std::string> changed;
|
||||||
if (edited != nullptr && reference != nullptr) {
|
if (edited != nullptr && reference != nullptr) {
|
||||||
changed = deep_compare ?
|
changed = deep_compare ?
|
||||||
deep_diff(reference->config, edited->config) :
|
deep_diff(edited->config, reference->config) :
|
||||||
reference->config.diff(edited->config);
|
reference->config.diff(edited->config);
|
||||||
// The "compatible_printers" option key is handled differently from the others:
|
// The "compatible_printers" option key is handled differently from the others:
|
||||||
// It is not mandatory. If the key is missing, it means it is compatible with any printer.
|
// It is not mandatory. If the key is missing, it means it is compatible with any printer.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue