mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 19:08:26 -06:00
Linux/MacOSX: first dynamic mode implementation
This commit is contained in:
32
src/Main/Forms/VolumePasswordPanel.cpp
Normal file → Executable file
32
src/Main/Forms/VolumePasswordPanel.cpp
Normal file → Executable file
@@ -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"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user