145{
147
148
149 MainFrame* mainframe = wxGetApp().mainframe;
151
152 mainframe->Freeze();
157 mainframe->Thaw();
158
159
160
161 boost::regex re(R"(^(orcaslicer|prusaslicer|bambustudio|cura):\/\/open[\/]?\?file=)", boost::regbase::icase);
162 boost::regex re2(R"(^(bambustudioopen):\/\/)", boost::regex::icase);
163 boost::smatch results;
164
165 if (!boost::regex_search(full_url, results, re) && !boost::regex_search(full_url, results, re2)) {
166 BOOST_LOG_TRIVIAL(error) << "Could not start download due to wrong URL: " << full_url;
167
168 NotificationManager* ntf_mngr = wxGetApp().notification_manager();
170 _u8L(
"Could not start download due to malformed URL"));
171 return;
172 }
177 else {
178 std::string text(escaped_url);
180 NotificationManager* ntf_mngr = wxGetApp().notification_manager();
181 ntf_mngr->push_download_URL_progress_notification(
id,
m_downloads.back()->get_filename(),
183 std::placeholders::_2));
185 }
186 BOOST_LOG_TRIVIAL(debug) << "started download";
187}
#define TAB_ID_PREPARE
Definition MainFrame.hpp:60
size_t get_next_id()
Definition Downloader.hpp:81
bool user_action_callback(DownloaderUserAction action, int id)
Definition Downloader.cpp:216
static std::string escape_url(const std::string &url)
Definition DownloaderFileGet.cpp:37
void zoom_to_bed()
Definition GLCanvas3D.cpp:2345
@ ErrorNotificationLevel
Definition NotificationManager.hpp:228
GLCanvas3D * get_current_canvas3D(bool exclude_preview=false)
Definition Plater.cpp:22126
void request_model_download(wxString url)
Definition Plater.cpp:16599
void select_view(const std::string &direction)
Definition Plater.cpp:19116
void select_view_3D(const std::string &name, bool no_slice=true)
Definition Plater.cpp:19119
static Plater * plater()
Definition GUI_Factories.cpp:400
@ CustomNotification
Definition NotificationManager.hpp:66
@ Plater
Definition Shortcuts.hpp:21
bool is_makerworld_link(const std::string &url)
Definition utils.cpp:2307
bool is_bambustudio_open(const std::string &url)
Definition Utils.hpp:315
bool is_orca_open(const std::string &url)
Definition Utils.hpp:313
#define _u8L(s)
Definition I18N.hpp:11