From 1947fd155152f0beea06f4adef0576ea7e387f90 Mon Sep 17 00:00:00 2001 From: alves Date: Wed, 31 Dec 2025 15:07:28 +0800 Subject: [PATCH] feature remove not work code --- src/slic3r/GUI/GUI_App.cpp | 7 +++++++ src/slic3r/GUI/GUI_App.hpp | 1 + src/slic3r/GUI/MainFrame.cpp | 11 +++++++++++ src/slic3r/Utils/PresetUpdater.cpp | 21 +++------------------ 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index abfb91661f..c5649d002e 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -4724,6 +4724,13 @@ void maybe_attach_updater_signature(Http& http, const std::string& canonical_que } // namespace +bool GUI_App::check_preset_version() +{ + bool is_newest_version = false; + + + return is_newest_version; +} void GUI_App::check_new_version_sf(bool show_tips, bool by_user) { std::string update_url = ""; diff --git a/src/slic3r/GUI/GUI_App.hpp b/src/slic3r/GUI/GUI_App.hpp index ec2a8922fd..07e820a42f 100644 --- a/src/slic3r/GUI/GUI_App.hpp +++ b/src/slic3r/GUI/GUI_App.hpp @@ -578,6 +578,7 @@ private: bool m_studio_active = true; std::chrono::system_clock::time_point last_active_point; + bool check_preset_version(); void check_new_version_sf(bool show_tips = false, bool by_user = false); void process_network_msg(std::string dev_id, std::string msg); void enter_force_upgrade(); diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 5c2e217e85..6366cbf428 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -2297,6 +2297,17 @@ static wxMenu* generate_help_menu() return true; }); + append_menu_item( + helpMenu, wxID_ANY, _L("Check for Preset Update"), _L("Check for Preset Update"), + [](wxCommandEvent&) { + + wxString msg = _L("This is the newest version."); + InfoDialog dlg(nullptr, _L("Info"), msg); + dlg.ShowModal(); + }, + "", nullptr, []() { return true; }); + + append_menu_item(helpMenu, wxID_ANY, _L("Import Profile"), _L("Import Profile"), [](wxCommandEvent&) { wxGetApp().import_presets(); }); diff --git a/src/slic3r/Utils/PresetUpdater.cpp b/src/slic3r/Utils/PresetUpdater.cpp index 5ae6f5c454..709568900f 100644 --- a/src/slic3r/Utils/PresetUpdater.cpp +++ b/src/slic3r/Utils/PresetUpdater.cpp @@ -712,22 +712,7 @@ bool PresetUpdater::priv::download_file(const std::string& url, void PresetUpdater::priv::sync_config() { 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; // auto profile_update_url = app_config->profile_update_url() + "/" + Snapmaker_VERSION; @@ -735,13 +720,13 @@ void PresetUpdater::priv::sync_config() // parse the assets section and get the latest asset by comparing the name Http::get(profile_update_url) - .on_error([cache_profile_path, cache_profile_update_file](std::string body, std::string error, unsigned http_status) { + .on_error([cache_profile_path ](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 BOOST_LOG_TRIVIAL(info) << format("Error getting: `%1%`: HTTP %2%, %3%", "sync_config_orca", http_status, error); }) .timeout_connect(5) - .on_complete([this, asset_name, cache_profile_path, cache_profile_update_file](std::string body, unsigned http_status) { + .on_complete([this, cache_profile_path](std::string body, unsigned http_status) { // Http response OK if (http_status != 200) return;