mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-12 03:27:55 +00:00
feature code format.
This commit is contained in:
@@ -4785,13 +4785,16 @@ void GUI_App::check_new_version_sf(bool show_tips, bool by_user)
|
|||||||
auto errCode = jsonData["code"];
|
auto errCode = jsonData["code"];
|
||||||
if (errCode != 200)
|
if (errCode != 200)
|
||||||
return;
|
return;
|
||||||
// auto isFullUpgrade = jsonData["is_full_upgrade"];
|
auto isFullUpgrade = jsonData["data"]["is_full_upgrade"];
|
||||||
auto isForceUpgrade = jsonData["data"]["is_force_upgrade"];
|
auto isForceUpgrade = jsonData["data"]["is_force_upgrade"];
|
||||||
|
auto versionType = jsonData["data"]["stable"];
|
||||||
|
auto softPlatform = jsonData["data"]["platform_type"];
|
||||||
version_info.version_str = jsonData["data"]["version"];
|
version_info.version_str = jsonData["data"]["version"];
|
||||||
|
|
||||||
auto fileSize = jsonData["data"]["full"]["file_size"];
|
auto fileSize = jsonData["data"]["full"]["file_size"];
|
||||||
auto fileMd5 = jsonData["data"]["full"]["file_md5"];
|
auto fileMd5 = jsonData["data"]["full"]["file_md5"];
|
||||||
auto fileSha256 = jsonData["data"]["full"]["file_sha256"];
|
auto fileSha256 = jsonData["data"]["full"]["file_sha256"];
|
||||||
|
//windows x86_x64, mac arm/x86_x64 universal
|
||||||
version_info.url = jsonData["data"]["full"]["file_url"];
|
version_info.url = jsonData["data"]["full"]["file_url"];
|
||||||
version_info.description = jsonData["data"]["full"]["file_describe"];
|
version_info.description = jsonData["data"]["full"]["file_describe"];
|
||||||
version_info.force_upgrade = isForceUpgrade;
|
version_info.force_upgrade = isForceUpgrade;
|
||||||
|
|||||||
@@ -736,21 +736,25 @@ void PresetUpdater::priv::sync_update_flutter_resource(bool isAuto_check)
|
|||||||
if (http_status != 200)
|
if (http_status != 200)
|
||||||
return;
|
return;
|
||||||
try {
|
try {
|
||||||
json jsonData = json::parse(body);
|
json jsonObj = json::parse(body);
|
||||||
auto errCode = jsonData["code"];
|
auto errCode = jsonObj["code"];
|
||||||
if (errCode != 200)
|
if (errCode != 200)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto buildNumber = jsonData["data"]["build_number"];
|
auto dataObj = jsonObj.value("data", json::object());
|
||||||
auto isForceUpgrade = jsonData["data"]["is_force_upgrade"];
|
auto buildNumer = dataObj.value("build_number", "");
|
||||||
auto minSupportPcVersion = jsonData["data"]["min_support_pc_version"];
|
auto minSupportPcVersion = dataObj.value("min_support_pc_version", "");
|
||||||
auto maxSupportPcVersion = jsonData["data"]["max_support_pc_version"];
|
auto maxSupportPcVersion = dataObj.value("max_support_pc_version", "");
|
||||||
auto fileVersion = jsonData["data"]["file_version"];
|
|
||||||
auto fileSize = jsonData["data"]["file_size"];
|
auto isForceUpgrade = dataObj.value("is_force_upgrade", false);
|
||||||
auto fileMd5 = jsonData["data"]["file_md5"];
|
auto fileVersion = dataObj.value("file_version", "");
|
||||||
auto fileSha256 = jsonData["data"]["file_sha256"];
|
auto fileSize = dataObj.value("file_size", 0);
|
||||||
auto fileUrl = jsonData["data"]["file_url"];
|
auto fileMd5 = dataObj.value("file_md5", "");
|
||||||
auto description = jsonData["data"]["file_describe"];
|
auto fileSha256 = dataObj.value("file_sha256", "");
|
||||||
|
auto fileUrl = dataObj.value("file_url", "");
|
||||||
|
auto description = dataObj.value("file_describe", "");
|
||||||
|
auto reserveData = dataObj.value("reserve_1", "");
|
||||||
|
auto reserveData2 = dataObj.value("reserve_2", "");
|
||||||
|
|
||||||
auto localProfilesjson = cache_path / "flutter_web/version.json";
|
auto localProfilesjson = cache_path / "flutter_web/version.json";
|
||||||
std::string json_path = data_dir() + "/web/flutter_web/version.json";
|
std::string json_path = data_dir() + "/web/flutter_web/version.json";
|
||||||
@@ -758,6 +762,17 @@ void PresetUpdater::priv::sync_update_flutter_resource(bool isAuto_check)
|
|||||||
Semver currentPresetVersion = get_version_from_json(json_path);
|
Semver currentPresetVersion = get_version_from_json(json_path);
|
||||||
Semver remoteVersion(fileVersion);
|
Semver remoteVersion(fileVersion);
|
||||||
|
|
||||||
|
if (fileVersion.empty())
|
||||||
|
{
|
||||||
|
if (!isAuto_check) {
|
||||||
|
wxCommandEvent* evt = new wxCommandEvent(EVT_NO_WEB_RESOURCE_UPDATE);
|
||||||
|
GUI::wxGetApp().QueueEvent(evt);
|
||||||
|
|
||||||
|
BOOST_LOG_TRIVIAL(info) << format("use check the web update.");
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
std::string localOtaPresetVersion = "";
|
std::string localOtaPresetVersion = "";
|
||||||
if (fs::exists(localProfilesjson)) {
|
if (fs::exists(localProfilesjson)) {
|
||||||
Semver localOtaVersion = get_version_from_json(localProfilesjson.string());
|
Semver localOtaVersion = get_version_from_json(localProfilesjson.string());
|
||||||
@@ -833,6 +848,8 @@ void PresetUpdater::priv::sync_config(bool isAuto_check)
|
|||||||
auto fileSha256 = jsonData["data"]["file_sha256"];
|
auto fileSha256 = jsonData["data"]["file_sha256"];
|
||||||
auto fileUrl = jsonData["data"]["file_url"];
|
auto fileUrl = jsonData["data"]["file_url"];
|
||||||
auto description = jsonData["data"]["file_describe"];
|
auto description = jsonData["data"]["file_describe"];
|
||||||
|
auto reserverData = jsonData["data"]["reserver_1"];
|
||||||
|
auto reserverData2 = jsonData["data"]["reserver_2"];
|
||||||
|
|
||||||
auto localProfilesjson = cache_path / "profiles/Snapmaker.json";
|
auto localProfilesjson = cache_path / "profiles/Snapmaker.json";
|
||||||
std::string json_path = data_dir() + "/system/Snapmaker.json";
|
std::string json_path = data_dir() + "/system/Snapmaker.json";
|
||||||
|
|||||||
Reference in New Issue
Block a user