diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 258a7d253..441bf410c 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -1329,6 +1329,14 @@ int PresetCollection::get_differed_values_to_update(Preset& preset, std::map 350 * 1024) return -2; + return 0; } diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 7928fe7bf..c1c2b2f3c 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -4947,7 +4947,7 @@ void GUI_App::sync_preset(Preset* preset) } } else { - BOOST_LOG_TRIVIAL(trace) << "[sync_preset]init: can not generate differed key-values"; + BOOST_LOG_TRIVIAL(info) << "[sync_preset]init: can not generate differed key-values and code: " << ret; result = 0; updated_info = "hold"; } @@ -4977,7 +4977,11 @@ void GUI_App::sync_preset(Preset* preset) } } else { - BOOST_LOG_TRIVIAL(trace) << "[sync_preset]create: can not generate differed preset"; + BOOST_LOG_TRIVIAL(info) << "[sync_preset]create: can not generate differed preset and code: " << ret; + if (ret == -2) { + result = 0; + updated_info = "hold"; + } } } else if (preset->sync_info.compare("update") == 0) { @@ -5004,8 +5008,9 @@ void GUI_App::sync_preset(Preset* preset) } else { - BOOST_LOG_TRIVIAL(trace) << "[sync_preset]update: can not generate differed key-values, we need to skip this preset "<< preset->name; + BOOST_LOG_TRIVIAL(info) << "[sync_preset]update: can not generate differed key-values, we need to skip this preset " << preset->name << " code: " << ret; result = 0; + if (ret == -2) updated_info = "hold"; } } else { diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 160e64ea6..5ad13f7c0 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1868,6 +1868,15 @@ void Tab::update_preset_description_line() m_parent->Layout(); } +static void validate_custom_note_cb(Tab *tab, ConfigOptionsGroupShp opt_group, const t_config_option_key &opt_key, const boost::any &value) +{ + if (boost::any_cast(value).size() > 40 * 1024) { + MessageDialog dialog(static_cast(wxGetApp().mainframe), _L("The notes are too large, and may not be synchronized to the cloud. Please keep it within 40k."), + "", wxICON_WARNING | wxOK); + dialog.ShowModal(); + } +} + void Tab::update_frequently_changed_parameters() { const bool is_fff = supports_printer_technology(ptFFF); @@ -2159,6 +2168,7 @@ void TabPrint::build() option.opt.is_code = true; option.opt.height = 15; optgroup->append_single_option_line(option); + optgroup->m_on_change = [this, optgroup](const t_config_option_key &opt_key, const boost::any &value) { validate_custom_note_cb(this, optgroup, opt_key, value); }; optgroup = page->new_optgroup(L("Notes"),"note"); optgroup->label_width = 0; @@ -2166,6 +2176,7 @@ void TabPrint::build() option.opt.full_width = true; option.opt.height = 25; optgroup->append_single_option_line(option); + optgroup->m_on_change = [this, optgroup](const t_config_option_key &opt_key, const boost::any &value) { validate_custom_note_cb(this, optgroup, opt_key, value); }; #if 0 //page = add_options_page(L("Dependencies"), "advanced.png"); @@ -2848,6 +2859,10 @@ static void validate_custom_gcode_cb(Tab* tab, ConfigOptionsGroupShp opt_group, tab->validate_custom_gcodes_was_shown = !Tab::validate_custom_gcode(opt_group->title, boost::any_cast(value)); tab->update_dirty(); tab->on_value_change(opt_key, value); + if (boost::any_cast(value).size() > 40 * 1024) { + MessageDialog dialog(static_cast(wxGetApp().mainframe), _L("Custom G-code files are too large, and may not be synchronized to the cloud. Please keep it within 40k."), "", wxICON_WARNING | wxOK); + dialog.ShowModal(); + } } void TabFilament::add_filament_overrides_page() @@ -3168,6 +3183,7 @@ void TabFilament::build() option.opt.full_width = true; option.opt.height = notes_field_height; optgroup->append_single_option_line(option); + optgroup->m_on_change = [this, optgroup](const t_config_option_key &opt_key, const boost::any &value) { validate_custom_note_cb(this, optgroup, opt_key, value); }; //BBS #if 0 @@ -3607,7 +3623,7 @@ void TabPrinter::build_fff() option.opt.full_width = true; option.opt.height = notes_field_height; optgroup->append_single_option_line(option); - + optgroup->m_on_change = [this, optgroup](const t_config_option_key &opt_key, const boost::any &value) { validate_custom_note_cb(this, optgroup, opt_key, value); }; build_unregular_pages(true); }