mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 04:05:52 +08:00
Revert "SPE-2567: Login dialog starts with loading page to delete cookies before first request."
This reverts commit 338a961bd3d173df5e0f458f489ce79083a31336.
This commit is contained in:
parent
b5c97738be
commit
77bb4945f2
@ -691,14 +691,10 @@ void PrintablesConnectUploadDialog::on_connect_action_close_dialog(const std::st
|
|||||||
}
|
}
|
||||||
|
|
||||||
LoginWebViewDialog::LoginWebViewDialog(wxWindow *parent, std::string &ret_val, const wxString& url, wxEvtHandler* evt_handler)
|
LoginWebViewDialog::LoginWebViewDialog(wxWindow *parent, std::string &ret_val, const wxString& url, wxEvtHandler* evt_handler)
|
||||||
: WebViewDialog(parent, GUI::format_wxstr("file://%1%/web/other_loading.html", boost::filesystem::path(resources_dir()).generic_string()), _L("Log in dialog"), wxSize(50 * wxGetApp().em_unit(), 80 * wxGetApp().em_unit()), {})
|
: WebViewDialog(parent, url, _L("Log in dialog"), wxSize(50 * wxGetApp().em_unit(), 80 * wxGetApp().em_unit()), {})
|
||||||
, m_ret_val(ret_val)
|
, m_ret_val(ret_val)
|
||||||
, p_evt_handler(evt_handler)
|
, p_evt_handler(evt_handler)
|
||||||
{
|
{
|
||||||
// Loading screen is sent to WebViewDialog constructor to first load.
|
|
||||||
// In on_loaded real url is requested.
|
|
||||||
// This gives us space to delete cookies before requesting login page. (So it is never logged in)
|
|
||||||
m_default_url = url;
|
|
||||||
Centre();
|
Centre();
|
||||||
}
|
}
|
||||||
void LoginWebViewDialog::on_navigation_request(wxWebViewEvent &evt)
|
void LoginWebViewDialog::on_navigation_request(wxWebViewEvent &evt)
|
||||||
@ -732,21 +728,5 @@ void LoginWebViewDialog::on_dpi_changed(const wxRect &suggested_rect)
|
|||||||
Fit();
|
Fit();
|
||||||
Refresh();
|
Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoginWebViewDialog::on_loaded(wxWebViewEvent &evt)
|
|
||||||
{
|
|
||||||
BOOST_LOG_TRIVIAL(debug) << "LoginWebViewDialog::on_loaded " << evt.GetURL();
|
|
||||||
|
|
||||||
if (!m_did_default_url_request && evt.GetURL().Find("/web/other_loading.html") != wxNOT_FOUND) {
|
|
||||||
m_did_default_url_request = true;
|
|
||||||
delete_cookies(m_browser, Utils::ServiceConfig::instance().account_url());
|
|
||||||
delete_cookies(m_browser, "https://accounts.google.com");
|
|
||||||
delete_cookies(m_browser, "https://appleid.apple.com");
|
|
||||||
delete_cookies(m_browser, "https://facebook.com");
|
|
||||||
m_browser->LoadURL(m_default_url);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
} // GUI
|
} // GUI
|
||||||
} // Slic3r
|
} // Slic3r
|
||||||
|
@ -132,12 +132,10 @@ public:
|
|||||||
LoginWebViewDialog(wxWindow *parent, std::string &ret_val, const wxString& url, wxEvtHandler* evt_handler);
|
LoginWebViewDialog(wxWindow *parent, std::string &ret_val, const wxString& url, wxEvtHandler* evt_handler);
|
||||||
void on_navigation_request(wxWebViewEvent &evt) override;
|
void on_navigation_request(wxWebViewEvent &evt) override;
|
||||||
void on_dpi_changed(const wxRect &suggested_rect) override;
|
void on_dpi_changed(const wxRect &suggested_rect) override;
|
||||||
void on_loaded(wxWebViewEvent &evt) override;
|
|
||||||
private:
|
private:
|
||||||
std::string& m_ret_val;
|
std::string& m_ret_val;
|
||||||
wxEvtHandler* p_evt_handler;
|
wxEvtHandler* p_evt_handler;
|
||||||
bool m_evt_sent{ false };
|
bool m_evt_sent{ false };
|
||||||
bool m_did_default_url_request { false };
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // GUI
|
} // GUI
|
||||||
|
Loading…
x
Reference in New Issue
Block a user