diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 8f06fdc40..ce6c58796 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -4479,8 +4479,8 @@ void GUI_App::sync_preset(Preset* preset) if (preset->is_custom_defined()) return; auto setting_id = preset->setting_id; + std::map values_map; if (setting_id.empty() && preset->sync_info.empty()) { - std::map values_map; int ret = preset_bundle->get_differed_values_to_update(*preset, values_map); if (!ret) { std::string new_setting_id = m_agent->request_setting_id(preset->name, &values_map, &http_code); @@ -4494,6 +4494,7 @@ void GUI_App::sync_preset(Preset* preset) if (http_code >= 400) { result = 0; updated_info = "hold"; + values_map.clear(); } else result = -1; @@ -4506,7 +4507,6 @@ void GUI_App::sync_preset(Preset* preset) } } else if (preset->sync_info.compare("create") == 0) { - std::map values_map; int ret = preset_bundle->get_differed_values_to_update(*preset, values_map); if (!ret) { std::string new_setting_id = m_agent->request_setting_id(preset->name, &values_map, &http_code); @@ -4531,7 +4531,6 @@ void GUI_App::sync_preset(Preset* preset) } else if (preset->sync_info.compare("update") == 0) { if (!setting_id.empty()) { - std::map values_map; int ret = preset_bundle->get_differed_values_to_update(*preset, values_map); if (!ret) { if (values_map[BBL_JSON_KEY_BASE_ID] == setting_id) { @@ -4578,6 +4577,11 @@ void GUI_App::sync_preset(Preset* preset) preset_bundle->printers.set_sync_info_and_save(preset->name, setting_id, updated_info, update_time); } } + if (http_code >= 400 && values_map["code"] == "14") { // Limit + auto msg = wxString::Format(_L("An error occurred when uploading user presets, affecting the synchronization of user presets on other devices.\n" + "Error message: %s"), from_u8(values_map["error"])); + MessageDialog(mainframe, msg, _L("Sync user presets"), wxICON_WARNING | wxOK).ShowModal(); + } } void GUI_App::start_sync_user_preset(bool with_progress_dlg)