FIX: fix combobox and delete btn in filament setting enabled

Jira: XXXX

Change-Id: I8b659bd77ceb97c8cea9d3e5e931f4ea50822721
This commit is contained in:
maosheng.wei 2023-12-04 17:46:39 +08:00 committed by Lane.Wei
parent a4cd80ae2f
commit a1a7b77b0b
5 changed files with 9 additions and 5 deletions

View File

@ -1306,6 +1306,7 @@ int PresetCollection::get_differed_values_to_update(Preset& preset, std::map<std
key_values.erase(BBL_JSON_KEY_BASE_ID);
if (get_preset_base(preset) == &preset && !preset.filament_id.empty()) {
key_values[BBL_JSON_KEY_FILAMENT_ID] = preset.filament_id;
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " uploading user preset name is: " << preset.name << "and create filament id is: " << preset.filament_id;
}
}
key_values[BBL_JSON_KEY_UPDATE_TIME] = std::to_string(preset.updated_time);

View File

@ -451,6 +451,7 @@ static std::string get_filament_id(std::string vendor_typr_serial)
user_filament_id = "P" + calculate_md5(vendor_typr_serial + get_curr_time()).substr(0, 7);
}
}
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " filament name is: " << vendor_typr_serial << "and create filament id is: " << user_filament_id;
return user_filament_id;
}
@ -1483,8 +1484,8 @@ wxBoxSizer *CreatePrinterPresetDialog::create_step_switch_item()
horizontal_sizer->Add(divider_line, 0, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(3));
m_step_2 = new wxStaticBitmap(step_switch_panel, wxID_ANY, create_scaled_bitmap("step_2_ready", nullptr, FromDIP(20)), wxDefaultPosition, wxDefaultSize);
horizontal_sizer->Add(m_step_2, 0, wxEXPAND | wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(3));
wxStaticText *static_improt_presets_text = new wxStaticText(step_switch_panel, wxID_ANY, _L("Improt Preset"), wxDefaultPosition, wxDefaultSize);
horizontal_sizer->Add(static_improt_presets_text, 0, wxEXPAND | wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(3));
wxStaticText *static_import_presets_text = new wxStaticText(step_switch_panel, wxID_ANY, _L("Import Preset"), wxDefaultPosition, wxDefaultSize);
horizontal_sizer->Add(static_import_presets_text, 0, wxEXPAND | wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, FromDIP(3));
horizontal_sizer->Add(0, 0, 1, wxEXPAND, 0);
step_switch_panel->SetSizer(horizontal_sizer);

View File

@ -65,7 +65,7 @@ ParamsDialog::ParamsDialog(wxWindow * parent)
//wxGetApp().UpdateDlgDarkUI(this);
}
void ParamsDialog::Popup(bool just_edit)
void ParamsDialog::Popup()
{
wxGetApp().UpdateDlgDarkUI(this);
#ifdef __WIN32__
@ -73,6 +73,8 @@ void ParamsDialog::Popup(bool just_edit)
#endif
Center();
if (m_panel && m_panel->get_current_tab()) {
bool just_edit = false;
if (!m_editing_filament_id.empty()) just_edit = true;
dynamic_cast<Tab *>(m_panel->get_current_tab())->set_just_edit(just_edit);
}
Show();

View File

@ -29,7 +29,7 @@ public:
ParamsPanel * panel() { return m_panel; }
void Popup(bool just_edit = false);
void Popup();
void set_editing_filament_id(std::string id) { m_editing_filament_id = id; }

View File

@ -7643,7 +7643,7 @@ void Plater::priv::on_modify_filament(SimpleEvent &evt)
update_ui_from_settings();
sidebar->update_all_preset_comboboxes();
if (wxID_EDIT == res) {
wxGetApp().params_dialog()->Popup(true);
wxGetApp().params_dialog()->Popup();
}
}