mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-31 12:11:59 +08:00
check if downloads are allowed also on linux when SLIC3R_DESKTOP_INTEGRATION = 0
This commit is contained in:
parent
bc2e6447d5
commit
40bc51e09d
@ -2987,13 +2987,7 @@ void GUI_App::MacOpenFiles(const wxArrayString &fileNames)
|
|||||||
|
|
||||||
void GUI_App::MacOpenURL(const wxString& url)
|
void GUI_App::MacOpenURL(const wxString& url)
|
||||||
{
|
{
|
||||||
if (app_config && !app_config->get_bool("downloader_url_registered"))
|
start_download(into_u8(url));
|
||||||
{
|
|
||||||
notification_manager()->push_notification(NotificationType::URLNotRegistered);
|
|
||||||
BOOST_LOG_TRIVIAL(error) << "Recieved command to open URL, but it is not allowed in app configuration. URL: " << url;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
start_download(boost::nowide::narrow(url));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* __APPLE */
|
#endif /* __APPLE */
|
||||||
@ -3558,14 +3552,24 @@ void GUI_App::start_download(std::string url)
|
|||||||
BOOST_LOG_TRIVIAL(error) << "Could not start URL download: plater is nullptr.";
|
BOOST_LOG_TRIVIAL(error) << "Could not start URL download: plater is nullptr.";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(__APPLE__) || (defined(__linux__) && !defined(SLIC3R_DESKTOP_INTEGRATION))
|
||||||
|
if (app_config && !app_config->get_bool("downloader_url_registered"))
|
||||||
|
{
|
||||||
|
notification_manager()->push_notification(NotificationType::URLNotRegistered);
|
||||||
|
BOOST_LOG_TRIVIAL(error) << "Recieved command to open URL, but it is not allowed in app configuration. URL: " << url;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif //defined(__APPLE__) || (defined(__linux__) && !defined(SLIC3R_DESKTOP_INTEGRATION))
|
||||||
|
|
||||||
//lets always init so if the download dest folder was changed, new dest is used
|
//lets always init so if the download dest folder was changed, new dest is used
|
||||||
boost::filesystem::path dest_folder(app_config->get("url_downloader_dest"));
|
boost::filesystem::path dest_folder(app_config->get("url_downloader_dest"));
|
||||||
if (dest_folder.empty() || !boost::filesystem::is_directory(dest_folder)) {
|
if (dest_folder.empty() || !boost::filesystem::is_directory(dest_folder)) {
|
||||||
std::string msg = _u8L("Could not start URL download. Destination folder is not set. Please choose destination folder in Configuration Wizard.");
|
std::string msg = _u8L("Could not start URL download. Destination folder is not set. Please choose destination folder in Configuration Wizard.");
|
||||||
BOOST_LOG_TRIVIAL(error) << msg;
|
BOOST_LOG_TRIVIAL(error) << msg;
|
||||||
show_error(nullptr, msg);
|
show_error(nullptr, msg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_downloader->init(dest_folder);
|
m_downloader->init(dest_folder);
|
||||||
m_downloader->start_download(url);
|
m_downloader->start_download(url);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user