diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-06-24 14:14:34 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-06-24 15:33:16 +0200 |
commit | 9913af3a8ed61333cafd0e611f214f7c86652423 (patch) | |
tree | bae9cbe7b95cb56df9d210cf32b44a0c15574ce8 /src/Main/Forms/VolumePasswordPanel.cpp | |
parent | f927ce9b58b137846bb78a47f5a83f7261eac9ff (diff) | |
download | VeraCrypt-9913af3a8ed61333cafd0e611f214f7c86652423.tar.gz VeraCrypt-9913af3a8ed61333cafd0e611f214f7c86652423.zip |
Linux/MacOSX: first dynamic mode implementation
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"]); + } + } + } } |