mirror of
https://git.mirrors.martin98.com/https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-16 10:46:00 +08:00
Do not loade web page until switching to device page (#9031)
* Do not loade web page until switching to device page
This commit is contained in:
parent
67681c971f
commit
075565f4f4
@ -77,12 +77,26 @@ void PrinterWebView::load_url(wxString& url, wxString apikey)
|
||||
return;
|
||||
m_apikey = apikey;
|
||||
m_apikey_sent = false;
|
||||
|
||||
m_browser->LoadURL(url);
|
||||
|
||||
if (this->IsShown()) {
|
||||
m_url_deferred = *wxEmptyString;
|
||||
m_browser->LoadURL(url);
|
||||
} else {
|
||||
m_url_deferred = url;
|
||||
}
|
||||
//m_browser->SetFocus();
|
||||
UpdateState();
|
||||
}
|
||||
|
||||
bool PrinterWebView::Show(bool show)
|
||||
{
|
||||
if (show && !m_url_deferred.empty()) {
|
||||
m_browser->LoadURL(m_url_deferred);
|
||||
m_url_deferred = *wxEmptyString;
|
||||
}
|
||||
return wxPanel::Show(show);
|
||||
}
|
||||
|
||||
void PrinterWebView::reload()
|
||||
{
|
||||
m_browser->Reload();
|
||||
|
@ -43,6 +43,9 @@ public:
|
||||
void OnLoaded(wxWebViewEvent& evt);
|
||||
void reload();
|
||||
void update_mode();
|
||||
|
||||
bool Show(bool show = true) override;
|
||||
|
||||
private:
|
||||
void SendAPIKey();
|
||||
|
||||
@ -51,6 +54,8 @@ private:
|
||||
wxString m_apikey;
|
||||
bool m_apikey_sent;
|
||||
|
||||
wxString m_url_deferred;
|
||||
|
||||
// DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user