mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-20 11:53:48 +00:00
Further fixes of the previous commit.
This commit is contained in:
@@ -97,7 +97,7 @@ void PresetCollection::update_editor_ui(wxBitmapComboBox *ui)
|
||||
|
||||
size_t n_visible = this->num_visible();
|
||||
size_t n_choice = size_t(ui->GetCount());
|
||||
std::string name_selected = ui->GetStringSelection().ToUTF8().data();
|
||||
std::string name_selected = dynamic_cast<wxItemContainerImmutable*>(ui)->GetStringSelection().ToUTF8().data();
|
||||
if (boost::algorithm::iends_with(name_selected, g_suffix_modified))
|
||||
// Remove the g_suffix_modified.
|
||||
name_selected.erase(name_selected.end() - g_suffix_modified.size(), name_selected.end());
|
||||
|
||||
@@ -83,6 +83,7 @@ public:
|
||||
Preset& get_edited_preset() { return m_edited_preset; }
|
||||
const Preset& get_edited_preset() const { return m_edited_preset; }
|
||||
// Return a preset possibly with modifications.
|
||||
const Preset& default_preset() const { return m_presets.front(); }
|
||||
Preset& preset(size_t idx) { return (int(idx) == m_idx_selected) ? m_edited_preset : m_presets[idx]; }
|
||||
const Preset& preset(size_t idx) const { return const_cast<PresetCollection*>(this)->preset(idx); }
|
||||
size_t size() const { return this->m_presets.size(); }
|
||||
|
||||
Reference in New Issue
Block a user