FIX: Bed type display
jira: none Change-Id: Ibac2a7a80d6841ebea639e0a58547413df6f5c74
This commit is contained in:
parent
6fb06eb779
commit
2c3fa062c9
|
@ -4958,17 +4958,19 @@ bool SelectMachineDialog::Show(bool show)
|
||||||
{
|
{
|
||||||
show_status(PrintDialogStatus::PrintStatusInit);
|
show_status(PrintDialogStatus::PrintStatusInit);
|
||||||
|
|
||||||
const ConfigOptionDef* bed_type_def = print_config_def.get("curr_bed_type");
|
|
||||||
PresetBundle& preset_bundle = *wxGetApp().preset_bundle;
|
PresetBundle& preset_bundle = *wxGetApp().preset_bundle;
|
||||||
auto cur_preset_name = preset_bundle.printers.get_edited_preset().name;
|
auto cur_preset_name = preset_bundle.printers.get_edited_preset().name;
|
||||||
auto name = wxGetApp().app_config->get_section("user_bed_type_list");
|
|
||||||
|
if (wxGetApp().app_config->has_section("user_bed_type_list")) {
|
||||||
std::string plate_name = "";
|
std::string plate_name = "";
|
||||||
|
auto name = wxGetApp().app_config->get_section("user_bed_type_list");
|
||||||
for (auto it : name) {
|
for (auto it : name) {
|
||||||
if (it.first == cur_preset_name) {
|
if (it.first == cur_preset_name) {
|
||||||
plate_name = it.second;
|
plate_name = it.second;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const ConfigOptionDef* bed_type_def = print_config_def.get("curr_bed_type");
|
||||||
if (bed_type_def != nullptr) {
|
if (bed_type_def != nullptr) {
|
||||||
for (auto it : bed_type_def->enum_labels) {
|
for (auto it : bed_type_def->enum_labels) {
|
||||||
if (it.find(plate_name) != std::string::npos) {
|
if (it.find(plate_name) != std::string::npos) {
|
||||||
|
@ -4977,9 +4979,14 @@ bool SelectMachineDialog::Show(bool show)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
plate_name = "Plate: " + plate_name;
|
plate_name = "Plate: " + plate_name;
|
||||||
m_text_bed_type->SetLabelText(plate_name);
|
m_text_bed_type->SetLabelText(plate_name);
|
||||||
|
m_text_bed_type->Show();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
m_text_bed_type->Hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// set default value when show this dialog
|
// set default value when show this dialog
|
||||||
if (show) {
|
if (show) {
|
||||||
|
|
Loading…
Reference in New Issue