diff --git a/src/libslic3r/AppConfig.cpp b/src/libslic3r/AppConfig.cpp index cf6cd95b40..2b805165d9 100644 --- a/src/libslic3r/AppConfig.cpp +++ b/src/libslic3r/AppConfig.cpp @@ -44,6 +44,7 @@ namespace Slic3r { static const std::string VERSION_CHECK_URL_STABLE = "https://api.github.com/repos/softfever/OrcaSlicer/releases/latest"; static const std::string VERSION_CHECK_URL = "https://api.github.com/repos/softfever/OrcaSlicer/releases"; +static const std::string PROFILE_UPDATE_URL = "https://api.github.com/repos/OrcaSlicer/orcaslicer-profiles/releases/tags"; static const std::string MODELS_STR = "models"; const std::string AppConfig::SECTION_FILAMENTS = "filaments"; @@ -1264,6 +1265,11 @@ std::string AppConfig::version_check_url(bool stable_only/* = false*/) const return from_settings.empty() ? stable_only ? VERSION_CHECK_URL_STABLE : VERSION_CHECK_URL : from_settings; } +std::string AppConfig::profile_update_url() const +{ + return PROFILE_UPDATE_URL; +} + bool AppConfig::exists() { return boost::filesystem::exists(config_path()); diff --git a/src/libslic3r/AppConfig.hpp b/src/libslic3r/AppConfig.hpp index b785ebf8af..49f33bcddd 100644 --- a/src/libslic3r/AppConfig.hpp +++ b/src/libslic3r/AppConfig.hpp @@ -249,6 +249,9 @@ public: // This returns a hardcoded string unless it is overriden by "version_check_url" in the ini file. std::string version_check_url(bool stable_only = false) const; + // Get the Orca profile update url. + std::string profile_update_url() const; + // Returns the original Slic3r version found in the ini file before it was overwritten // by the current version Semver orig_version() const { return m_orig_version; } diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 41e8a2c302..0d25babe12 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -1211,9 +1211,6 @@ void GUI_App::post_init() // This is ugly but I honestly found no better way to do it. // Neither wxShowEvent nor wxWindowCreateEvent work reliably. if (this->preset_updater) { // G-Code Viewer does not initialize preset_updater. - BOOST_LOG_TRIVIAL(info) << "before check_updates"; - this->check_updates(false); - BOOST_LOG_TRIVIAL(info) << "after check_updates"; CallAfter([this] { bool cw_showed = this->config_wizard_startup(); diff --git a/src/slic3r/Utils/PresetUpdater.cpp b/src/slic3r/Utils/PresetUpdater.cpp index 2c22465d43..29646ea5b4 100644 --- a/src/slic3r/Utils/PresetUpdater.cpp +++ b/src/slic3r/Utils/PresetUpdater.cpp @@ -1,6 +1,8 @@ #include "PresetUpdater.hpp" #include +#include +#include #include #include #include @@ -21,6 +23,7 @@ #include "libslic3r/format.hpp" #include "libslic3r/Utils.hpp" #include "libslic3r/PresetBundle.hpp" +#include "libslic3r_version.h" #include "slic3r/GUI/GUI.hpp" #include "slic3r/GUI/GUI_App.hpp" #include "slic3r/GUI/I18N.hpp" @@ -215,7 +218,7 @@ struct PresetUpdater::priv void sync_version() const; void parse_version_string(const std::string& body) const; void sync_resources(std::string http_url, std::map &resources, bool check_patch = false, std::string current_version="", std::string changelog_file=""); - void sync_config(std::string http_url, const VendorMap vendors); + void sync_config(); void sync_tooltip(std::string http_url, std::string language); void sync_plugins(std::string http_url, std::string plugin_version); void sync_printer_config(std::string http_url); @@ -251,8 +254,9 @@ PresetUpdater::priv::priv() void PresetUpdater::priv::set_download_prefs(AppConfig *app_config) { version_check_url = app_config->version_check_url(); - //TODO: for debug currently - if (version_check_url.empty()) + + auto profile_update_url = app_config->profile_update_url(); + if (!profile_update_url.empty()) enabled_config_update = true; else enabled_config_update = false; @@ -327,29 +331,29 @@ bool PresetUpdater::priv::extract_file(const fs::path &source_path, const fs::pa continue; } else if (stat.m_uncomp_size == 0) { - BOOST_LOG_TRIVIAL(warning) << "[BBL Updater]Unzip: invalid size for file "< resource_list; - BOOST_LOG_TRIVIAL(info) << boost::format("[BBL Updater]: sync_resources get preferred setting version for app version %1%, url: %2%, current_version_str %3%, check_patch %4%")%SLIC3R_APP_NAME%http_url%current_version_str%check_patch; + BOOST_LOG_TRIVIAL(info) << boost::format("[Orca Updater]: sync_resources get preferred setting version for app version %1%, url: %2%, current_version_str %3%, check_patch %4%")%SLIC3R_APP_NAME%http_url%current_version_str%check_patch; std::string query_params = "?"; bool first = true; @@ -491,7 +495,7 @@ void PresetUpdater::priv::sync_resources(std::string http_url, std::map(); @@ -515,7 +519,7 @@ void PresetUpdater::priv::sync_resources(std::string http_url, std::mapsecond.version; @@ -563,7 +567,7 @@ void PresetUpdater::priv::sync_resources(std::string http_url, std::mapsecond.url; std::string cache_file_path = (fs::temp_directory_path() / (fs::unique_path().string() + TMP_EXTENSION)).string(); - BOOST_LOG_TRIVIAL(info) << "[BBL Updater]Downloading resource: " << resource_name << ", version " << online_version.to_string(); + BOOST_LOG_TRIVIAL(info) << "[Orca Updater]Downloading resource: " << resource_name << ", version " << online_version.to_string(); if (!get_file(online_url, cache_file_path)) { - BOOST_LOG_TRIVIAL(warning) << "[BBL Updater]download resource " << resource_name << " failed, url: " << online_url; + BOOST_LOG_TRIVIAL(warning) << "[Orca Updater]download resource " << resource_name << " failed, url: " << online_url; continue; } if (cancel) { return; } @@ -584,24 +588,24 @@ void PresetUpdater::priv::sync_resources(std::string http_url, std::mapsecond; } else { - BOOST_LOG_TRIVIAL(warning) << boost::format("[BBL Updater]: online version=%1%, current_version=%2%, no need to download") % online_version.to_string() % current_version.to_string(); + BOOST_LOG_TRIVIAL(warning) << boost::format("[Orca Updater]: online version=%1%, current_version=%2%, no need to download") % online_version.to_string() % current_version.to_string(); } } } -//BBS: refine the Preset Updater logic -// Download vendor indices. Also download new bundles if an index indicates there's a new one available. -// Both are saved in cache. -void PresetUpdater::priv::sync_config(std::string http_url, const VendorMap vendors) +// Orca: sync config update for currect App version +void PresetUpdater::priv::sync_config() { - std::map> vendor_list; - std::map vendor_descriptions; + auto cache_profile_path = cache_path; + auto cache_profile_update_file = cache_path / "profiles_update.json"; + std::string asset_name; + if (fs::exists(cache_profile_update_file)) { + try { + boost::nowide::ifstream f(cache_profile_update_file.string()); + json data = json::parse(f); + if (data.contains("name")) + asset_name = data["name"].get(); + f.close(); + } catch (const std::exception& ex) { + BOOST_LOG_TRIVIAL(error) << "[Orca Updater]: failed to read profiles_update.json when sync_config: " << ex.what() << std::endl; + } catch (...) { + // catch any other errors (that we have no information about) + BOOST_LOG_TRIVIAL(error) << "[Orca Updater]: unknown failure when reading profiles_update.json in sync_config" << std::endl; + } + } + AppConfig *app_config = GUI::wxGetApp().app_config; - BOOST_LOG_TRIVIAL(info) << boost::format("[BBL Updater]: sync_config Syncing configuration enter"); + auto profile_update_url = app_config->profile_update_url() + "/" + SoftFever_VERSION; + // parse the assets section and get the latest asset by comparing the name - if (!enabled_config_update) { return; } - - BOOST_LOG_TRIVIAL(info) << boost::format("[BBL Updater]: sync_config get preferred setting version for app version %1%, http_url: %2%")%SLIC3R_VERSION%http_url; - - std::string app_version = SLIC3R_VERSION; - std::string query_version = app_version.substr(0, 6) + "00.00"; - std::string query_params = "?"; - std::string vendor_string = PresetBundle::BBL_BUNDLE; - boost::to_lower(vendor_string); - std::string query_vendor = (boost::format("slicer/settings/%1%=%2%")%vendor_string % query_version ).str(); - query_params += query_vendor; - /*bool first = true; - for (auto vendor_it :vendors) { - if (cancel) { return; } - - const VendorProfile& vendor_profile = vendor_it.second; - std::string vendor_name = vendor_profile.id; - boost::to_lower(vendor_name); - - std::string query_vendor = (boost::format("slicer/settings/%1%=%2%") - % vendor_name - % GUI::VersionInfo::convert_full_version(SLIC3R_VERSION) - ).str(); - if (!first) - query_params += "&"; - query_params += query_vendor; - }*/ - - std::string url = http_url; - url += query_params; - Slic3r::Http http = Slic3r::Http::get(url); - BOOST_LOG_TRIVIAL(info) << boost::format("[BBL Updater]: sync_config request_url: %1%")%url; - http.on_progress([this](Slic3r::Http::Progress, bool &cancel_http) { - if (cancel) { - cancel_http = true; + Http::get(profile_update_url) + .on_error([cache_profile_path, cache_profile_update_file](std::string body, std::string error, unsigned http_status) { + // Orca: we check the response body to see if it's "Not Found", if so, it means for the current Orca version we don't have OTA + // updates, we can delete the cache file + if (!body.empty()) { + try { + json j = json::parse(body); + if (j.contains("message") && j["message"].get() == "Not Found") { + // The current Orca version does not have any OTA updates, delete the cache file + if (fs::exists(cache_profile_path / "profiles")) + fs::remove_all(cache_profile_path / "profiles"); + if (fs::exists(cache_profile_update_file)) + fs::remove(cache_profile_update_file); + } + } catch (...) {} } + BOOST_LOG_TRIVIAL(error) << format("Error getting: `%1%`: HTTP %2%, %3%", "sync_config_orca", http_status, error); }) - .on_complete( - [this, &vendor_list, &vendor_descriptions, vendors](std::string body, unsigned) { + .timeout_connect(5) + .on_complete([this, asset_name, cache_profile_path, cache_profile_update_file](std::string body, unsigned http_status) { + // Http response OK + if (http_status != 200) + return; try { - BOOST_LOG_TRIVIAL(info) << "[BBL Updater]::body=" << body; - json j = json::parse(body); - std::string message = j["message"].get(); - if (message == "success") { - json resource =j.at("resources"); - if (resource.is_array()) { - for (auto iter = resource.begin(); iter != resource.end(); iter++) { - Semver version; - std::string url; - std::string type; - std::string vendor; - std::string description; - for (auto sub_iter = iter.value().begin(); sub_iter != iter.value().end(); sub_iter++) { - if (boost::iequals(sub_iter.key(),"type")) { - type = sub_iter.value(); - BOOST_LOG_TRIVIAL(trace) << "[BBL Updater]: get version of settings's type, " << sub_iter.value(); - } - else if (boost::iequals(sub_iter.key(),"version")) { - version = *(Semver::parse(sub_iter.value())); - } - else if (boost::iequals(sub_iter.key(),"description")) { - description = sub_iter.value(); - } - else if (boost::iequals(sub_iter.key(),"url")) { - url = sub_iter.value(); - } - } - BOOST_LOG_TRIVIAL(info) << "[BBL Updater]: get type "<< type <<", version "<() == "Not Found")) { + json assets = j.at("assets"); + if (assets.is_array()) { + for (auto asset : assets) { + std::string name = asset["name"].get(); + int versionNumber = -1; + std::regex regexPattern("orcaslicer-profiles_ota_.*\\.([0-9]+)\\.zip$"); + std::smatch matches; + if (std::regex_search(name, matches, regexPattern) && matches.size() > 1) { + versionNumber = std::stoi(matches[1].str()); } - if (!vendor.empty()) { - vendor_list.emplace(vendor, std::pair(version, url)); - vendor_descriptions.emplace(vendor, description); + if (versionNumber > 0 && versionNumber > latest_update.ver) { + latest_update.url = asset["browser_download_url"].get(); + latest_update.name = name; + latest_update.ver = versionNumber; } } } } - else { - BOOST_LOG_TRIVIAL(error) << "[BBL Updater]: get version of settings failed, body=" << body; + + if (cancel) + return; + + if (latest_update.ver > 0) { + if (latest_update.name == asset_name) + return; + if (fs::exists(cache_profile_path / "profiles")) + fs::remove_all(cache_profile_path / "profiles"); + fs::create_directories(cache_profile_path / "profiles"); + // download the file + std::string download_url = latest_update.url; + std::string download_file = (cache_path / (latest_update.name + TMP_EXTENSION)).string(); + if (!get_file(download_url, download_file)) { + return; + } + + // extract the file downloaded + BOOST_LOG_TRIVIAL(info) << "[Orca Updater]start to unzip the downloaded file " << download_file; + if (!extract_file(download_file, cache_profile_path)) { + BOOST_LOG_TRIVIAL(warning) << "[Orca Updater]extract downloaded file" + << " failed, path: " << download_file; + return; + } + BOOST_LOG_TRIVIAL(info) << "[Orca Updater]finished unzip the downloaded file " << download_file; + boost::nowide::ofstream f(cache_profile_update_file.string()); + json data; + data["name"] = latest_update.name; + f << data << std::endl; + f.close(); + } else { + // The current Orca version does not have any OTA updates, delete the cache file + if (fs::exists(cache_profile_path / "profiles")) + fs::remove_all(cache_profile_path / "profiles"); + if (fs::exists(cache_profile_update_file)) + fs::remove(cache_profile_update_file); } - } - catch (std::exception& e) { - BOOST_LOG_TRIVIAL(error) << (boost::format("[BBL Updater]: get version of settings failed, exception=%1% body=%2%") - % e.what() - % body).str(); - } - catch (...) { - BOOST_LOG_TRIVIAL(error) << "[BBL Updater]: get version of settings failed,, body=" << body; - } - } - ) - .on_error([&](std::string body, std::string error, unsigned status) { - BOOST_LOG_TRIVIAL(error) << boost::format("[BBL Updater]: status=%1%, error=%2%, body=%3%") - % status - % error - % body; - } - ) - .perform_sync(); - for (auto vendor_it :vendors) { - if (cancel) { return; } - - const VendorProfile& vendor_profile = vendor_it.second; - std::string vendor_name = vendor_profile.id; - auto vendor_update = vendor_list.find(vendor_name); - if (vendor_update == vendor_list.end()) { - BOOST_LOG_TRIVIAL(info) << "[BBL Updater]Vendor " << vendor_name << " can not get setting versions online"; - continue; - } - Semver online_version = vendor_update->second.first; - //Semver current_version = get_version_from_json(vendor_root_config.string()); - Semver current_version = vendor_profile.config_version; - bool version_match = ((online_version.maj() == current_version.maj()) && (online_version.min() == current_version.min())); - if (version_match && (current_version < online_version)) { - auto cache_file = cache_path / (vendor_name+".json"); - auto cache_print_dir = (cache_path / vendor_name / PRESET_PRINT_NAME); - auto cache_filament_dir = (cache_path / vendor_name / PRESET_FILAMENT_NAME); - auto cache_machine_dir = (cache_path / vendor_name / PRESET_PRINTER_NAME); - - if (( fs::exists(cache_file)) - &&( fs::exists(cache_print_dir)) - &&( fs::exists(cache_filament_dir)) - &&( fs::exists(cache_machine_dir))) { - Semver version = get_version_from_json(cache_file.string()); - bool cached_version_match = ((online_version.maj() == version.maj()) && (online_version.min() == version.min())); - if (cached_version_match && (version >= online_version)) { - //already downloaded before - BOOST_LOG_TRIVIAL(info) << "[BBL Updater]Vendor " << vendor_name << ", already cached a version "<second.second; - std::string cache_file_path = (cache_path / (vendor_name + TMP_EXTENSION)).string(); - BOOST_LOG_TRIVIAL(info) << "[BBL Updater]Downloading online settings for vendor: " << vendor_name<<", version "<second << std::endl; - c.close(); - } - } - } + } catch (...) {} + }) + .perform_sync(); } void PresetUpdater::priv::sync_tooltip(std::string http_url, std::string language) @@ -851,7 +782,7 @@ void PresetUpdater::priv::sync_tooltip(std::string http_url, std::string languag } } catch (std::exception& e) { - BOOST_LOG_TRIVIAL(warning) << format("[BBL Updater] sync_tooltip: %1%", e.what()); + BOOST_LOG_TRIVIAL(warning) << format("[Orca Updater] sync_tooltip: %1%", e.what()); } } @@ -989,12 +920,12 @@ void PresetUpdater::priv::sync_plugins(std::string http_url, std::string plugin_ sync_resources(http_url, resources, true, plugin_version, "network_plugins.json"); } catch (std::exception& e) { - BOOST_LOG_TRIVIAL(warning) << format("[BBL Updater] sync_plugins: %1%", e.what()); + BOOST_LOG_TRIVIAL(warning) << format("[Orca Updater] sync_plugins: %1%", e.what()); } bool result = get_cached_plugins_version(cached_version); if (result) { - BOOST_LOG_TRIVIAL(info) << format("[BBL Updater] found new plugins: %1%, prompt to update", cached_version); + BOOST_LOG_TRIVIAL(info) << format("[Orca Updater] found new plugins: %1%, prompt to update", cached_version); GUI::wxGetApp().plater()->get_notification_manager()->push_notification(GUI::NotificationType::BBLPluginUpdateAvailable); } } @@ -1044,7 +975,7 @@ void PresetUpdater::priv::sync_printer_config(std::string http_url) std::map resources{{"slicer/printer/bbl", {using_version, "", "", cache_folder.string()}}}; sync_resources(http_url, resources, false, cached_version, "printer.json"); } catch (std::exception &e) { - BOOST_LOG_TRIVIAL(warning) << format("[BBL Updater] sync_printer_config: %1%", e.what()); + BOOST_LOG_TRIVIAL(warning) << format("[Orca Updater] sync_printer_config: %1%", e.what()); } bool result = false; @@ -1054,7 +985,7 @@ void PresetUpdater::priv::sync_printer_config(std::string http_url) result = true; } catch (...) {} if (result) { - BOOST_LOG_TRIVIAL(info) << format("[BBL Updater] found new printer config: %1%, prompt to update", cached_version); + BOOST_LOG_TRIVIAL(info) << format("[Orca Updater] found new printer config: %1%, prompt to update", cached_version); waiting_printer_updates = get_printer_config_updates(true); if (waiting_printer_updates.updates.size() > 0) { has_waiting_printer_updates = true; @@ -1096,7 +1027,7 @@ bool PresetUpdater::priv::install_bundles_rsrc(std::vector bundles, // Install indicies from resources. Only installs those that are either missing or older than in resources. void PresetUpdater::priv::check_installed_vendor_profiles() const { - BOOST_LOG_TRIVIAL(info) << "[BBL Updater]:Checking whether the profile from resource is newer"; + BOOST_LOG_TRIVIAL(info) << "[Orca Updater]:Checking whether the profile from resource is newer"; AppConfig *app_config = GUI::wxGetApp().app_config; const auto enabled_vendors = app_config->vendors(); @@ -1120,7 +1051,7 @@ void PresetUpdater::priv::check_installed_vendor_profiles() const bool version_match = ((resource_ver.maj() == vendor_ver.maj()) && (resource_ver.min() == vendor_ver.min())); if (!version_match || (vendor_ver < resource_ver)) { - BOOST_LOG_TRIVIAL(info) << "[BBL Updater]:found vendor "<>changelog; ifs.close(); } @@ -1251,15 +1184,13 @@ Updates PresetUpdater::priv::get_config_updates(const Semver &old_slic3r_version if (version_match && (vendor_ver < cache_ver)) { Semver app_ver = *Semver::parse(SLIC3R_VERSION); if (cache_ver.maj() == app_ver.maj()){ - BOOST_LOG_TRIVIAL(info) << "[BBL Updater]:need to update settings from "<cancel) return; if (!vendors.empty()) { - this->p->sync_config(http_url, std::move(vendors)); + this->p->sync_config(); if (p->cancel) return; GUI::wxGetApp().CallAfter([] { @@ -1413,81 +1344,50 @@ static bool reload_configs_update_gui() return true; } -//BBS: refine the preset updater logic + PresetUpdater::UpdateResult PresetUpdater::config_update(const Semver& old_slic3r_version, UpdateParams params) const { if (! p->enabled_config_update) { return R_NOOP; } auto updates = p->get_config_updates(old_slic3r_version); - //if (updates.incompats.size() > 0) { - // BOOST_LOG_TRIVIAL(info) << format("%1% bundles incompatible. Asking for action...", updates.incompats.size()); - // std::unordered_map incompats_map; - // for (const auto &incompat : updates.incompats) { - // const auto min_slic3r = incompat.version.min_slic3r_version; - // const auto max_slic3r = incompat.version.max_slic3r_version; - // wxString restrictions; - // if (min_slic3r != Semver::zero() && max_slic3r != Semver::inf()) { - // restrictions = GUI::format_wxstr(_L("requires min. %s and max. %s"), - // min_slic3r.to_string(), - // max_slic3r.to_string()); - // } else if (min_slic3r != Semver::zero()) { - // restrictions = GUI::format_wxstr(_L("requires min. %s"), min_slic3r.to_string()); - // BOOST_LOG_TRIVIAL(debug) << "Bundle is not downgrade, user will now have to do whole wizard. This should not happen."; - // } else { - // restrictions = GUI::format_wxstr(_L("requires max. %s"), max_slic3r.to_string()); - // } - - // incompats_map.emplace(std::make_pair(incompat.vendor, std::move(restrictions))); - // } - - // GUI::MsgDataIncompatible dlg(std::move(incompats_map)); - // const auto res = dlg.ShowModal(); - // if (res == wxID_REPLACE) { - // BOOST_LOG_TRIVIAL(info) << "User wants to re-configure..."; - - // // This effectively removes the incompatible bundles: - // // (snapshot is taken beforehand) - // if (! p->perform_updates(std::move(updates)) || - // ! GUI::wxGetApp().run_wizard(GUI::ConfigWizard::RR_DATA_INCOMPAT)) - // return R_INCOMPAT_EXIT; - - // return R_INCOMPAT_CONFIGURED; - // } - // else { - // BOOST_LOG_TRIVIAL(info) << "User wants to exit Slic3r, bye..."; - // return R_INCOMPAT_EXIT; - // } - - //} else if (updates.updates.size() > 0) { bool force_update = false; for (const auto& update : updates.updates) { force_update = (update.forced_update ? true : force_update); - //td::cout << update.forced_update << std::endl; - //BOOST_LOG_TRIVIAL(info) << format("Update requires higher version."); } //forced update if (force_update) { - BOOST_LOG_TRIVIAL(info) << format("[BBL Updater]:Force updating will start, size %1% ", updates.updates.size()); + BOOST_LOG_TRIVIAL(info) << format("[Orca Updater]:Force updating will start, size %1% ", updates.updates.size()); + std::vector bundles; + for (const auto& update : updates.updates) { + if (update.is_directory) + continue; + bundles.push_back(update.vendor); + } bool ret = p->perform_updates(std::move(updates)); if (!ret) { - BOOST_LOG_TRIVIAL(warning) << format("[BBL Updater]:perform_updates failed"); + BOOST_LOG_TRIVIAL(warning) << format("[Orca Updater]:perform_updates failed"); return R_INCOMPAT_EXIT; } ret = reload_configs_update_gui(); if (!ret) { - BOOST_LOG_TRIVIAL(warning) << format("[BBL Updater]:reload_configs_update_gui failed"); + BOOST_LOG_TRIVIAL(warning) << format("[Orca Updater]:reload_configs_update_gui failed"); return R_INCOMPAT_EXIT; } - Semver cur_ver = GUI::wxGetApp().preset_bundle->get_vendor_profile_version(PresetBundle::BBL_BUNDLE); - - GUI::wxGetApp().plater()->get_notification_manager()->push_notification(GUI::NotificationType::PresetUpdateFinished, GUI::NotificationManager::NotificationLevel::ImportantNotificationLevel, _u8L("Configuration package updated to ")+cur_ver.to_string()); - + for(auto b : bundles){ + Semver cur_ver = GUI::wxGetApp().preset_bundle->get_vendor_profile_version(b); + GUI::wxGetApp() + .plater() + ->get_notification_manager() + ->push_notification(GUI::NotificationType::PresetUpdateFinished, + GUI::NotificationManager::NotificationLevel::ImportantNotificationLevel, + _u8L("Configuration package: ") + b + _u8L(" updated to ") + cur_ver.to_string()); + } return R_UPDATE_INSTALLED; } @@ -1497,11 +1397,10 @@ PresetUpdater::UpdateResult PresetUpdater::config_update(const Semver& old_slic3 GUI::wxGetApp().plater()->get_notification_manager()->push_notification(GUI::NotificationType::PresetUpdateAvailable); } else { - BOOST_LOG_TRIVIAL(info) << format("[BBL Updater]:Configuration package available. size %1%, need to confirm...", p->waiting_updates.updates.size()); + BOOST_LOG_TRIVIAL(info) << format("[Orca Updater]:Configuration package available. size %1%, need to confirm...", p->waiting_updates.updates.size()); std::vector updates_msg; for (const auto& update : updates.updates) { - //BBS: skip directory if (update.is_directory) continue; std::string changelog = update.change_log; @@ -1512,14 +1411,14 @@ PresetUpdater::UpdateResult PresetUpdater::config_update(const Semver& old_slic3 const auto res = dlg.ShowModal(); if (res == wxID_OK) { - BOOST_LOG_TRIVIAL(debug) << "[BBL Updater]:selected yes to update"; + BOOST_LOG_TRIVIAL(debug) << "[Orca Updater]:selected yes to update"; if (! p->perform_updates(std::move(updates)) || ! reload_configs_update_gui()) return R_ALL_CANCELED; return R_UPDATE_INSTALLED; } else { - BOOST_LOG_TRIVIAL(info) << "[BBL Updater]:selected no for updating"; + BOOST_LOG_TRIVIAL(info) << "[Orca Updater]:selected no for updating"; if (params == UpdateParams::FORCED_BEFORE_WIZARD && res == wxID_CANCEL) return R_ALL_CANCELED; return R_UPDATE_REJECT; @@ -1528,7 +1427,7 @@ PresetUpdater::UpdateResult PresetUpdater::config_update(const Semver& old_slic3 // MsgUpdateConfig will show after the notificaation is clicked } else { - BOOST_LOG_TRIVIAL(info) << "[BBL Updater]:No configuration updates available."; + BOOST_LOG_TRIVIAL(info) << "[Orca Updater]:No configuration updates available."; } return R_NOOP;