ENH: [STUDIO-1871] merge changes of user presets from other sessions

Change-Id: I2841ff4e23b18ebe7cdf374b69a494a4c05a49ee
This commit is contained in:
chunmao.guo 2023-01-09 14:13:14 +08:00 committed by Lane.Wei
parent e71b5a88b7
commit ae959b7400
4 changed files with 28 additions and 15 deletions

View file

@ -3939,9 +3939,9 @@ bool Tab::select_preset(std::string preset_name, bool delete_current /*=false*/,
try {
//BBS delete preset
Preset &current_preset = m_presets->get_selected_preset();
current_preset.sync_info = "delete";
if (!current_preset.setting_id.empty()) {
BOOST_LOG_TRIVIAL(info) << "delete preset = " << current_preset.name << ", setting_id = " << current_preset.setting_id;
m_presets->set_sync_info_and_save(current_preset.name, current_preset.setting_id, "delete");
wxGetApp().delete_preset_from_cloud(current_preset.setting_id);
}
BOOST_LOG_TRIVIAL(info) << boost::format("will delete current preset...");
@ -4559,14 +4559,6 @@ void Tab::delete_preset()
if (m_type == Preset::TYPE_PRINTER && !physical_printers.empty())
physical_printers.delete_preset_from_printers(current_preset.name);
//BBS delete preset
//will delete in select_preset
current_preset.sync_info = "delete";
if (!current_preset.setting_id.empty()) {
BOOST_LOG_TRIVIAL(info) << "delete preset = " << current_preset.name << ", setting_id = " << current_preset.setting_id;
wxGetApp().delete_preset_from_cloud(current_preset.setting_id);
}
// Select will handle of the preset dependencies, of saving & closing the depending profiles, and
// finally of deleting the preset.
this->select_preset("", true);