FIX: [STUDIO-1033] rm webview script handler on webview destory

Change-Id: If1465ba6bf997bf17b8a33bc33d0f20d34fcbdc7
This commit is contained in:
chunmao.guo 2023-03-09 17:09:30 +08:00 committed by Lane.Wei
parent db65fd6e83
commit 9f3a89320b
4 changed files with 14 additions and 10 deletions

View file

@ -43,7 +43,7 @@ void wxMediaCtrl2::Load(wxURI url)
{
#ifdef __WIN32__
if (m_imp == nullptr) {
Slic3r::GUI::wxGetApp().CallAfter([] {
CallAfter([] {
auto res = wxMessageBox(_L("Windows Media Player is required for this task! Do you want to enable 'Windows Media Player' for your operation system?"), _L("Error"), wxOK | wxCANCEL);
if (res == wxOK) {
wxString url = IsWindows10OrGreater()
@ -73,7 +73,7 @@ void wxMediaCtrl2::Load(wxURI url)
boost::filesystem::path data_dir_path(data_dir_str);
auto dll_path = data_dir_path / "plugins" / "BambuSource.dll";
if (boost::filesystem::exists(dll_path)) {
Slic3r::GUI::wxGetApp().CallAfter(
CallAfter(
[dll_path] {
int res = wxMessageBox(_L("BambuSource has not correctly been registered for media playing! Press Yes to re-register it."), _L("Error"), wxYES_NO);
if (res == wxYES) {
@ -82,7 +82,7 @@ void wxMediaCtrl2::Load(wxURI url)
}
});
} else {
Slic3r::GUI::wxGetApp().CallAfter([] {
CallAfter([] {
wxMessageBox(_L("Missing BambuSource component registered for media playing! Please re-install BambuStutio or seek after-sales help."), _L("Error"), wxOK);
});
}
@ -131,7 +131,7 @@ void wxMediaCtrl2::Load(wxURI url)
}
if (!hasplugins) {
Slic3r::GUI::wxGetApp().CallAfter([] {
CallAfter([] {
wxMessageBox(_L("Your system is missing H.264 codecs for GStreamer, which are required to play video. (Try installing the gstreamer1.0-plugins-bad or gstreamer1.0-libav packages, then restart Bambu Studio?)"), _L("Error"), wxOK);
});
m_error = 101;