mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-23 14:44:19 -06:00
Merge remote-tracking branch 'origin/updating' into cpp_ui_optimization
This commit is contained in:
commit
3b0eb6b786
62 changed files with 4998 additions and 967 deletions
|
@ -644,7 +644,8 @@ void Tab::load_key_value(const std::string& opt_key, const boost::any& value)
|
|||
change_opt_value(*m_config, opt_key, value);
|
||||
// Mark the print & filament enabled if they are compatible with the currently selected preset.
|
||||
if (opt_key.compare("compatible_printers") == 0) {
|
||||
m_preset_bundle->update_compatible_with_printer(0);
|
||||
// Don't select another profile if this profile happens to become incompatible.
|
||||
m_preset_bundle->update_compatible_with_printer(false);
|
||||
}
|
||||
m_presets->update_dirty_ui(m_presets_choice);
|
||||
on_presets_changed();
|
||||
|
@ -2203,9 +2204,9 @@ wxSizer* Tab::compatible_printers_widget(wxWindow* parent, wxCheckBox** checkbox
|
|||
presets.Add(preset.name);
|
||||
}
|
||||
|
||||
auto dlg = new wxMultiChoiceDialog(parent,
|
||||
_(L("Select the printers this profile is compatible with.")),
|
||||
_(L("Compatible printers")), presets);
|
||||
wxMultiChoiceDialog dlg(parent,
|
||||
_(L("Select the printers this profile is compatible with.")),
|
||||
_(L("Compatible printers")), presets);
|
||||
// # Collect and set indices of printers marked as compatible.
|
||||
wxArrayInt selections;
|
||||
auto *compatible_printers = dynamic_cast<const ConfigOptionStrings*>(m_config->option("compatible_printers"));
|
||||
|
@ -2217,12 +2218,12 @@ wxSizer* Tab::compatible_printers_widget(wxWindow* parent, wxCheckBox** checkbox
|
|||
selections.Add(idx);
|
||||
break;
|
||||
}
|
||||
dlg->SetSelections(selections);
|
||||
dlg.SetSelections(selections);
|
||||
std::vector<std::string> value;
|
||||
// Show the dialog.
|
||||
if (dlg->ShowModal() == wxID_OK) {
|
||||
if (dlg.ShowModal() == wxID_OK) {
|
||||
selections.Clear();
|
||||
selections = dlg->GetSelections();
|
||||
selections = dlg.GetSelections();
|
||||
for (auto idx : selections)
|
||||
value.push_back(presets[idx].ToStdString());
|
||||
if (value.empty()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue