Remove static run_script function.

This commit is contained in:
David Kocik 2024-04-12 13:58:05 +02:00
parent d72794bde8
commit 7b9d9a33a4
3 changed files with 3 additions and 14 deletions

View File

@ -56,9 +56,3 @@ wxWebView* WebView::CreateWebView(wxWindow * parent, const wxString& url)
} }
bool WebView::run_script(wxWebView *webView, wxString const &javascript)
{
webView->RunScriptAsync(javascript);
return true;
}

View File

@ -8,7 +8,6 @@ class wxString;
namespace WebView namespace WebView
{ {
wxWebView *CreateWebView(wxWindow *parent, const wxString& url); wxWebView *CreateWebView(wxWindow *parent, const wxString& url);
bool run_script(wxWebView * webView, const wxString& msg);
}; };
#endif // !slic3r_GUI_WebView_hpp_ #endif // !slic3r_GUI_WebView_hpp_

View File

@ -318,11 +318,8 @@ void WebViewPanel::run_script(const wxString& javascript)
// Remember the script we run in any case, so the next time the user opens // Remember the script we run in any case, so the next time the user opens
// the "Run Script" dialog box, it is shown there for convenient updating. // the "Run Script" dialog box, it is shown there for convenient updating.
m_javascript = javascript; m_javascript = javascript;
BOOST_LOG_TRIVIAL(debug) << "RunScript " << javascript;
if (!m_browser) return; m_browser->RunScriptAsync(javascript);
bool res = WebView::run_script(m_browser, javascript);
BOOST_LOG_TRIVIAL(debug) << "RunScript " << javascript << " " << res;
} }
@ -681,8 +678,7 @@ void WebViewDialog::run_script(const wxString& javascript)
{ {
if (!m_browser) if (!m_browser)
return; return;
// dk_FIXME: Is it ok to discard the return value? m_browser->RunScriptAsync(javascript);
/*bool res = */ WebView::run_script(m_browser, javascript);
} }
PrinterPickWebViewDialog::PrinterPickWebViewDialog(wxWindow* parent, std::string& ret_val) PrinterPickWebViewDialog::PrinterPickWebViewDialog(wxWindow* parent, std::string& ret_val)