From 488254f7fb8a557d19e77b5c42d480f0fc1e688d Mon Sep 17 00:00:00 2001 From: David Kocik Date: Fri, 5 Jan 2024 15:24:15 +0100 Subject: [PATCH] Missing Mac implementation of receiving login data from browser. + fix of current connect address --- src/slic3r/GUI/GUI_App.cpp | 10 +++++++++- src/slic3r/GUI/UserAccount.hpp | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 7d21b5e8ff..d024fd9638 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -3011,7 +3011,15 @@ void GUI_App::MacOpenURL(const wxString& url) BOOST_LOG_TRIVIAL(error) << "Recieved command to open URL, but it is not allowed in app configuration. URL: " << url; return; } - start_download(into_u8(url)); + + std::string narrow_url = into_u8(url); + if (boost::starts_with(narrow_url, "prusaslicer://open?file=")) { + start_download(std::move(narrow_url)); + } else if (boost::starts_with(narrow_url, "prusaslicer://login")) { + plater()->get_user_account()->on_login_code_recieved(std::move(narrow_url)); + } else { + BOOST_LOG_TRIVIAL(error) << "MacOpenURL recieved improper URL: " << url; + } } #endif /* __APPLE */ diff --git a/src/slic3r/GUI/UserAccount.hpp b/src/slic3r/GUI/UserAccount.hpp index fa792afb2f..dab6fed62b 100644 --- a/src/slic3r/GUI/UserAccount.hpp +++ b/src/slic3r/GUI/UserAccount.hpp @@ -55,7 +55,7 @@ public: std::string get_access_token(); const ConnectPrinterStateMap& get_printer_state_map() const { return m_printer_map; } const std::map get_user_data() const { return m_user_data; } - std::string get_connect_address() const { return "https://connect.prusa3d.com"; } + std::string get_connect_address() const { return "https://dev.connect.prusa3d.com"; } // standalone utility methods std::string get_model_from_json(const std::string& message) const;