Skip to content

Commit a1a7b77

Browse files
DanBao-Bambulanewei120
authored andcommitted
FIX: fix combobox and delete btn in filament setting enabled
Jira: XXXX Change-Id: I8b659bd77ceb97c8cea9d3e5e931f4ea50822721
1 parent a4cd80a commit a1a7b77

5 files changed

Lines changed: 9 additions & 5 deletions

File tree

src/libslic3r/Preset.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,6 +1306,7 @@ int PresetCollection::get_differed_values_to_update(Preset& preset, std::map<std
13061306
key_values.erase(BBL_JSON_KEY_BASE_ID);
13071307
if (get_preset_base(preset) == &preset && !preset.filament_id.empty()) {
13081308
key_values[BBL_JSON_KEY_FILAMENT_ID] = preset.filament_id;
1309+
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " uploading user preset name is: " << preset.name << "and create filament id is: " << preset.filament_id;
13091310
}
13101311
}
13111312
key_values[BBL_JSON_KEY_UPDATE_TIME] = std::to_string(preset.updated_time);

src/slic3r/GUI/CreatePresetsDialog.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ static std::string get_filament_id(std::string vendor_typr_serial)
451451
user_filament_id = "P" + calculate_md5(vendor_typr_serial + get_curr_time()).substr(0, 7);
452452
}
453453
}
454+
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " filament name is: " << vendor_typr_serial << "and create filament id is: " << user_filament_id;
454455
return user_filament_id;
455456
}
456457

@@ -1483,8 +1484,8 @@ wxBoxSizer *CreatePrinterPresetDialog::create_step_switch_item()
14831484
horizontal_sizer->Add(divider_line, 0, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(3));
14841485
m_step_2 = new wxStaticBitmap(step_switch_panel, wxID_ANY, create_scaled_bitmap("step_2_ready", nullptr, FromDIP(20)), wxDefaultPosition, wxDefaultSize);
14851486
horizontal_sizer->Add(m_step_2, 0, wxEXPAND | wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(3));
1486-
wxStaticText *static_improt_presets_text = new wxStaticText(step_switch_panel, wxID_ANY, _L("Improt Preset"), wxDefaultPosition, wxDefaultSize);
1487-
horizontal_sizer->Add(static_improt_presets_text, 0, wxEXPAND | wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(3));
1487+
wxStaticText *static_import_presets_text = new wxStaticText(step_switch_panel, wxID_ANY, _L("Import Preset"), wxDefaultPosition, wxDefaultSize);
1488+
horizontal_sizer->Add(static_import_presets_text, 0, wxEXPAND | wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(3));
14881489
horizontal_sizer->Add(0, 0, 1, wxEXPAND, 0);
14891490

14901491
step_switch_panel->SetSizer(horizontal_sizer);

src/slic3r/GUI/ParamsDialog.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,16 @@ ParamsDialog::ParamsDialog(wxWindow * parent)
6565
//wxGetApp().UpdateDlgDarkUI(this);
6666
}
6767

68-
void ParamsDialog::Popup(bool just_edit)
68+
void ParamsDialog::Popup()
6969
{
7070
wxGetApp().UpdateDlgDarkUI(this);
7171
#ifdef __WIN32__
7272
Reparent(wxGetApp().mainframe);
7373
#endif
7474
Center();
7575
if (m_panel && m_panel->get_current_tab()) {
76+
bool just_edit = false;
77+
if (!m_editing_filament_id.empty()) just_edit = true;
7678
dynamic_cast<Tab *>(m_panel->get_current_tab())->set_just_edit(just_edit);
7779
}
7880
Show();

src/slic3r/GUI/ParamsDialog.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class ParamsDialog : public DPIDialog
2929

3030
ParamsPanel * panel() { return m_panel; }
3131

32-
void Popup(bool just_edit = false);
32+
void Popup();
3333

3434
void set_editing_filament_id(std::string id) { m_editing_filament_id = id; }
3535

src/slic3r/GUI/Plater.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7643,7 +7643,7 @@ void Plater::priv::on_modify_filament(SimpleEvent &evt)
76437643
update_ui_from_settings();
76447644
sidebar->update_all_preset_comboboxes();
76457645
if (wxID_EDIT == res) {
7646-
wxGetApp().params_dialog()->Popup(true);
7646+
wxGetApp().params_dialog()->Popup();
76477647
}
76487648
}
76497649

0 commit comments

Comments
 (0)