1189{
1190 if (!
p->enabled_config_update) {
return R_NOOP; }
1191
1192 auto updates =
p->get_config_updates(old_slic3r_version);
1193 if (
updates.incompats.size() > 0) {
1194 BOOST_LOG_TRIVIAL(info) <<
format(
"%1% bundles incompatible. Asking for action...",
updates.incompats.size());
1195
1196 std::unordered_map<std::string, wxString> incompats_map;
1197 for (
const auto &incompat :
updates.incompats) {
1198 const auto min_slic3r = incompat.version.min_slic3r_version;
1199 const auto max_slic3r = incompat.version.max_slic3r_version;
1200 wxString restrictions;
1203 min_slic3r.to_string(),
1204 max_slic3r.to_string());
1207 BOOST_LOG_TRIVIAL(debug) << "Bundle is not downgrade, user will now have to do whole wizard. This should not happen.";
1208 } else {
1210 }
1211
1212 incompats_map.emplace(std::make_pair(incompat.vendor, std::move(restrictions)));
1213 }
1214
1215 GUI::MsgDataIncompatible dlg(std::move(incompats_map));
1216 const auto res = dlg.ShowModal();
1217 if (res == wxID_REPLACE) {
1218 BOOST_LOG_TRIVIAL(info) << "User wants to re-configure...";
1219
1220
1221
1222 if (!
p->perform_updates(std::move(
updates)) ||
1225
1227 }
1228 else {
1229 BOOST_LOG_TRIVIAL(info) << "User wants to exit Slic3r, bye...";
1231 }
1232
1233 }
else if (
updates.updates.size() > 0) {
1234
1235 bool incompatible_version = false;
1237 incompatible_version = (update.forced_update ? true : incompatible_version);
1238
1239
1240 }
1241
1242
1243 if (incompatible_version)
1244 {
1245 BOOST_LOG_TRIVIAL(info) <<
format(
"Update of %1% bundles available. At least one requires higher version of Slicer.",
updates.updates.size());
1246
1247 std::vector<GUI::MsgUpdateForced::Update> updates_msg;
1249 std::string changelog_url = update.version.config_version.prerelease() == nullptr ? update.changelog_url : std::string();
1250 updates_msg.emplace_back(update.vendor, update.version.config_version, update.version.comment, std::move(changelog_url));
1251 }
1252
1253 GUI::MsgUpdateForced dlg(updates_msg);
1254
1255 const auto res = dlg.ShowModal();
1256 if (res == wxID_OK) {
1257 BOOST_LOG_TRIVIAL(info) << "User wants to update...";
1258 if (!
p->perform_updates(std::move(
updates)) ||
1262 }
1263 else {
1264 BOOST_LOG_TRIVIAL(info) << "User wants to exit Slic3r, bye...";
1266 }
1267 }
1268
1269
1273 }
1274 else {
1275 BOOST_LOG_TRIVIAL(info) <<
format(
"Update of %1% bundles available. Asking for confirmation ...",
p->waiting_updates.updates.size());
1276
1277 std::vector<GUI::MsgUpdateConfig::Update> updates_msg;
1279 std::string changelog_url = update.version.config_version.prerelease() == nullptr ? update.changelog_url : std::string();
1280 updates_msg.emplace_back(update.vendor, update.version.config_version, update.version.comment, std::move(changelog_url));
1281 }
1282
1284
1285 const auto res = dlg.ShowModal();
1286 if (res == wxID_OK) {
1287 BOOST_LOG_TRIVIAL(debug) << "User agreed to perform the update";
1288 if (!
p->perform_updates(std::move(
updates)) ||
1292 }
1293 else {
1294 BOOST_LOG_TRIVIAL(info) << "User refused the update";
1298 }
1299 }
1300
1301
1302 } else {
1303 BOOST_LOG_TRIVIAL(info) << "No configuration updates available.";
1304 }
1305
1307}
@ RR_DATA_INCOMPAT
Definition ConfigWizard.hpp:57
static const Semver zero()
Definition Semver.hpp:68
static const Semver inf()
Definition Semver.hpp:70
static LISTID updates
Definition main.c:186
wxString format_wxstr(const char *fmt, TArgs &&... args)
Definition format.hpp:42
static bool reload_configs_update_gui()
Definition PresetUpdater.cpp:1169
std::string format(const char *fmt, TArgs &&... args)
Definition format.hpp:44
#define _L(s)
Definition I18N.hpp:3