VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/Forms/VolumePasswordPanel.cpp
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2015-06-26 20:01:04 (GMT)
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2015-06-26 20:07:17 (GMT)
commitda8aec4292ab27928f4f9a2f2645c46029de7553 (patch)
tree2eb3a1c503bda9f5a601f598a6bce9559f5890d8 /src/Main/Forms/VolumePasswordPanel.cpp
parentd73df9bbd4e70f38a1f1ddc28e7bd45eb0edcc92 (diff)
downloadVeraCrypt-da8aec4292ab27928f4f9a2f2645c46029de7553.zip
VeraCrypt-da8aec4292ab27928f4f9a2f2645c46029de7553.tar.gz
Linux: don't ask for PIM if TrueCryptMode enabled, both in command line and GUI
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);
+ }
}