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:
35
src/Main/Forms/VolumePasswordPanel.cpp
Normal file → Executable file
35
src/Main/Forms/VolumePasswordPanel.cpp
Normal file → Executable 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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user