From e74bde858a9ccfbdd85966383487f29d02910bcc Mon Sep 17 00:00:00 2001 From: YuSanka Date: Sat, 16 Mar 2019 22:23:51 +0100 Subject: [PATCH] Deleted imaginary optimization for the Preset comboboxes on sidebar. --- src/slic3r/GUI/Plater.hpp | 2 -- src/slic3r/GUI/Preset.cpp | 7 +------ src/slic3r/GUI/PresetBundle.cpp | 5 +---- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/slic3r/GUI/Plater.hpp b/src/slic3r/GUI/Plater.hpp index 4261dbae2..ecce63805 100644 --- a/src/slic3r/GUI/Plater.hpp +++ b/src/slic3r/GUI/Plater.hpp @@ -51,8 +51,6 @@ public: int get_extruder_idx() const { return extruder_idx; } void check_selection(); - std::string selected_preset_name; - private: typedef std::size_t Marker; enum { LABEL_ITEM_MARKER = 0x4d }; diff --git a/src/slic3r/GUI/Preset.cpp b/src/slic3r/GUI/Preset.cpp index bb70b8f47..656658b0b 100644 --- a/src/slic3r/GUI/Preset.cpp +++ b/src/slic3r/GUI/Preset.cpp @@ -879,8 +879,7 @@ size_t PresetCollection::update_compatible_internal(const Preset &active_printer // Hide the void PresetCollection::update_platter_ui(GUI::PresetComboBox *ui) { - if (ui == nullptr || - ui->selected_preset_name == this->get_selected_preset().name) + if (ui == nullptr) return; // Otherwise fill in the list from scratch. @@ -951,10 +950,6 @@ void PresetCollection::update_platter_ui(GUI::PresetComboBox *ui) ui->SetSelection(selected_preset_item); ui->SetToolTip(ui->GetString(selected_preset_item)); ui->Thaw(); - - // For printer preset it's important to update preset list every time because of ConfigWizard - // So, don't save selected preset name - ui->selected_preset_name = type()==Preset::TYPE_PRINTER ? "" : this->get_selected_preset().name; } size_t PresetCollection::update_tab_ui(wxBitmapComboBox *ui, bool show_incompatible) diff --git a/src/slic3r/GUI/PresetBundle.cpp b/src/slic3r/GUI/PresetBundle.cpp index 52421fafa..f0bb4de01 100644 --- a/src/slic3r/GUI/PresetBundle.cpp +++ b/src/slic3r/GUI/PresetBundle.cpp @@ -1436,8 +1436,7 @@ bool PresetBundle::parse_color(const std::string &scolor, unsigned char *rgb_out void PresetBundle::update_platter_filament_ui(unsigned int idx_extruder, GUI::PresetComboBox *ui) { if (ui == nullptr || this->printers.get_edited_preset().printer_technology() == ptSLA || - this->filament_presets.size() <= idx_extruder || - ui->selected_preset_name == this->filaments.find_preset(this->filament_presets[idx_extruder])->name) + this->filament_presets.size() <= idx_extruder ) return; unsigned char rgb[3]; @@ -1526,8 +1525,6 @@ void PresetBundle::update_platter_filament_ui(unsigned int idx_extruder, GUI::Pr ui->SetSelection(selected_preset_item); ui->SetToolTip(ui->GetString(selected_preset_item)); ui->Thaw(); - - ui->selected_preset_name = this->filaments.find_preset(this->filament_presets[idx_extruder])->name; } void PresetBundle::set_default_suppressed(bool default_suppressed)