diff options
Diffstat (limited to 'src/Main/Forms/VolumePasswordPanel.cpp')
-rwxr-xr-x[-rw-r--r--] | src/Main/Forms/VolumePasswordPanel.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/Main/Forms/VolumePasswordPanel.cpp b/src/Main/Forms/VolumePasswordPanel.cpp index deab2803..d4200b66 100644..100755 --- a/src/Main/Forms/VolumePasswordPanel.cpp +++ b/src/Main/Forms/VolumePasswordPanel.cpp @@ -54,6 +54,9 @@ namespace VeraCrypt PasswordStaticText->Show (enablePassword); PasswordTextCtrl->Show (enablePassword); DisplayPasswordCheckBox->Show (enablePassword); + + VolumePimTextCtrl->Show (enablePassword); + VolumePinHelpStaticText->Show (enablePassword); ConfirmPasswordStaticText->Show (enableConfirmation); ConfirmPasswordTextCtrl->Show (enableConfirmation); @@ -213,6 +216,18 @@ namespace VeraCrypt } } + int VolumePasswordPanel::GetVolumePim () const + { + wxString pinStr (VolumePimTextCtrl->GetValue()); + long pin = 0; + if (pinStr.IsEmpty()) + return 0; + if (pinStr.ToLong (&pin)) + return (int) pin; + else + return -1; + } + bool VolumePasswordPanel::GetTrueCryptMode () const { return TrueCryptModeCheckBox->GetValue (); @@ -352,4 +367,21 @@ namespace VeraCrypt textCtrl->SetValue (wxString (L'X', textCtrl->GetLineLength(0))); GetPassword (textCtrl); } + + void VolumePasswordPanel::OnPimChanged (wxCommandEvent& event) + { + if (ConfirmPasswordTextCtrl->IsShown()) + { + if (GetVolumePim() != 0) + { + VolumePinHelpStaticText->SetForegroundColour(*wxRED); + VolumePinHelpStaticText->SetLabel(LangString["PIM_CHANGE_WARNING"]); + } + else + { + VolumePinHelpStaticText->SetForegroundColour(*wxBLACK); + VolumePinHelpStaticText->SetLabel(LangString["IDC_PIM_HELP"]); + } + } + } } |