diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2011-04-11 04:00:00 +0400 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:16:05 +0300 |
commit | 35596517f203f1c4970413b3b5b2e216b849e462 (patch) | |
tree | 93240df3eb4ddbd8eebbe6a5fc65e93f2ccb6495 /CPP/7zip/UI/FileManager/PasswordDialog.cpp | |
parent | de4f8c22fe4b9e59b60495b84db2e81de50999a9 (diff) |
9.219.21
Diffstat (limited to 'CPP/7zip/UI/FileManager/PasswordDialog.cpp')
-rwxr-xr-x | CPP/7zip/UI/FileManager/PasswordDialog.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/CPP/7zip/UI/FileManager/PasswordDialog.cpp b/CPP/7zip/UI/FileManager/PasswordDialog.cpp index eaf90a24..92826a1f 100755 --- a/CPP/7zip/UI/FileManager/PasswordDialog.cpp +++ b/CPP/7zip/UI/FileManager/PasswordDialog.cpp @@ -18,6 +18,17 @@ static CIDLangPair kIDLangPairs[] = }; #endif +void CPasswordDialog::ReadControls() +{ + _passwordControl.GetText(Password); + ShowPassword = IsButtonCheckedBool(IDC_CHECK_PASSWORD_SHOW); +} + +void CPasswordDialog::SetTextSpec() +{ + _passwordControl.SetPasswordChar(ShowPassword ? 0: TEXT('*')); + _passwordControl.SetText(Password); +} bool CPasswordDialog::OnInit() { @@ -26,8 +37,8 @@ bool CPasswordDialog::OnInit() LangSetDlgItemsText(HWND(*this), kIDLangPairs, sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0])); #endif _passwordControl.Attach(GetItem(IDC_EDIT_PASSWORD)); - _passwordControl.SetText(Password); - _passwordControl.SetPasswordChar(TEXT('*')); + CheckButton(IDC_CHECK_PASSWORD_SHOW, ShowPassword); + SetTextSpec(); return CModalDialog::OnInit(); } @@ -35,10 +46,8 @@ bool CPasswordDialog::OnButtonClicked(int buttonID, HWND buttonHWND) { if (buttonID == IDC_CHECK_PASSWORD_SHOW) { - _passwordControl.SetPasswordChar(IsButtonCheckedBool(IDC_CHECK_PASSWORD_SHOW) ? 0: TEXT('*')); - UString password; - _passwordControl.GetText(password); - _passwordControl.SetText(password); + ReadControls(); + SetTextSpec(); return true; } return CDialog::OnButtonClicked(buttonID, buttonHWND); @@ -46,6 +55,6 @@ bool CPasswordDialog::OnButtonClicked(int buttonID, HWND buttonHWND) void CPasswordDialog::OnOK() { - _passwordControl.GetText(Password); + ReadControls(); CModalDialog::OnOK(); } |