PresetUpdater: Fix incompatible bundle requirements display

This commit is contained in:
Vojtech Kral 2018-07-23 12:34:07 +02:00
parent abe7a71f85
commit 1c58c3e153

View File

@ -541,10 +541,21 @@ bool PresetUpdater::config_update() const
std::unordered_map<std::string, wxString> incompats_map;
for (const auto &incompat : updates.incompats) {
auto vendor = incompat.name();
auto restrictions = wxString::Format(_(L("requires min. %s and max. %s")),
incompat.version.min_slic3r_version.to_string(),
incompat.version.max_slic3r_version.to_string()
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 = wxString::Format(_(L("requires min. %s and max. %s")),
min_slic3r.to_string(),
max_slic3r.to_string()
);
} else if (min_slic3r != Semver::zero()) {
restrictions = wxString::Format(_(L("requires min. %s")), min_slic3r.to_string());
} else {
restrictions = wxString::Format(_(L("requires max. %s")), max_slic3r.to_string());
}
incompats_map.emplace(std::make_pair(std::move(vendor), std::move(restrictions)));
}