mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 07:27:41 -06:00
FIX: load url in guide web dialog
Change-Id: Ie723d8994dddcaeb21299837a0e34d8c15b698ed (cherry picked from commit 05d3a1c20a6f4a817dd098c2b121539863257a66)
This commit is contained in:
parent
18901127ec
commit
835f9837b1
3 changed files with 13 additions and 1 deletions
|
@ -111,7 +111,7 @@ void GuideFrame::load_url(wxString &url)
|
||||||
{
|
{
|
||||||
BOOST_LOG_TRIVIAL(trace) << "app_start: GuideFrame url=" << url.ToStdString();
|
BOOST_LOG_TRIVIAL(trace) << "app_start: GuideFrame url=" << url.ToStdString();
|
||||||
this->Show();
|
this->Show();
|
||||||
m_browser->LoadURL(url);
|
WebView::LoadUrl(m_browser, url);
|
||||||
m_browser->SetFocus();
|
m_browser->SetFocus();
|
||||||
UpdateState();
|
UpdateState();
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,6 +98,16 @@ wxWebView* WebView::CreateWebView(wxWindow * parent, wxString const & url)
|
||||||
return webView;
|
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)
|
bool WebView::RunScript(wxWebView *webView, wxString const &javascript)
|
||||||
{
|
{
|
||||||
if (Slic3r::GUI::wxGetApp().get_mode() == Slic3r::comDevelop)
|
if (Slic3r::GUI::wxGetApp().get_mode() == Slic3r::comDevelop)
|
||||||
|
|
|
@ -8,6 +8,8 @@ class WebView
|
||||||
public:
|
public:
|
||||||
static wxWebView *CreateWebView(wxWindow *parent, wxString const &url);
|
static wxWebView *CreateWebView(wxWindow *parent, wxString const &url);
|
||||||
|
|
||||||
|
static void LoadUrl(wxWebView * webView, wxString const &url);
|
||||||
|
|
||||||
static bool RunScript(wxWebView * webView, wxString const & msg);
|
static bool RunScript(wxWebView * webView, wxString const & msg);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue