Support profile OTA update for Orca Slicer (#4069)

profile ota support
This commit is contained in:
SoftFever
2024-02-13 23:58:14 +08:00
committed by GitHub
parent f5654d80ef
commit 73bb37b7c9
4 changed files with 189 additions and 284 deletions

View File

@@ -44,6 +44,7 @@ namespace Slic3r {
static const std::string VERSION_CHECK_URL_STABLE = "https://api.github.com/repos/softfever/OrcaSlicer/releases/latest";
static const std::string VERSION_CHECK_URL = "https://api.github.com/repos/softfever/OrcaSlicer/releases";
static const std::string PROFILE_UPDATE_URL = "https://api.github.com/repos/OrcaSlicer/orcaslicer-profiles/releases/tags";
static const std::string MODELS_STR = "models";
const std::string AppConfig::SECTION_FILAMENTS = "filaments";
@@ -1264,6 +1265,11 @@ std::string AppConfig::version_check_url(bool stable_only/* = false*/) const
return from_settings.empty() ? stable_only ? VERSION_CHECK_URL_STABLE : VERSION_CHECK_URL : from_settings;
}
std::string AppConfig::profile_update_url() const
{
return PROFILE_UPDATE_URL;
}
bool AppConfig::exists()
{
return boost::filesystem::exists(config_path());

View File

@@ -249,6 +249,9 @@ public:
// This returns a hardcoded string unless it is overriden by "version_check_url" in the ini file.
std::string version_check_url(bool stable_only = false) const;
// Get the Orca profile update url.
std::string profile_update_url() const;
// Returns the original Slic3r version found in the ini file before it was overwritten
// by the current version
Semver orig_version() const { return m_orig_version; }