From 7ffce028d04a6b13ef762e2b89c34b688e8ca59d Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sat, 31 May 2014 18:44:53 +0200 Subject: Add TrueCrypt 7.1a MacOSX/Linux specific source files. --- src/Main/Forms/VolumePasswordWizardPage.cpp | 39 +++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/Main/Forms/VolumePasswordWizardPage.cpp (limited to 'src/Main/Forms/VolumePasswordWizardPage.cpp') diff --git a/src/Main/Forms/VolumePasswordWizardPage.cpp b/src/Main/Forms/VolumePasswordWizardPage.cpp new file mode 100644 index 00000000..fd4eaf2c --- /dev/null +++ b/src/Main/Forms/VolumePasswordWizardPage.cpp @@ -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 password, shared_ptr keyfiles, bool enableConfirmation) + : VolumePasswordWizardPageBase (parent), ConfirmationMode (enableConfirmation) + { + PasswordPanel = new VolumePasswordPanel (this, password, keyfiles, false, true, true, enableConfirmation); + PasswordPanel->UpdateEvent.Connect (EventConnector (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 keyfiles (GetKeyfiles()); + shared_ptr password (GetPassword()); + + return (password && !GetPassword()->IsEmpty()) || (keyfiles && !keyfiles->empty()); + } +} -- cgit v1.2.3