Wizard login page fix.

This commit is contained in:
David Kocik 2024-06-26 15:32:31 +02:00 committed by Lukas Matena
parent 4f317e540a
commit 24ce924ca6
2 changed files with 5 additions and 2 deletions

View File

@ -92,7 +92,8 @@ case type: \
void ConfigWizardWebViewPage::load_error_page() { void ConfigWizardWebViewPage::load_error_page() {
if (!m_browser) if (!m_browser)
return; return;
if (m_vetoed)
return;
m_browser->Stop(); m_browser->Stop();
m_load_error_page = true; m_load_error_page = true;
} }
@ -105,7 +106,7 @@ void ConfigWizardWebViewPage::on_idle(wxIdleEvent &WXUNUSED(evt)) {
} else { } else {
wxSetCursor(wxNullCursor); wxSetCursor(wxNullCursor);
if (m_load_error_page) { if (!m_vetoed && m_load_error_page) {
m_load_error_page = false; m_load_error_page = false;
m_browser->LoadURL(GUI::format_wxstr( m_browser->LoadURL(GUI::format_wxstr(
"file://%1%/web/connection_failed.html", "file://%1%/web/connection_failed.html",
@ -121,6 +122,7 @@ void ConfigWizardWebViewPage::on_navigation_request(wxWebViewEvent &evt)
wxString url = evt.GetURL(); wxString url = evt.GetURL();
if (url.starts_with(L"prusaslicer")) { if (url.starts_with(L"prusaslicer")) {
evt.Veto(); evt.Veto();
m_vetoed = true;
wxPostEvent(wxGetApp().plater(), Event<std::string>(EVT_LOGIN_VIA_WIZARD, into_u8(url))); wxPostEvent(wxGetApp().plater(), Event<std::string>(EVT_LOGIN_VIA_WIZARD, into_u8(url)));
} }
} }

View File

@ -60,6 +60,7 @@ private:
wxBoxSizer *m_browser_sizer{nullptr}; wxBoxSizer *m_browser_sizer{nullptr};
wxStaticText *m_text{nullptr}; wxStaticText *m_text{nullptr};
bool m_load_error_page{false}; bool m_load_error_page{false};
bool m_vetoed{false};
}; };
}} // namespace Slic3r::GUI }} // namespace Slic3r::GUI