mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-12 01:29:02 +08:00
Add private methods to get the selected preset name(s).
This commit is contained in:
parent
378330d747
commit
df20d5a8de
@ -127,6 +127,23 @@ bool PresetChooser::prompt_unsaved_changes() {
|
||||
return true;
|
||||
}
|
||||
|
||||
std::vector<wxString> PresetChooser::_get_selected_presets(preset_t group) const {
|
||||
const auto& choosers { this->preset_choosers[get_preset(group)] };
|
||||
std::vector<wxString> selected;
|
||||
selected.reserve(choosers.size());
|
||||
|
||||
for (auto* chooser : choosers) {
|
||||
selected.push_back(chooser->GetString(chooser->GetSelection()));
|
||||
}
|
||||
return selected;
|
||||
}
|
||||
|
||||
wxString PresetChooser::_get_selected_preset(preset_t group, size_t index) const {
|
||||
auto selected { this->_get_selected_presets(group) };
|
||||
if (index > selected.size()) { return wxString(""); }
|
||||
return selected.at(index);
|
||||
}
|
||||
|
||||
void PresetChooser::_on_change_combobox(preset_t preset, wxBitmapComboBox* choice) {
|
||||
|
||||
// Prompt for unsaved changes and undo selections if cancelled and return early
|
||||
|
@ -79,6 +79,12 @@ private:
|
||||
|
||||
void _on_select_preset(preset_t preset);
|
||||
|
||||
/// Return the vector of strings representing the selected preset names.
|
||||
std::vector<wxString> _get_selected_presets(preset_t group) const;
|
||||
|
||||
/// Fetch the preset name corresponding to the chooser index
|
||||
wxString _get_selected_preset(preset_t group, size_t index) const;
|
||||
|
||||
};
|
||||
|
||||
}} // Slic3r::GUI
|
||||
|
Loading…
x
Reference in New Issue
Block a user