FIX: load url in guide web dialog
Change-Id: Ie723d8994dddcaeb21299837a0e34d8c15b698ed (cherry picked from commit 05d3a1c20a6f4a817dd098c2b121539863257a66)
This commit is contained in:
parent
18901127ec
commit
835f9837b1
|
@ -111,7 +111,7 @@ void GuideFrame::load_url(wxString &url)
|
|||
{
|
||||
BOOST_LOG_TRIVIAL(trace) << "app_start: GuideFrame url=" << url.ToStdString();
|
||||
this->Show();
|
||||
m_browser->LoadURL(url);
|
||||
WebView::LoadUrl(m_browser, url);
|
||||
m_browser->SetFocus();
|
||||
UpdateState();
|
||||
}
|
||||
|
|
|
@ -98,6 +98,16 @@ wxWebView* WebView::CreateWebView(wxWindow * parent, wxString const & url)
|
|||
return webView;
|
||||
}
|
||||
|
||||
void WebView::LoadUrl(wxWebView * webView, wxString const &url)
|
||||
{
|
||||
auto url2 = url;
|
||||
#ifdef __WIN32__
|
||||
url2.Replace("\\", "/");
|
||||
#endif
|
||||
if (!url2.empty()) { url2 = wxURI(url2).BuildURI(); }
|
||||
webView->LoadURL(url2);
|
||||
}
|
||||
|
||||
bool WebView::RunScript(wxWebView *webView, wxString const &javascript)
|
||||
{
|
||||
if (Slic3r::GUI::wxGetApp().get_mode() == Slic3r::comDevelop)
|
||||
|
|
|
@ -7,6 +7,8 @@ class WebView
|
|||
{
|
||||
public:
|
||||
static wxWebView *CreateWebView(wxWindow *parent, wxString const &url);
|
||||
|
||||
static void LoadUrl(wxWebView * webView, wxString const &url);
|
||||
|
||||
static bool RunScript(wxWebView * webView, wxString const & msg);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue