1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 19:08:26 -06:00

Linux: don't ask for PIM if TrueCryptMode enabled, both in command line and GUI

This commit is contained in:
Mounir IDRASSI
2015-06-26 22:01:04 +02:00
parent d73df9bbd4
commit da8aec4292
6 changed files with 36 additions and 13 deletions

35
src/Main/Forms/VolumePasswordPanel.cpp Normal file → Executable file
View File

@@ -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);
}
}