mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-25 03:42:05 +00:00
Introducing Orca Cloud: https://cloud.orcaslicer.com (#13414)
* 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:
@@ -161,6 +161,8 @@
|
||||
#include "DailyTips.hpp"
|
||||
#include "CreatePresetsDialog.hpp"
|
||||
#include "FileArchiveDialog.hpp"
|
||||
#include "../Utils/Http.hpp"
|
||||
#include "../Utils/OrcaCloudServiceAgent.hpp"
|
||||
#include "StepMeshDialog.hpp"
|
||||
#include "FilamentMapDialog.hpp"
|
||||
#include "CloneDialog.hpp"
|
||||
@@ -9423,12 +9425,17 @@ void Plater::priv::on_select_preset(wxCommandEvent &evt)
|
||||
//! instead of
|
||||
//! combo->GetStringSelection().ToUTF8().data());
|
||||
|
||||
wxString wx_name = combo->GetString(selection);
|
||||
// if (preset_type == Preset::TYPE_PRINTER) {
|
||||
// wx_name = combo->get_preset_item_name(selection); }
|
||||
|
||||
std::string preset_name = wxGetApp().preset_bundle->get_preset_name_by_alias(preset_type,
|
||||
Preset::remove_suffix_modified(wx_name.ToUTF8().data()));
|
||||
// Prefer the internal preset name stored per combo item to avoid alias collisions
|
||||
// (e.g. user preset and bundle preset sharing the same display alias).
|
||||
wxString wx_stored_name = combo->GetItemAlias(selection);
|
||||
std::string preset_name;
|
||||
if (!wx_stored_name.empty()) {
|
||||
preset_name = Preset::remove_suffix_modified(wx_stored_name.ToUTF8().data());
|
||||
} else {
|
||||
wxString wx_name = combo->GetString(selection);
|
||||
preset_name = wxGetApp().preset_bundle->get_preset_name_by_alias(preset_type,
|
||||
Preset::remove_suffix_modified(wx_name.ToUTF8().data()));
|
||||
}
|
||||
|
||||
if (preset_type == Preset::TYPE_FILAMENT) {
|
||||
wxGetApp().preset_bundle->set_filament_preset(idx, preset_name);
|
||||
@@ -9540,6 +9547,26 @@ void Plater::priv::on_select_preset(wxCommandEvent &evt)
|
||||
for (size_t idx = 0; idx < filament_size; ++idx)
|
||||
wxGetApp().plater()->sidebar().auto_calc_flushing_volumes(idx);
|
||||
#endif
|
||||
|
||||
// Show shared profiles notification for the newly selected printer
|
||||
if (wxGetApp().app_config->get_bool("show_shared_profiles_notification"))
|
||||
{
|
||||
std::string printer_name = wxGetApp().preset_bundle->printers.get_selected_preset_base().name;
|
||||
std::string encoded_name = Http::url_encode(printer_name);
|
||||
|
||||
std::string cloud_url;
|
||||
if (auto agent = wxGetApp().getAgent()) {
|
||||
if (auto orca_agent = std::dynamic_pointer_cast<OrcaCloudServiceAgent>(agent->get_cloud_agent())) {
|
||||
cloud_url = orca_agent->get_cloud_base_url();
|
||||
}
|
||||
}
|
||||
if (cloud_url.empty())
|
||||
cloud_url = "https://cloud.orcaslicer.com";
|
||||
|
||||
std::string explore_url = cloud_url + "/app/bundles/explore?printers=" + encoded_name;
|
||||
|
||||
wxGetApp().plater()->get_notification_manager()->push_shared_profiles_notification(explore_url);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __WXMSW__
|
||||
|
||||
Reference in New Issue
Block a user