FIX: [4857 5097] export list and del preset two confirm issue

Jira: 4857 5097

Change-Id: If7cc4967a663f575527a227e9c4ac31e0491930c
This commit is contained in:
maosheng.wei 2023-11-05 15:11:30 +08:00 committed by Lane.Wei
parent 05d714814f
commit 086178fbb4
2 changed files with 7 additions and 6 deletions

View File

@ -1984,7 +1984,7 @@ bool CreatePrinterPresetDialog::load_system_and_user_presets_with_curr_model(Pre
temp_preset_bundle.load_vendor_configs_from_json(preset_path, selected_vendor_id, PresetBundle::LoadConfigBundleAttribute::LoadSystem,
ForwardCompatibilitySubstitutionRule::EnableSilent);
} catch (...) {
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "load vendor fonfigs form json failed";
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "load template vendor configs form json failed";
MessageDialog dlg(this, _L("The printer model was not found, please reselect."), wxString(SLIC3R_APP_FULL_NAME) + " - " + _L("Info"),
wxYES_NO | wxYES_DEFAULT | wxCENTRE);
dlg.ShowModal();
@ -3429,8 +3429,8 @@ void ExportConfigsDialog::select_curr_radiobox(std::vector<std::pair<RadioBox *,
if (export_type == m_exprot_type.preset_bundle) {
for (std::pair<std::string, Preset *> preset : m_printer_presets) {
std::string preset_name = preset.first;
//printer preset mast have user's filament or process preset
if (m_filament_presets.find(preset_name) == m_filament_presets.end() && m_process_presets.find(preset_name) == m_process_presets.end()) continue;
//printer preset mast have user's filament or process preset or printer preset is user preset
if (m_filament_presets.find(preset_name) == m_filament_presets.end() && m_process_presets.find(preset_name) == m_process_presets.end() && preset.second->is_system) continue;
wxString printer_name = wxString::FromUTF8(preset_name);
m_preset_sizer->Add(create_checkbox(m_presets_window, preset.second, printer_name, m_preset), 0, wxEXPAND | wxTOP | wxLEFT | wxRIGHT, FromDIP(5));
}

View File

@ -5005,7 +5005,7 @@ void Tab::delete_preset()
//std::string action = current_preset.is_external ? _utf8(L("remove")) : _utf8(L("delete"));
// TRN remove/delete
wxString msg;
bool confirm_delete_third_party_printer = false;
if (m_presets->get_preset_base(current_preset) == &current_preset) { //root preset
if (current_preset.type == Preset::Type::TYPE_PRINTER && !current_preset.is_system) { //Customize third-party printers
Preset &current_preset = m_presets->get_selected_preset();
@ -5024,6 +5024,7 @@ void Tab::delete_preset()
filament_preset_num, process_preset_num));
int res = dlg.ShowModal();
if (res != wxID_OK) return;
confirm_delete_third_party_printer = true;
}
int count = 0;
wxString presets;
@ -5091,9 +5092,9 @@ void Tab::delete_preset()
//action = current_preset.is_external ? _utf8(L("Remove")) : _utf8(L("Delete"));
// TRN Remove/Delete
wxString title = from_u8((boost::format(_utf8(L("%1% Preset"))) % action).str()); //action + _(L(" Preset"));
if (current_preset.is_default ||
if (current_preset.is_default || !(confirm_delete_third_party_printer ||
//wxID_YES != wxMessageDialog(parent(), msg, title, wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION).ShowModal())
wxID_YES != MessageDialog(parent(), msg, title, wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION).ShowModal())
wxID_YES == MessageDialog(parent(), msg, title, wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION).ShowModal()))
return;
// if we just delete preset from the physical printer