mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-16 08:05:55 +08:00
ConfigWizard: Fixed validation of the custom printer name
+ Reload materials pages after load repositories from archive (follow-up 61834d3f, SPE-2336)
This commit is contained in:
parent
a6548a810c
commit
de32cd70de
@ -1470,7 +1470,7 @@ PageCustom::PageCustom(ConfigWizard *parent)
|
||||
auto *label = new wxStaticText(this, wxID_ANY, _L("Custom profile name:"));
|
||||
|
||||
wxBoxSizer* profile_name_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
profile_name_editor = new SavePresetDialog::Item{ this, profile_name_sizer, default_profile_name };
|
||||
profile_name_editor = new SavePresetDialog::Item{ this, profile_name_sizer, default_profile_name, &wxGetApp().preset_bundle->printers};
|
||||
profile_name_editor->Enable(false);
|
||||
|
||||
cb_custom->Bind(wxEVT_CHECKBOX, [this](wxCommandEvent &) {
|
||||
@ -3796,13 +3796,20 @@ void ConfigWizard::priv::load_pages_from_archive()
|
||||
|
||||
check_and_install_missing_materials(T_ANY);
|
||||
update_materials(T_ANY);
|
||||
|
||||
if (!page_filaments && !only_sla_mode) {
|
||||
if (page_filaments) {
|
||||
if (any_fff_selected)
|
||||
page_filaments->reload_presets();
|
||||
}
|
||||
else if(!only_sla_mode) {
|
||||
add_page(page_filaments = new PageMaterials(q, &filaments,
|
||||
_L("Filament Profiles Selection"), _L("Filaments"), _L("Type:")));
|
||||
}
|
||||
|
||||
if (!page_sla_materials) {
|
||||
if (page_sla_materials) {
|
||||
if (any_sla_selected)
|
||||
page_sla_materials->reload_presets();
|
||||
}
|
||||
else {
|
||||
add_page(page_sla_materials = new PageMaterials(q, &sla_materials,
|
||||
_L("SLA Material Profiles Selection") + " ", _L("SLA Materials"), _L("Type:")));
|
||||
}
|
||||
|
@ -139,8 +139,9 @@ SavePresetDialog::Item::Item(Preset::Type type, const std::string& suffix, wxBox
|
||||
update();
|
||||
}
|
||||
|
||||
SavePresetDialog::Item::Item(wxWindow* parent, wxBoxSizer* sizer, const std::string& def_name, PrinterTechnology pt /*= ptFFF*/):
|
||||
SavePresetDialog::Item::Item(wxWindow* parent, wxBoxSizer* sizer, const std::string& def_name, PresetCollection* presets, PrinterTechnology pt /*= ptFFF*/):
|
||||
m_preset_name(def_name),
|
||||
m_presets(presets),
|
||||
m_printer_technology(pt),
|
||||
m_parent(parent),
|
||||
m_valid_bmp(new wxStaticBitmap(m_parent, wxID_ANY, *get_bmp_bundle("tick_mark"))),
|
||||
@ -152,6 +153,8 @@ SavePresetDialog::Item::Item(wxWindow* parent, wxBoxSizer* sizer, const std::str
|
||||
input_name_sizer->Add(m_valid_bmp, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, BORDER_W);
|
||||
init_input_name_ctrl(input_name_sizer, m_preset_name);
|
||||
|
||||
init_casei_preset_names();
|
||||
|
||||
sizer->Add(input_name_sizer,0, wxEXPAND | wxBOTTOM, BORDER_W);
|
||||
sizer->Add(m_valid_label, 0, wxEXPAND | wxLEFT, 3*BORDER_W);
|
||||
|
||||
|
@ -41,7 +41,7 @@ public:
|
||||
};
|
||||
|
||||
Item(Preset::Type type, const std::string& suffix, wxBoxSizer* sizer, SavePresetDialog* parent, bool is_for_multiple_save);
|
||||
Item(wxWindow* parent, wxBoxSizer* sizer, const std::string& def_name, PrinterTechnology pt = ptFFF);
|
||||
Item(wxWindow* parent, wxBoxSizer* sizer, const std::string& def_name, PresetCollection* presets, PrinterTechnology pt = ptFFF);
|
||||
|
||||
void update_valid_bmp();
|
||||
void accept();
|
||||
|
Loading…
x
Reference in New Issue
Block a user