From 5e8a14ff41849b5f568d411c953a0971de041c90 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 12 Jan 2021 14:59:14 +0100 Subject: [PATCH] Update dialogs sample to use wxWebCredentials too This should have been done in abcc31c6b2 (Update wxCredentialEntryDialog to use wxWebCredentials, 2021-01-10). --- samples/dialogs/dialogs.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index 76be189904..8a8f1998fc 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -1160,10 +1160,20 @@ void MyFrame::CredentialEntry(wxCommandEvent& WXUNUSED(event)) wxCredentialEntryDialog dialog(this, "A login is required", "Credentials"); if (dialog.ShowModal() == wxID_OK) { - wxMessageBox( - wxString::Format("User: %s Password: %s", - dialog.GetUser(), dialog.GetPassword()), - "Credentials", wxOK | wxICON_INFORMATION, this); + const wxWebCredentials credentials = dialog.GetCredentials(); + const wxString& password = wxSecretString(credentials.GetPassword()); + wxMessageBox + ( + wxString::Format + ( + "User: %s Password: %s", + credentials.GetUser(), + password + ), + "Credentials", + wxOK | wxICON_INFORMATION, + this + ); } } #endif // wxUSE_CREDENTIALDLG