VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIAddDiskEncryptionPasswordDialog.h

Last change on this file was 104358, checked in by vboxsync, 4 weeks ago

FE/Qt. bugref:10622. More refactoring around the retranslation functionality.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.4 KB
Line 
1/* $Id: UIAddDiskEncryptionPasswordDialog.h 104358 2024-04-18 05:33:40Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIAddDiskEncryptionPasswordDialog class declaration.
4 */
5
6/*
7 * Copyright (C) 2006-2023 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28#ifndef FEQT_INCLUDED_SRC_widgets_UIAddDiskEncryptionPasswordDialog_h
29#define FEQT_INCLUDED_SRC_widgets_UIAddDiskEncryptionPasswordDialog_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* Qt includes: */
35#include <QDialog>
36#include <QMap>
37#include <QMultiMap>
38
39/* GUI includes: */
40#include "UILibraryDefs.h"
41
42/* Forward declarations: */
43class QLabel;
44class QIDialogButtonBox;
45class UIEncryptionDataTable;
46
47/* Type definitions: */
48typedef QMultiMap<QString, QUuid> EncryptedMediumMap;
49typedef QMap<QString, QString> EncryptionPasswordMap;
50typedef QMap<QString, bool> EncryptionPasswordStatusMap;
51
52/** QDialog subclass used to
53 * allow the user to enter disk encryption passwords for particular password IDs. */
54class SHARED_LIBRARY_STUFF UIAddDiskEncryptionPasswordDialog : public QDialog
55{
56 Q_OBJECT;
57
58public:
59
60 /** Constructs dialog passing @a pParent to the base-class.
61 * @param strMachineName Brings the name of the machine we show this dialog for.
62 * @param encryptedMedia Brings the lists of medium ids (values) encrypted with passwords with ids (keys). */
63 UIAddDiskEncryptionPasswordDialog(QWidget *pParent, const QString &strMachineName, const EncryptedMediumMap &encryptedMedia);
64
65 /** Returns the shallow copy of the encryption password map
66 * acquired from the UIEncryptionDataTable instance. */
67 EncryptionPasswordMap encryptionPasswords() const;
68
69private slots:
70
71 /** Translation routine. */
72 void sltRetranslateUI();
73
74 /** Handles editor's Enter/Return key triggering. */
75 void sltEditorEnterKeyTriggered() { accept(); }
76
77 /** Performs passwords validation.
78 * If all passwords are valid,
79 * this slot calls to base-class. */
80 void accept() RT_OVERRIDE;
81
82private:
83
84 /** Prepares all. */
85 void prepare();
86
87 /** Returns whether passed @a strPassword is valid for medium with passed @a uMediumId. */
88 static bool isPasswordValid(const QUuid &uMediumId, const QString strPassword);
89
90 /** Holds the name of the machine we show this dialog for. */
91 const QString m_strMachineName;
92
93 /** Holds the encrypted medium map reference. */
94 const EncryptedMediumMap &m_encryptedMedia;
95
96 /** Holds the description label instance. */
97 QLabel *m_pLabelDescription;
98 /** Holds the encryption-data table instance. */
99 UIEncryptionDataTable *m_pTableEncryptionData;
100 /** Holds the button-box instance. */
101 QIDialogButtonBox *m_pButtonBox;
102};
103
104#endif /* !FEQT_INCLUDED_SRC_widgets_UIAddDiskEncryptionPasswordDialog_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use