* Add OrcaCloud sync platform and preset bundle sharing system

  Introduce OrcaCloud, a cloud sync platform for user presets, alongside
  a preset bundle system that enables sharing printer/filament/process
  profiles as local exportable bundles or subscribed cloud bundles.

  OrcaCloud platform:
  - Auth to Orca Cloud
  - Encrypted token storage (file-based or system keychain)
  - User preset sync with
  - Profile migration from default/bambu folders on first login
  - Homepage integration with entrance to cloud.orcaslicer.com

  Preset bundles:
  - Local bundle import/export with bundle_structure.json metadata
  - Subscribed cloud bundles with version-based update checking
  - Thread-safe concurrent bundle access with read-write mutex
  - Canonical bundle preset naming (_local/<id>/... and _subscribed/<id>/...)
  - Bundle presets are read-only; grouped under subheaders in combo boxes
  - PresetBundleDialog with auto-sync toggle, refresh, update notifications
  - Hyperlinked bundle names to cloud bundle pages

  Co-authored-by: Sabriel Koh <sabrielkcr@gmail.com>
  Co-authored-by: Derrick <derrick992110@gmail.com>
  Co-authored-by: Mykola Nahirnyi <mnahirnyi@amcbridge.com>
  Co-authored-by: Ian Chua <iancrb00@gmail.com>
  Co-authored-by: Draginraptor <draginraptor@gmail.com>
  Co-authored-by: ExPikaPaka <112851715+ExPikaPaka@users.noreply.github.com>
  Co-authored-by: Ian Bassi <ian.bassi@outlook.com>
  Co-authored-by: Ocraftyone <Ocraftyone@users.noreply.github.com>
  Co-authored-by: yw4z <ywsyildiz@gmail.com>
  Co-authored-by: peterm-m <101202951+peterm-m@users.noreply.github.com>

* Fixed an issue on Windows it failed to login Orca Cloud with Google account
This commit is contained in:
SoftFever
2026-05-01 18:01:29 +08:00
committed by GitHub
parent e54e7a61c0
commit c04be9ab37
113 changed files with 8691 additions and 3467 deletions

View File

@@ -10,6 +10,7 @@
#include "format.hpp"
#include "nlohmann/json.hpp"
#include <algorithm>
#include <utility>
#include <vector>
#include <stdexcept>
@@ -320,6 +321,11 @@ void AppConfig::set_defaults()
if (get("allow_abnormal_storage").empty()) {
set_bool("allow_abnormal_storage", false);
}
if (get("preset_bundle_auto_update").empty()) {
set_bool("preset_bundle_auto_update", false);
}
#ifdef __linux__
if (get(SETTING_USE_ENCRYPTED_TOKEN_FILE).empty())
set_bool(SETTING_USE_ENCRYPTED_TOKEN_FILE, true);
@@ -357,6 +363,10 @@ void AppConfig::set_defaults()
set_bool("show_daily_tips", true);
}
if (get("show_shared_profiles_notification").empty()) {
set_bool("show_shared_profiles_notification", true);
}
if (get("auto_calculate_flush").empty()){
set("auto_calculate_flush","all");
}
@@ -802,6 +812,18 @@ std::string AppConfig::load()
if (it_section->second.empty())
m_storage.erase(it_section);
}
// Default for new installs
if (get(SETTING_CLOUD_PROVIDERS).empty()) {
// Migrate add bbl cloud if installed_networking is true
bool enable_bbl_cloud = get_bool("installed_networking");
if (enable_bbl_cloud) {
// Legacy Bambu-only user: give them both providers
set(SETTING_CLOUD_PROVIDERS, "orca;bbl");
} else {
set(SETTING_CLOUD_PROVIDERS, "orca");
}
}
}
// Override missing or keys with their defaults.
@@ -1572,6 +1594,62 @@ void AppConfig::clear_remind_network_update_later()
set_bool(SETTING_NETWORK_PLUGIN_REMIND_LATER, false);
}
std::vector<std::string> AppConfig::get_cloud_providers() const
{
std::vector<std::string> result;
std::string providers = get(SETTING_CLOUD_PROVIDERS);
if (providers.empty()) {
result.push_back("orca");
return result;
}
std::stringstream ss(providers);
std::string provider;
while (std::getline(ss, provider, ';')) {
if (!provider.empty())
result.push_back(provider);
}
// Ensure "orca" is always present
if (std::find(result.begin(), result.end(), "orca") == result.end()) {
result.insert(result.begin(), "orca");
}
return result;
}
void AppConfig::set_cloud_providers(const std::vector<std::string>& providers)
{
std::string joined;
for (size_t i = 0; i < providers.size(); ++i) {
if (i > 0) joined += ";";
joined += providers[i];
}
set(SETTING_CLOUD_PROVIDERS, joined);
}
bool AppConfig::has_cloud_provider(const std::string& provider) const
{
auto providers = get_cloud_providers();
return std::find(providers.begin(), providers.end(), provider) != providers.end();
}
void AppConfig::add_cloud_provider(const std::string& provider)
{
auto providers = get_cloud_providers();
if (std::find(providers.begin(), providers.end(), provider) == providers.end()) {
providers.push_back(provider);
set_cloud_providers(providers);
}
}
void AppConfig::remove_cloud_provider(const std::string& provider)
{
if (provider == "orca")
return; // Cannot remove orca
auto providers = get_cloud_providers();
providers.erase(std::remove(providers.begin(), providers.end(), provider), providers.end());
set_cloud_providers(providers);
}
void AppConfig::reset_selections()
{
auto it = m_storage.find("presets");