mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-24 03:12:07 +00:00
Make printer profile swithing faster (#14437)
* Fix issue that switching printer profile is slow.
`wxGetApp().get_tab(preset_type)->select_preset(preset_name);` is called twice when switching printer profiles. Only one needed.
* Avoid unnecessary type conversion & function call during printer profile switching:
- Don't call `config->opt_string("printer_model")` repeatedly
- Use ref when possible during iterating
- Avoid unnecessary `wxString` to `std::string` conversion
This commit is contained in:
@@ -9684,11 +9684,14 @@ void Plater::priv::on_select_preset(wxCommandEvent &evt)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// BBS
|
||||
// wxWindowUpdateLocker noUpdates1(sidebar->print_panel());
|
||||
wxWindowUpdateLocker noUpdates2(sidebar->filament_panel());
|
||||
wxGetApp().get_tab(preset_type)->select_preset(preset_name);
|
||||
// update plater with new config
|
||||
q->on_config_change(wxGetApp().preset_bundle->full_config());
|
||||
}
|
||||
//BBS
|
||||
//wxWindowUpdateLocker noUpdates1(sidebar->print_panel());
|
||||
wxWindowUpdateLocker noUpdates2(sidebar->filament_panel());
|
||||
wxGetApp().get_tab(preset_type)->select_preset(preset_name);
|
||||
}
|
||||
|
||||
// ORCA: Always refresh the selected filament combo so its color swatch (clr_picker)
|
||||
|
||||
Reference in New Issue
Block a user