MacOS notification - URL downloader not allowed
This commit is contained in:
parent
74c34a3115
commit
09b4a88f18
2 changed files with 14 additions and 1 deletions
src/slic3r/GUI
|
@ -2889,6 +2889,7 @@ void GUI_App::MacOpenURL(const wxString& url)
|
||||||
{
|
{
|
||||||
if (app_config && !app_config->get_bool("downloader_url_registered"))
|
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;
|
BOOST_LOG_TRIVIAL(error) << "Recieved command to open URL, but it is not allowed in app configuration. URL: " << url;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,7 +120,9 @@ enum class NotificationType
|
||||||
// Short meesage to fill space between start and finish of export
|
// Short meesage to fill space between start and finish of export
|
||||||
ExportOngoing,
|
ExportOngoing,
|
||||||
// Progressbar of download from prusaslicer:// url
|
// Progressbar of download from prusaslicer:// url
|
||||||
URLDownload
|
URLDownload,
|
||||||
|
// MacOS specific - PS comes forward even when downloader is not allowed
|
||||||
|
URLNotRegistered,
|
||||||
};
|
};
|
||||||
|
|
||||||
class NotificationManager
|
class NotificationManager
|
||||||
|
@ -916,6 +918,16 @@ private:
|
||||||
{NotificationType::UndoDesktopIntegrationFail, NotificationLevel::WarningNotificationLevel, 10,
|
{NotificationType::UndoDesktopIntegrationFail, NotificationLevel::WarningNotificationLevel, 10,
|
||||||
_u8L("Undo desktop integration failed.") },
|
_u8L("Undo desktop integration failed.") },
|
||||||
{NotificationType::ExportOngoing, NotificationLevel::RegularNotificationLevel, 0, _u8L("Exporting.") },
|
{NotificationType::ExportOngoing, NotificationLevel::RegularNotificationLevel, 0, _u8L("Exporting.") },
|
||||||
|
{NotificationType::URLNotRegistered
|
||||||
|
, NotificationLevel::RegularNotificationLevel
|
||||||
|
, 10
|
||||||
|
, _u8L("PrusaSlicer recieved a download request from Printables.com, but it's not allowed. You can allow it")
|
||||||
|
, _u8L("here.")
|
||||||
|
, [](wxEvtHandler* evnthndlr) {
|
||||||
|
wxGetApp().open_preferences("downloader_url_registered", "Other");
|
||||||
|
return true;
|
||||||
|
} },
|
||||||
|
|
||||||
//{NotificationType::NewAppAvailable, NotificationLevel::ImportantNotificationLevel, 20, _u8L("New version is available."), _u8L("See Releases page."), [](wxEvtHandler* evnthndlr) {
|
//{NotificationType::NewAppAvailable, NotificationLevel::ImportantNotificationLevel, 20, _u8L("New version is available."), _u8L("See Releases page."), [](wxEvtHandler* evnthndlr) {
|
||||||
// wxGetApp().open_browser_with_warning_dialog("https://github.com/prusa3d/PrusaSlicer/releases"); return true; }},
|
// wxGetApp().open_browser_with_warning_dialog("https://github.com/prusa3d/PrusaSlicer/releases"); return true; }},
|
||||||
//{NotificationType::NewAppAvailable, NotificationLevel::ImportantNotificationLevel, 20, _u8L("New vesion of PrusaSlicer is available.", _u8L("Download page.") },
|
//{NotificationType::NewAppAvailable, NotificationLevel::ImportantNotificationLevel, 20, _u8L("New vesion of PrusaSlicer is available.", _u8L("Download page.") },
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue