* 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

@@ -363,7 +363,7 @@ namespace Slic3r
return obj;
}
int DeviceManager::query_bind_status(std::string& msg)
int DeviceManager::query_bind_status(std::string& msg, const std::string& provider)
{
if (!m_agent)
{
@@ -381,7 +381,7 @@ namespace Slic3r
unsigned int http_code;
std::string http_body;
int result = m_agent->query_bind_status(query_list, &http_code, &http_body);
int result = m_agent->query_bind_status(query_list, &http_code, &http_body, provider);
if (result < 0)
{
@@ -419,9 +419,9 @@ namespace Slic3r
return result;
}
MachineObject* DeviceManager::get_user_machine(std::string dev_id)
MachineObject* DeviceManager::get_user_machine(std::string dev_id, const std::string& provider)
{
if (!m_agent || !m_agent->is_user_login())
if (!m_agent || !m_agent->is_user_login(provider))
{
return nullptr;
}
@@ -442,14 +442,13 @@ namespace Slic3r
return nullptr;
}
void DeviceManager::clean_user_info()
void DeviceManager::clean_user_info(bool keep_local_selection)
{
BOOST_LOG_TRIVIAL(trace) << "DeviceManager::clean_user_info";
// reset selected_machine
selected_machine = "";
local_selected_machine = "";
OnSelectedMachineChanged(selected_machine, "");
const std::string previous_selected_machine = selected_machine;
const bool keep_selected_machine = keep_local_selection &&
!selected_machine.empty() &&
localMachineList.find(selected_machine) != localMachineList.end();
// clean user list
for (auto it = userMachineList.begin(); it != userMachineList.end(); it++)
@@ -462,6 +461,13 @@ namespace Slic3r
}
}
userMachineList.clear();
if (!keep_selected_machine) {
selected_machine = "";
local_selected_machine = "";
}
OnSelectedMachineChanged(previous_selected_machine, selected_machine);
}
bool DeviceManager::set_selected_machine(std::string dev_id)
@@ -566,7 +572,7 @@ namespace Slic3r
{
if (selected_machine.empty()) return nullptr;
MachineObject* obj = get_user_machine(selected_machine);
MachineObject* obj = get_user_machine(selected_machine, GUI::wxGetApp().get_printer_cloud_provider());
if (obj)
return obj;
@@ -683,15 +689,15 @@ namespace Slic3r
return "";
}
void DeviceManager::modify_device_name(std::string dev_id, std::string dev_name)
void DeviceManager::modify_device_name(std::string dev_id, std::string dev_name, const std::string& provider)
{
BOOST_LOG_TRIVIAL(trace) << "modify_device_name";
if (m_agent)
{
int result = m_agent->modify_printer_name(dev_id, dev_name);
int result = m_agent->modify_printer_name(dev_id, dev_name, provider);
if (result == 0)
{
update_user_machine_list_info();
update_user_machine_list_info(provider);
}
}
}
@@ -712,6 +718,7 @@ namespace Slic3r
try
{
json j = json::parse(body);
const std::string provider = GUI::wxGetApp().get_printer_cloud_provider();
#if !BBL_RELEASE_TO_PUBLIC
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": " << j;
@@ -740,7 +747,7 @@ namespace Slic3r
obj = new MachineObject(this, m_agent, "", "", "");
if (m_agent)
{
obj->set_bind_status(m_agent->get_user_name());
obj->set_bind_status(m_agent->get_user_name(provider));
}
if (obj->get_dev_ip().empty())
@@ -806,14 +813,14 @@ namespace Slic3r
}
}
void DeviceManager::update_user_machine_list_info()
void DeviceManager::update_user_machine_list_info(const std::string& provider)
{
if (!m_agent) return;
BOOST_LOG_TRIVIAL(debug) << "update_user_machine_list_info";
unsigned int http_code;
std::string body;
int result = m_agent->get_user_print_info(&http_code, &body);
int result = m_agent->get_user_print_info(&http_code, &body, provider);
if (result == 0)
{
parse_user_print_info(body);
@@ -906,7 +913,7 @@ namespace Slic3r
}
// do some refresh
if (Slic3r::GUI::wxGetApp().is_user_login())
if (Slic3r::GUI::wxGetApp().is_user_login(Slic3r::GUI::wxGetApp().get_printer_cloud_provider()))
{
m_manager->check_pushing();
try
@@ -922,4 +929,4 @@ namespace Slic3r
// certificate
agent->install_device_cert(obj->get_dev_id(), obj->is_lan_mode_printer());
}
}
}