|
|
1.1 root 1: /*
2: Copyright (c) 2008 TrueCrypt Foundation. All rights reserved.
3:
4: Governed by the TrueCrypt License 2.4 the full text of which is contained
5: in the file License.txt included in TrueCrypt binary and source code
6: distribution packages.
7: */
8:
9: #include "System.h"
10: #include "Main/GraphicUserInterface.h"
11: #include "VolumePasswordWizardPage.h"
12:
13: namespace TrueCrypt
14: {
15: VolumePasswordWizardPage::VolumePasswordWizardPage (wxPanel* parent, shared_ptr <VolumePassword> password, shared_ptr <KeyfileList> keyfiles, bool enableConfirmation)
16: : VolumePasswordWizardPageBase (parent), ConfirmationMode (enableConfirmation)
17: {
18: PasswordPanel = new VolumePasswordPanel (this, password, keyfiles, false, true, true, enableConfirmation);
19: PasswordPanel->UpdateEvent.Connect (EventConnector <VolumePasswordWizardPage> (this, &VolumePasswordWizardPage::OnPasswordPanelUpdate));
20:
21: PasswordPanelSizer->Add (PasswordPanel, 1, wxALL | wxEXPAND);
22: }
23:
24: VolumePasswordWizardPage::~VolumePasswordWizardPage ()
25: {
26: PasswordPanel->UpdateEvent.Disconnect (this);
27: }
28:
29: bool VolumePasswordWizardPage::IsValid ()
30: {
31: if (ConfirmationMode && !PasswordPanel->PasswordsMatch())
32: return false;
33:
34: shared_ptr <KeyfileList> keyfiles (GetKeyfiles());
35: shared_ptr <VolumePassword> password (GetPassword());
36:
37: return (password && !GetPassword()->IsEmpty()) || (keyfiles && !keyfiles->empty());
38: }
39: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.