diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 47dfbd3d83..cf8dfc1ee8 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include @@ -41,9 +40,11 @@ #include #include #include +#include #include #include #include + #include #include #include @@ -88,7 +89,6 @@ #include "libslic3r/Thread.hpp" #include "libslic3r/miniz_extension.hpp" #include "libslic3r/Utils.hpp" -#include "libslic3r/Color.hpp" #include "slic3r/plugin/PluginManager.hpp" #include "slic3r/plugin/host/PluginHostUi.hpp" #include "slic3r/plugin/PythonInterpreter.hpp" @@ -108,14 +108,12 @@ #include "../Utils/PrintHost.hpp" #include "../Utils/Process.hpp" #include "../Utils/wxInspectorPlugins/Registration.hpp" -#include "../Utils/MacDarkMode.hpp" #include "../Utils/Http.hpp" #include "../Utils/InstanceID.hpp" #include "../Utils/UndoRedo.hpp" #include "slic3r/Config/Snapshot.hpp" #include "Preferences.hpp" #include "Tab.hpp" -#include "SysInfoDialog.hpp" #include "UpdateDialogs.hpp" #include "Mouse3DController.hpp" #include "RemovableDriveManager.hpp" @@ -129,8 +127,6 @@ #include "PrintHostDialogs.hpp" #include "NetworkPluginDialog.hpp" #include "DesktopIntegrationDialog.hpp" -#include "SendSystemInfoDialog.hpp" -#include "ParamsDialog.hpp" #include "KBShortcutsDialog.hpp" #include "DownloadProgressDialog.hpp" #include "TroubleshootDialog.hpp" @@ -141,7 +137,6 @@ #include "Widgets/ProgressDialog.hpp" //BBS: DailyTip and UserGuide Dialog -#include "WebDownPluginDlg.hpp" #include "WebGuideDialog.hpp" #include "ReleaseNote.hpp" #include "PrivacyUpdateDialog.hpp" @@ -3976,7 +3971,7 @@ void GUI_App::set_live_printer_agent(std::shared_ptr agent) sidebar().update_all_preset_comboboxes(); } -std::string GUI_App::resolve_printer_agent_id(const std::string& stored_id) +std::string GUI_App::resolve_printer_agent_id(const std::string& stored_id) const { if (!stored_id.empty()) return stored_id; @@ -4990,13 +4985,14 @@ bool GUI_App::is_user_login(const std::string& provider/* = ORCA_CLOUD_PROVIDER* std::string GUI_App::get_printer_cloud_provider() const { - std::string provider = preset_bundle->printers.get_edited_preset().config.opt_string("printer_agent"); - if (provider.empty()) - provider = ORCA_CLOUD_PROVIDER; - return provider; + const std::string agent_id = resolve_printer_agent_id( + preset_bundle ? preset_bundle->printers.get_edited_preset().config.opt_string("printer_agent") + : std::string()); + return agent_id == BBL_PRINTER_AGENT_ID ? BBL_CLOUD_PROVIDER : ORCA_CLOUD_PROVIDER; } + bool GUI_App::check_login(const std::string& provider/* = ORCA_CLOUD_PROVIDER*/) { bool result = false; diff --git a/src/slic3r/GUI/GUI_App.hpp b/src/slic3r/GUI/GUI_App.hpp index 1cb6ba7420..5263ac7d9b 100644 --- a/src/slic3r/GUI/GUI_App.hpp +++ b/src/slic3r/GUI/GUI_App.hpp @@ -23,9 +23,6 @@ #include #include -#include -#include - //#define BBL_HAS_FIRST_PAGE 1 #define STUDIO_INACTIVE_TIMEOUT 15*60*1000 #define LOG_FILES_MAX_NUM 30 @@ -369,7 +366,7 @@ public: // Reconcile the live printer agent with the stored preset selection. void switch_printer_agent(); - std::string resolve_printer_agent_id(const std::string& stored_id); + std::string resolve_printer_agent_id(const std::string& stored_id) const; // ORCA TODO: in the future, bbl presets should specify "bbl" printer agent id // then, all resolve and canonical would just be ORCA<->"" std::string canonical_printer_agent_id(const std::string& picked_id);