FIX: push_notification on GUI thread

Change-Id: Iaec347f5684fe0f65d6418759518189b67033c42
Jira: STUDIO-5106
This commit is contained in:
chunmao.guo 2023-11-03 18:26:16 +08:00 committed by Lane.Wei
parent 0e716584db
commit 3c2dfeae5a
2 changed files with 6 additions and 5 deletions

View File

@ -4593,12 +4593,12 @@ void GUI_App::sync_preset(Preset* preset)
if (http_code >= 400 && values_map["code"] == "14") { // Limit
m_create_preset_blocked[preset->type] = true;
plater()->get_notification_manager()->push_notification(NotificationType::BBLUserPresetExceedLimit);
static bool dialog_notified = false;
if (dialog_notified)
return;
dialog_notified = true;
CallAfter([this] {
plater()->get_notification_manager()->push_notification(NotificationType::BBLUserPresetExceedLimit);
static bool dialog_notified = false;
if (dialog_notified)
return;
dialog_notified = true;
if (mainframe == nullptr)
return;
auto msg = _L("The number of user presets cached in the cloud has exceeded the upper limit, newly created user presets can only be used locally.");

View File

@ -417,6 +417,7 @@ void MediaPlayCtrl::ToggleStream()
file.write(url2.c_str(), url2.size());
file.close();
m_streaming = true;
return;
}
NetworkAgent *agent = wxGetApp().getAgent();
if (!agent) return;