Fix the bed type incorrect issue after reopen studio for new project
Change-Id: Ia1a07cb2cde6864552e6dd084949c1cb83c8cab0
This commit is contained in:
parent
c9e8ef3f93
commit
6323a1c35c
1 changed files with 12 additions and 1 deletions
|
@ -541,11 +541,22 @@ Sidebar::Sidebar(Plater *parent)
|
||||||
|
|
||||||
AppConfig *app_config = wxGetApp().app_config;
|
AppConfig *app_config = wxGetApp().app_config;
|
||||||
std::string str_bed_type = app_config->get("curr_bed_type");
|
std::string str_bed_type = app_config->get("curr_bed_type");
|
||||||
m_bed_type_list->Select(atoi(str_bed_type.c_str()));
|
int bed_type_value = atoi(str_bed_type.c_str());
|
||||||
|
m_bed_type_list->Select(bed_type_value);
|
||||||
bed_type_sizer->Add(bed_type_title, 0, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(10));
|
bed_type_sizer->Add(bed_type_title, 0, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(10));
|
||||||
bed_type_sizer->Add(m_bed_type_list, 1, wxLEFT | wxRIGHT | wxEXPAND, FromDIP(10));
|
bed_type_sizer->Add(m_bed_type_list, 1, wxLEFT | wxRIGHT | wxEXPAND, FromDIP(10));
|
||||||
vsizer_printer->Add(bed_type_sizer, 0, wxEXPAND | wxTOP, FromDIP(5));
|
vsizer_printer->Add(bed_type_sizer, 0, wxEXPAND | wxTOP, FromDIP(5));
|
||||||
|
|
||||||
|
auto& project_config = wxGetApp().preset_bundle->project_config;
|
||||||
|
/*const t_config_enum_values* keys_map = print_config_def.get("curr_bed_type")->enum_keys_map;
|
||||||
|
BedType bed_type = btCount;
|
||||||
|
for (auto item : *keys_map) {
|
||||||
|
if (item.first == str_bed_type)
|
||||||
|
bed_type = (BedType)item.second;
|
||||||
|
}*/
|
||||||
|
BedType bed_type = (BedType)bed_type_value;
|
||||||
|
project_config.set_key_value("curr_bed_type", new ConfigOptionEnum<BedType>(bed_type));
|
||||||
|
|
||||||
p->m_panel_printer_content->SetSizer(vsizer_printer);
|
p->m_panel_printer_content->SetSizer(vsizer_printer);
|
||||||
p->m_panel_printer_content->Layout();
|
p->m_panel_printer_content->Layout();
|
||||||
scrolled_sizer->Add(p->m_panel_printer_content, 0, wxTOP | wxEXPAND, FromDIP(14));
|
scrolled_sizer->Add(p->m_panel_printer_content, 0, wxTOP | wxEXPAND, FromDIP(14));
|
||||||
|
|
Loading…
Reference in a new issue