mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-25 23:54:00 -06:00
FIX: move preset dirty suffix to prefix
Change-Id: I52d4d6e3dea28d071eb7bf2f3b5e77b5e1b8c8bb
This commit is contained in:
parent
99fcecf193
commit
c5024af7e2
4 changed files with 19 additions and 29 deletions
|
@ -307,8 +307,8 @@ void Preset::update_suffix_modified(const std::string& new_suffix_modified)
|
|||
// This converts a UI name to a unique preset identifier.
|
||||
std::string Preset::remove_suffix_modified(const std::string &name)
|
||||
{
|
||||
return boost::algorithm::ends_with(name, g_suffix_modified) ?
|
||||
name.substr(0, name.size() - g_suffix_modified.size()) :
|
||||
return boost::algorithm::starts_with(name, g_suffix_modified) ?
|
||||
name.substr(g_suffix_modified.size()) :
|
||||
name;
|
||||
}
|
||||
|
||||
|
@ -530,9 +530,10 @@ void Preset::save(DynamicPrintConfig* parent_config)
|
|||
}
|
||||
|
||||
// Return a label of this preset, consisting of a name and a "(modified)" suffix, if this preset is dirty.
|
||||
std::string Preset::label() const
|
||||
std::string Preset::label(bool no_alias) const
|
||||
{
|
||||
return this->name + (this->is_dirty ? g_suffix_modified : "");
|
||||
return (this->is_dirty ? g_suffix_modified : "")
|
||||
+ ((no_alias || this->alias.empty()) ? this->name : this->alias);
|
||||
}
|
||||
|
||||
bool is_compatible_with_print(const PresetWithVendorProfile &preset, const PresetWithVendorProfile &active_print, const PresetWithVendorProfile &active_printer)
|
||||
|
|
|
@ -245,7 +245,7 @@ public:
|
|||
void save(DynamicPrintConfig* parent_config);
|
||||
|
||||
// Return a label of this preset, consisting of a name and a "(modified)" suffix, if this preset is dirty.
|
||||
std::string label() const;
|
||||
std::string label(bool no_alias) const;
|
||||
|
||||
// Set the is_dirty flag if the provided config is different from the active one.
|
||||
void set_dirty(const DynamicPrintConfig &config) { this->is_dirty = ! this->config.diff(config).empty(); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue