1
0
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:
Mounir IDRASSI
2015-06-24 14:14:34 +02:00
parent f927ce9b58
commit 9913af3a8e
37 changed files with 680 additions and 105 deletions

32
src/Main/Forms/VolumePasswordPanel.cpp Normal file → Executable file
View 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"]);
}
}
}
}