1 | /* $Id: UIWizardCloneVMEditors.h 98103 2023-01-17 14:15:46Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIWizardDiskEditors 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_wizards_editors_UIWizardCloneVMEditors_h
|
---|
29 | #define FEQT_INCLUDED_SRC_wizards_editors_UIWizardCloneVMEditors_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* Qt includes: */
|
---|
35 | #include <QGroupBox>
|
---|
36 |
|
---|
37 | /* Local includes: */
|
---|
38 | #include "QIWithRetranslateUI.h"
|
---|
39 |
|
---|
40 | /* Other VBox includes: */
|
---|
41 | #include "COMEnums.h"
|
---|
42 |
|
---|
43 |
|
---|
44 | /* Forward declarations: */
|
---|
45 | class QAbstractButton;
|
---|
46 | class QButtonGroup;
|
---|
47 | class QCheckBox;
|
---|
48 | class QGridLayout;
|
---|
49 | class QComboBox;
|
---|
50 | class QLabel;
|
---|
51 | class QRadioButton;
|
---|
52 | class QILineEdit;
|
---|
53 | class UIFilePathSelector;
|
---|
54 | class UIMarkableLineEdit;
|
---|
55 |
|
---|
56 | /** MAC address policies. */
|
---|
57 | enum MACAddressClonePolicy
|
---|
58 | {
|
---|
59 | MACAddressClonePolicy_KeepAllMACs,
|
---|
60 | MACAddressClonePolicy_KeepNATMACs,
|
---|
61 | MACAddressClonePolicy_StripAllMACs,
|
---|
62 | MACAddressClonePolicy_MAX
|
---|
63 | };
|
---|
64 | Q_DECLARE_METATYPE(MACAddressClonePolicy);
|
---|
65 |
|
---|
66 | class UICloneVMNamePathEditor : public QIWithRetranslateUI<QGroupBox>
|
---|
67 | {
|
---|
68 | Q_OBJECT;
|
---|
69 |
|
---|
70 | signals:
|
---|
71 |
|
---|
72 | void sigCloneNameChanged(const QString &strCloneName);
|
---|
73 | void sigClonePathChanged(const QString &strClonePath);
|
---|
74 |
|
---|
75 | public:
|
---|
76 |
|
---|
77 | UICloneVMNamePathEditor(const QString &strOriginalName, const QString &strDefaultPath, QWidget *pParent = 0);
|
---|
78 |
|
---|
79 | void setFirstColumnWidth(int iWidth);
|
---|
80 | int firstColumnWidth() const;
|
---|
81 |
|
---|
82 | void setLayoutContentsMargins(int iLeft, int iTop, int iRight, int iBottom);
|
---|
83 |
|
---|
84 | QString cloneName() const;
|
---|
85 | void setCloneName(const QString &strName);
|
---|
86 |
|
---|
87 | QString clonePath() const;
|
---|
88 | void setClonePath(const QString &strPath);
|
---|
89 |
|
---|
90 | bool isComplete(const QString &strMachineGroup);
|
---|
91 |
|
---|
92 | private:
|
---|
93 |
|
---|
94 | void prepare();
|
---|
95 | virtual void retranslateUi() /* override final */;
|
---|
96 |
|
---|
97 | QGridLayout *m_pContainerLayout;
|
---|
98 | UIMarkableLineEdit *m_pNameLineEdit;
|
---|
99 | UIFilePathSelector *m_pPathSelector;
|
---|
100 | QLabel *m_pNameLabel;
|
---|
101 | QLabel *m_pPathLabel;
|
---|
102 |
|
---|
103 | QString m_strOriginalName;
|
---|
104 | QString m_strDefaultPath;
|
---|
105 | };
|
---|
106 |
|
---|
107 |
|
---|
108 | class UICloneVMAdditionalOptionsEditor : public QIWithRetranslateUI<QGroupBox>
|
---|
109 | {
|
---|
110 | Q_OBJECT;
|
---|
111 |
|
---|
112 | signals:
|
---|
113 |
|
---|
114 | void sigMACAddressClonePolicyChanged(MACAddressClonePolicy enmMACAddressClonePolicy);
|
---|
115 | void sigKeepDiskNamesToggled(bool fKeepDiskNames);
|
---|
116 | void sigKeepHardwareUUIDsToggled(bool fKeepHardwareUUIDs);
|
---|
117 |
|
---|
118 | public:
|
---|
119 |
|
---|
120 | UICloneVMAdditionalOptionsEditor(QWidget *pParent = 0);
|
---|
121 |
|
---|
122 | bool isComplete();
|
---|
123 |
|
---|
124 | void setLayoutContentsMargins(int iLeft, int iTop, int iRight, int iBottom);
|
---|
125 |
|
---|
126 | MACAddressClonePolicy macAddressClonePolicy() const;
|
---|
127 | void setMACAddressClonePolicy(MACAddressClonePolicy enmMACAddressClonePolicy);
|
---|
128 |
|
---|
129 | void setFirstColumnWidth(int iWidth);
|
---|
130 | int firstColumnWidth() const;
|
---|
131 |
|
---|
132 | bool keepHardwareUUIDs() const;
|
---|
133 | bool keepDiskNames() const;
|
---|
134 |
|
---|
135 | private slots:
|
---|
136 |
|
---|
137 | void sltMACAddressClonePolicyChanged();
|
---|
138 |
|
---|
139 | private:
|
---|
140 |
|
---|
141 | void prepare();
|
---|
142 | virtual void retranslateUi() /* override final */;
|
---|
143 | void populateMACAddressClonePolicies();
|
---|
144 | void updateMACAddressClonePolicyComboToolTip();
|
---|
145 |
|
---|
146 | QGridLayout *m_pContainerLayout;
|
---|
147 | QLabel *m_pMACComboBoxLabel;
|
---|
148 | QComboBox *m_pMACComboBox;
|
---|
149 | QLabel *m_pAdditionalOptionsLabel;
|
---|
150 | QCheckBox *m_pKeepDiskNamesCheckBox;
|
---|
151 | QCheckBox *m_pKeepHWUUIDsCheckBox;
|
---|
152 | };
|
---|
153 |
|
---|
154 | class UICloneVMCloneTypeGroupBox : public QIWithRetranslateUI<QGroupBox>
|
---|
155 | {
|
---|
156 | Q_OBJECT;
|
---|
157 |
|
---|
158 | signals:
|
---|
159 |
|
---|
160 | void sigFullCloneSelected(bool fSelected);
|
---|
161 |
|
---|
162 | public:
|
---|
163 |
|
---|
164 | UICloneVMCloneTypeGroupBox(QWidget *pParent = 0);
|
---|
165 | bool isFullClone() const;
|
---|
166 |
|
---|
167 | private slots:
|
---|
168 |
|
---|
169 | void sltButtonClicked(QAbstractButton *);
|
---|
170 |
|
---|
171 | private:
|
---|
172 |
|
---|
173 | void prepare();
|
---|
174 | virtual void retranslateUi() /* override final */;
|
---|
175 |
|
---|
176 | QButtonGroup *m_pButtonGroup;
|
---|
177 | QRadioButton *m_pFullCloneRadio;
|
---|
178 | QRadioButton *m_pLinkedCloneRadio;
|
---|
179 | };
|
---|
180 |
|
---|
181 |
|
---|
182 | class UICloneVMCloneModeGroupBox : public QIWithRetranslateUI<QGroupBox>
|
---|
183 | {
|
---|
184 | Q_OBJECT;
|
---|
185 |
|
---|
186 | signals:
|
---|
187 |
|
---|
188 | void sigCloneModeChanged(KCloneMode enmCloneMode);
|
---|
189 |
|
---|
190 | public:
|
---|
191 |
|
---|
192 | UICloneVMCloneModeGroupBox(bool fShowChildsOption, QWidget *pParent = 0);
|
---|
193 | KCloneMode cloneMode() const;
|
---|
194 |
|
---|
195 | private slots:
|
---|
196 |
|
---|
197 | void sltButtonClicked();
|
---|
198 |
|
---|
199 | private:
|
---|
200 |
|
---|
201 | void prepare();
|
---|
202 | virtual void retranslateUi() /* override final */;
|
---|
203 |
|
---|
204 | bool m_fShowChildsOption;
|
---|
205 | QRadioButton *m_pMachineRadio;
|
---|
206 | QRadioButton *m_pMachineAndChildsRadio;
|
---|
207 | QRadioButton *m_pAllRadio;
|
---|
208 | };
|
---|
209 |
|
---|
210 |
|
---|
211 |
|
---|
212 | #endif /* !FEQT_INCLUDED_SRC_wizards_editors_UIWizardCloneVMEditors_h */
|
---|