mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 07:05:57 +08:00
test of login webview
This commit is contained in:
parent
0abd4a0ae0
commit
0af38e5507
@ -868,7 +868,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
|
|||||||
BOOST_LOG_TRIVIAL(trace) << "Received login from other instance event.";
|
BOOST_LOG_TRIVIAL(trace) << "Received login from other instance event.";
|
||||||
user_account->on_login_code_recieved(evt.data);
|
user_account->on_login_code_recieved(evt.data);
|
||||||
});
|
});
|
||||||
this->q->Bind(EVT_OPEN_PRUSAAUTH, [](OpenPrusaAuthEvent& evt) {
|
this->q->Bind(EVT_OPEN_PRUSAAUTH, [this](OpenPrusaAuthEvent& evt) {
|
||||||
BOOST_LOG_TRIVIAL(info) << "open browser: " << evt.data;
|
BOOST_LOG_TRIVIAL(info) << "open browser: " << evt.data;
|
||||||
// first register url to be sure to get the code back
|
// first register url to be sure to get the code back
|
||||||
//auto downloader_worker = new DownloaderUtils::Worker(nullptr);
|
//auto downloader_worker = new DownloaderUtils::Worker(nullptr);
|
||||||
@ -878,7 +878,14 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
|
|||||||
DesktopIntegrationDialog::perform_downloader_desktop_integration();
|
DesktopIntegrationDialog::perform_downloader_desktop_integration();
|
||||||
#endif // __linux__
|
#endif // __linux__
|
||||||
// than open url
|
// than open url
|
||||||
wxGetApp().open_login_browser_with_dialog(evt.data);
|
//wxGetApp().open_login_browser_with_dialog(evt.data);
|
||||||
|
|
||||||
|
WebViewDialog dlg(this->q
|
||||||
|
, evt.data
|
||||||
|
, _L("Log in")
|
||||||
|
, wxSize(std::max(this->q->GetClientSize().x / 2, 100 * wxGetApp().em_unit()), std::max(this->q->GetClientSize().y / 2, 50 * wxGetApp().em_unit()))
|
||||||
|
,{});
|
||||||
|
dlg.ShowModal();
|
||||||
});
|
});
|
||||||
|
|
||||||
this->q->Bind(EVT_UA_LOGGEDOUT, [this](UserAccountSuccessEvent& evt) {
|
this->q->Bind(EVT_UA_LOGGEDOUT, [this](UserAccountSuccessEvent& evt) {
|
||||||
|
@ -104,8 +104,8 @@ public:
|
|||||||
WebViewDialog(wxWindow* parent, const wxString& url, const wxString& dialog_name, const wxSize& size, const std::vector<std::string>& message_handler_names, const std::string& loading_html = "loading");
|
WebViewDialog(wxWindow* parent, const wxString& url, const wxString& dialog_name, const wxSize& size, const std::vector<std::string>& message_handler_names, const std::string& loading_html = "loading");
|
||||||
virtual ~WebViewDialog();
|
virtual ~WebViewDialog();
|
||||||
|
|
||||||
virtual void on_show(wxShowEvent& evt) = 0;
|
virtual void on_show(wxShowEvent& evt) {};
|
||||||
virtual void on_script_message(wxWebViewEvent& evt) = 0;
|
virtual void on_script_message(wxWebViewEvent& evt);
|
||||||
|
|
||||||
void on_idle(wxIdleEvent& evt);
|
void on_idle(wxIdleEvent& evt);
|
||||||
void on_url(wxCommandEvent& evt);
|
void on_url(wxCommandEvent& evt);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user