VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/Forms/VolumePasswordPanel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Main/Forms/VolumePasswordPanel.cpp')
-rwxr-xr-x[-rw-r--r--]src/Main/Forms/VolumePasswordPanel.cpp35
1 files changed, 27 insertions, 8 deletions
diff --git a/src/Main/Forms/VolumePasswordPanel.cpp b/src/Main/Forms/VolumePasswordPanel.cpp
index d4200b6..5385d6c 100644..100755
--- a/src/Main/Forms/VolumePasswordPanel.cpp
+++ b/src/Main/Forms/VolumePasswordPanel.cpp
@@ -73,6 +73,12 @@ namespace VeraCrypt
if (options && !disableTruecryptMode)
{
TrueCryptModeCheckBox->SetValue (options->TrueCryptMode);
+ if (options->TrueCryptMode)
+ {
+ VolumePimStaticText->Enable (false);
+ VolumePimTextCtrl->Enable (false);
+ VolumePinHelpStaticText->Enable (false);
+ }
}
if (enablePkcs5Prf)
@@ -218,15 +224,20 @@ 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;
+ if (VolumePimTextCtrl->IsEnabled ())
+ {
+ wxString pinStr (VolumePimTextCtrl->GetValue());
+ long pin = 0;
+ if (pinStr.IsEmpty())
+ return 0;
+ if (pinStr.ToLong (&pin))
+ return (int) pin;
+ else
+ return -1;
+ }
else
- return -1;
- }
+ return 0;
+ }
bool VolumePasswordPanel::GetTrueCryptMode () const
{
@@ -384,4 +395,12 @@ namespace VeraCrypt
}
}
}
+
+ void VolumePasswordPanel::OnTrueCryptModeChecked( wxCommandEvent& event )
+ {
+ bool bEnablePIM = !GetTrueCryptMode ();
+ VolumePimStaticText->Enable (bEnablePIM);
+ VolumePimTextCtrl->Enable (bEnablePIM);
+ VolumePinHelpStaticText->Enable (bEnablePIM);
+ }
}