ENH: version: refine the version compare logic
when loading new 3mf, we only popup window when BB&&CC different jira: no-jira Change-Id: I77b94890a3256f43a5e02697e4276d33ea3e905f
This commit is contained in:
parent
6c8df0c5be
commit
aa3aeee73d
|
@ -4795,6 +4795,7 @@ void GUI_App::check_update(bool show_tips, int by_user)
|
|||
auto curr_version = Semver::parse(SLIC3R_VERSION);
|
||||
auto remote_version = Semver::parse(version_info.version_str);
|
||||
if (curr_version && remote_version && (*remote_version > *curr_version)) {
|
||||
wxGetApp().app_config->set("app", "cloud_version", version_info.version_str);
|
||||
if (version_info.force_upgrade) {
|
||||
wxGetApp().app_config->set_bool("force_upgrade", version_info.force_upgrade);
|
||||
wxGetApp().app_config->set("upgrade", "force_upgrade", true);
|
||||
|
|
|
@ -576,6 +576,8 @@ public:
|
|||
std::string get_download_model_url() {return m_mall_model_download_url;}
|
||||
std::string get_download_model_name() {return m_mall_model_download_name;}
|
||||
|
||||
std::string get_remote_version_str() { return version_info.version_str; }
|
||||
|
||||
void load_url(wxString url);
|
||||
void open_mall_page_dialog();
|
||||
void open_publish_page_dialog();
|
||||
|
|
|
@ -5260,16 +5260,23 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
|
|||
Semver cloud_ver;
|
||||
if (wxGetApp().app_config->has("app", "cloud_version")) {
|
||||
std::string cloud_version = wxGetApp().app_config->get("app", "cloud_version");
|
||||
if (!cloud_version.empty())
|
||||
cloud_ver = *(Semver::parse(cloud_version));
|
||||
else
|
||||
cloud_ver = app_version;
|
||||
} else {
|
||||
cloud_ver = app_version;
|
||||
}
|
||||
int file_version_cc = file_version.patch()/100;
|
||||
int app_version_cc = app_version.patch()/100;
|
||||
|
||||
if ((file_version.min() != app_version.min()) || (file_version_cc != app_version_cc)) {
|
||||
if (config_substitutions.unrecogized_keys.size() > 0) {
|
||||
// std::string context = into_u8(text);
|
||||
wxString context;
|
||||
if (wxGetApp().app_config->get("user_mode") == "develop") {
|
||||
context = _L("Found following keys unrecognized:\n");
|
||||
for (auto &key : config_substitutions.unrecogized_keys) {
|
||||
for (auto& key : config_substitutions.unrecogized_keys) {
|
||||
context += " -";
|
||||
context += key;
|
||||
context += ";\n";
|
||||
|
@ -5281,9 +5288,10 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
|
|||
}
|
||||
else {
|
||||
//if the minor version is not matched
|
||||
if (file_version.min() != app_version.min()) {
|
||||
//if (file_version.min() != app_version.min()) {
|
||||
Newer3mfVersionDialog newer_dlg(q, &file_version, &cloud_ver, "");
|
||||
auto res = newer_dlg.ShowModal();
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue