mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-12 19:38:26 -06:00
Add TrueCrypt 7.1a MacOSX/Linux specific source files.
This commit is contained in:
39
src/Main/Forms/VolumePasswordWizardPage.cpp
Normal file
39
src/Main/Forms/VolumePasswordWizardPage.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
*/
|
||||
|
||||
#include "System.h"
|
||||
#include "Main/GraphicUserInterface.h"
|
||||
#include "VolumePasswordWizardPage.h"
|
||||
|
||||
namespace TrueCrypt
|
||||
{
|
||||
VolumePasswordWizardPage::VolumePasswordWizardPage (wxPanel* parent, shared_ptr <VolumePassword> password, shared_ptr <KeyfileList> keyfiles, bool enableConfirmation)
|
||||
: VolumePasswordWizardPageBase (parent), ConfirmationMode (enableConfirmation)
|
||||
{
|
||||
PasswordPanel = new VolumePasswordPanel (this, password, keyfiles, false, true, true, enableConfirmation);
|
||||
PasswordPanel->UpdateEvent.Connect (EventConnector <VolumePasswordWizardPage> (this, &VolumePasswordWizardPage::OnPasswordPanelUpdate));
|
||||
|
||||
PasswordPanelSizer->Add (PasswordPanel, 1, wxALL | wxEXPAND);
|
||||
}
|
||||
|
||||
VolumePasswordWizardPage::~VolumePasswordWizardPage ()
|
||||
{
|
||||
PasswordPanel->UpdateEvent.Disconnect (this);
|
||||
}
|
||||
|
||||
bool VolumePasswordWizardPage::IsValid ()
|
||||
{
|
||||
if (ConfirmationMode && !PasswordPanel->PasswordsMatch())
|
||||
return false;
|
||||
|
||||
shared_ptr <KeyfileList> keyfiles (GetKeyfiles());
|
||||
shared_ptr <VolumePassword> password (GetPassword());
|
||||
|
||||
return (password && !GetPassword()->IsEmpty()) || (keyfiles && !keyfiles->empty());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user