mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 13:55:58 +08:00
Fix of closing login dialog
This commit is contained in:
parent
2bde97fb11
commit
17300d7549
@ -878,17 +878,17 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
|
||||
user_account->on_login_code_recieved(evt.data);
|
||||
});
|
||||
this->q->Bind(EVT_OPEN_PRUSAAUTH, [this](OpenPrusaAuthEvent& evt) {
|
||||
if (login_dialog != nullptr) {
|
||||
this->q->RemoveChild(login_dialog);
|
||||
login_dialog->Destroy();
|
||||
login_dialog = nullptr;
|
||||
}
|
||||
BOOST_LOG_TRIVIAL(info) << "open login browser: " << evt.data.first;
|
||||
std::string dialog_msg;
|
||||
login_dialog = new LoginWebViewDialog(this->q, dialog_msg, evt.data.first, this->q);
|
||||
if (login_dialog->ShowModal() == wxID_OK) {
|
||||
user_account->on_login_code_recieved(dialog_msg);
|
||||
}
|
||||
if (login_dialog != nullptr) {
|
||||
this->q->RemoveChild(login_dialog);
|
||||
login_dialog->Destroy();
|
||||
login_dialog = nullptr;
|
||||
}
|
||||
});
|
||||
this->q->Bind(EVT_OPEN_EXTERNAL_LOGIN, [this](wxCommandEvent& evt) {
|
||||
DownloaderUtils::Worker::perform_register(wxGetApp().app_config->get("url_downloader_dest"));
|
||||
@ -923,11 +923,8 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
|
||||
|
||||
this->q->Bind(EVT_UA_ID_USER_SUCCESS, [this](UserAccountSuccessEvent& evt) {
|
||||
if (login_dialog != nullptr) {
|
||||
this->q->RemoveChild(login_dialog);
|
||||
login_dialog->Destroy();
|
||||
login_dialog = nullptr;
|
||||
login_dialog->EndModal(wxID_CANCEL);
|
||||
}
|
||||
|
||||
// There are multiple handlers and we want to notify all
|
||||
evt.Skip();
|
||||
std::string who = user_account->get_username();
|
||||
|
Loading…
x
Reference in New Issue
Block a user