mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-28 05:12:27 +00:00
feature remove not work code
This commit is contained in:
@@ -4724,6 +4724,13 @@ void maybe_attach_updater_signature(Http& http, const std::string& canonical_que
|
|||||||
|
|
||||||
} // namespace
|
} // 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)
|
void GUI_App::check_new_version_sf(bool show_tips, bool by_user)
|
||||||
{
|
{
|
||||||
std::string update_url = "";
|
std::string update_url = "";
|
||||||
|
|||||||
@@ -578,6 +578,7 @@ private:
|
|||||||
bool m_studio_active = true;
|
bool m_studio_active = true;
|
||||||
std::chrono::system_clock::time_point last_active_point;
|
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 check_new_version_sf(bool show_tips = false, bool by_user = false);
|
||||||
void process_network_msg(std::string dev_id, std::string msg);
|
void process_network_msg(std::string dev_id, std::string msg);
|
||||||
void enter_force_upgrade();
|
void enter_force_upgrade();
|
||||||
|
|||||||
@@ -2297,6 +2297,17 @@ static wxMenu* generate_help_menu()
|
|||||||
return true;
|
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&) {
|
append_menu_item(helpMenu, wxID_ANY, _L("Import Profile"), _L("Import Profile"), [](wxCommandEvent&) {
|
||||||
wxGetApp().import_presets();
|
wxGetApp().import_presets();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -712,22 +712,7 @@ bool PresetUpdater::priv::download_file(const std::string& url,
|
|||||||
void PresetUpdater::priv::sync_config()
|
void PresetUpdater::priv::sync_config()
|
||||||
{
|
{
|
||||||
auto cache_profile_path = cache_path;
|
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<std::string>();
|
|
||||||
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;
|
AppConfig *app_config = GUI::wxGetApp().app_config;
|
||||||
|
|
||||||
// auto profile_update_url = app_config->profile_update_url() + "/" + Snapmaker_VERSION;
|
// 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
|
// parse the assets section and get the latest asset by comparing the name
|
||||||
|
|
||||||
Http::get(profile_update_url)
|
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
|
// 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
|
// updates, we can delete the cache file
|
||||||
BOOST_LOG_TRIVIAL(info) << format("Error getting: `%1%`: HTTP %2%, %3%", "sync_config_orca", http_status, error);
|
BOOST_LOG_TRIVIAL(info) << format("Error getting: `%1%`: HTTP %2%, %3%", "sync_config_orca", http_status, error);
|
||||||
})
|
})
|
||||||
.timeout_connect(5)
|
.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
|
// Http response OK
|
||||||
if (http_status != 200)
|
if (http_status != 200)
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user