VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageFormat.h@ 104158

Last change on this file since 104158 was 103982, checked in by vboxsync, 10 months ago

FE/Qt: bugref:10624. Replacing override and final keywords with RT_OVERRIDE and RT_FINAL defines.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 10.1 KB
Line 
1/* $Id: UIWizardExportAppPageFormat.h 103982 2024-03-21 11:43:53Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIWizardExportAppPageFormat class declaration.
4 */
5
6/*
7 * Copyright (C) 2009-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_exportappliance_UIWizardExportAppPageFormat_h
29#define FEQT_INCLUDED_SRC_wizards_exportappliance_UIWizardExportAppPageFormat_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* GUI includes: */
35#include "UINativeWizardPage.h"
36#include "UIWizardExportApp.h"
37
38/* COM includes: */
39#include "CAppliance.h"
40#include "CCloudClient.h"
41#include "CCloudProfile.h"
42#include "CVirtualSystemDescription.h"
43#include "CVirtualSystemDescriptionForm.h"
44
45/* Forward declarations: */
46class QAbstractButton;
47class QButtonGroup;
48class QCheckBox;
49class QGridLayout;
50class QLabel;
51class QStackedWidget;
52class QIComboBox;
53class QIRichTextLabel;
54class QIToolButton;
55class UIEmptyFilePathSelector;
56class UINotificationCenter;
57
58/** Format combo data fields. */
59enum
60{
61 FormatData_Name = Qt::UserRole + 1,
62 FormatData_ShortName = Qt::UserRole + 2,
63 FormatData_IsItCloudFormat = Qt::UserRole + 3
64};
65
66/** Profile combo data fields. */
67enum
68{
69 ProfileData_Name = Qt::UserRole + 1
70};
71
72/** Namespace for Format page of the Export Appliance wizard. */
73namespace UIWizardExportAppFormat
74{
75 /** Populates formats. */
76 void populateFormats(QIComboBox *pCombo, UINotificationCenter *pCenter, bool fExportToOCIByDefault);
77 /** Populates MAC address policies. */
78 void populateMACAddressPolicies(QIComboBox *pCombo);
79
80 /** Returns current format of @a pCombo specified. */
81 QString format(QIComboBox *pCombo);
82 /** Returns whether format under certain @a iIndex is cloud one. */
83 bool isFormatCloudOne(QIComboBox *pCombo, int iIndex = -1);
84
85 /** Refresh stacked widget. */
86 void refreshStackedWidget(QStackedWidget *pStackedWidget,
87 bool fIsFormatCloudOne);
88
89 /** Refresh file selector name. */
90 void refreshFileSelectorName(QString &strFileSelectorName,
91 const QStringList &machineNames,
92 const QString &strDefaultApplianceName,
93 bool fIsFormatCloudOne);
94 /** Refresh file selector extension. */
95 void refreshFileSelectorExtension(QString &strFileSelectorExt,
96 UIEmptyFilePathSelector *pFileSelector,
97 bool fIsFormatCloudOne);
98 /** Refresh file selector path. */
99 void refreshFileSelectorPath(UIEmptyFilePathSelector *pFileSelector,
100 const QString &strFileSelectorName,
101 const QString &strFileSelectorExt,
102 bool fIsFormatCloudOne);
103 /** Refresh Manifest check-box access. */
104 void refreshManifestCheckBoxAccess(QCheckBox *pCheckBox,
105 bool fIsFormatCloudOne);
106 /** Refresh Include ISOs check-box access. */
107 void refreshIncludeISOsCheckBoxAccess(QCheckBox *pCheckBox,
108 bool fIsFormatCloudOne);
109 /** Refresh local stuff. */
110 void refreshLocalStuff(CAppliance &comLocalAppliance,
111 UIWizardExportApp *pWizard,
112 const QList<QUuid> &machineIDs,
113 const QString &strUri);
114
115 /** Refresh profile combo. */
116 void refreshProfileCombo(QIComboBox *pCombo,
117 UINotificationCenter *pCenter,
118 const QString &strFormat,
119 bool fIsFormatCloudOne);
120 /** Refresh cloud profile. */
121 void refreshCloudProfile(CCloudProfile &comCloudProfile,
122 UINotificationCenter *pCenter,
123 const QString &strShortProviderName,
124 const QString &strProfileName,
125 bool fIsFormatCloudOne);
126 /** Refresh cloud export mode. */
127 void refreshCloudExportMode(const QMap<CloudExportMode, QAbstractButton*> &radios,
128 bool fIsFormatCloudOne);
129 /** Refresh cloud stuff. */
130 void refreshCloudStuff(CAppliance &comCloudAppliance,
131 CCloudClient &comCloudClient,
132 CVirtualSystemDescription &comCloudVsd,
133 CVirtualSystemDescriptionForm &comCloudVsdExportForm,
134 UIWizardExportApp *pWizard,
135 const CCloudProfile &comCloudProfile,
136 const QList<QUuid> &machineIDs,
137 const QString &strUri,
138 const CloudExportMode enmCloudExportMode);
139
140 /** Returns current profile name of @a pCombo specified. */
141 QString profileName(QIComboBox *pCombo);
142 /** Returns current cloud export mode chosen in @a radioButtons specified. */
143 CloudExportMode cloudExportMode(const QMap<CloudExportMode, QAbstractButton*> &radioButtons);
144
145 /** Updates format combo tool-tips. */
146 void updateFormatComboToolTip(QIComboBox *pCombo);
147 /** Updates MAC address export policy combo tool-tips. */
148 void updateMACAddressExportPolicyComboToolTip(QIComboBox *pCombo);
149}
150
151/** UINativeWizardPage extension for Format page of the Export Appliance wizard,
152 * based on UIWizardExportAppFormat namespace functions. */
153class UIWizardExportAppPageFormat : public UINativeWizardPage
154{
155 Q_OBJECT;
156
157public:
158
159 /** Constructs Format page. */
160 UIWizardExportAppPageFormat(bool fExportToOCIByDefault);
161
162protected:
163
164 /** Returns wizard this page belongs to. */
165 UIWizardExportApp *wizard() const;
166
167 /** Performs page initialization. */
168 virtual void initializePage() RT_OVERRIDE RT_FINAL;
169
170 /** Returns whether page is complete. */
171 virtual bool isComplete() const RT_OVERRIDE RT_FINAL;
172
173 /** Performs page validation. */
174 virtual bool validatePage() RT_OVERRIDE RT_FINAL;
175
176private slots:
177
178 /** Handles change in format combo-box. */
179 void sltHandleFormatComboChange();
180
181 /** Handles change in file-name selector. */
182 void sltHandleFileSelectorChange();
183
184 /** Handles change in MAC address export policy combo-box. */
185 void sltHandleMACAddressExportPolicyComboChange();
186
187 /** Handles change in manifest check-box. */
188 void sltHandleManifestCheckBoxChange();
189
190 /** Handles change in include ISOs check-box. */
191 void sltHandleIncludeISOsCheckBoxChange();
192
193 /** Handles change in profile combo-box. */
194 void sltHandleProfileComboChange();
195
196 /** Handles cloud export radio-button clicked. */
197 void sltHandleRadioButtonToggled(QAbstractButton *pButton, bool fToggled);
198
199 /** Handles profile tool-button click. */
200 void sltHandleProfileButtonClick();
201
202 /** Handles translation event. */
203 virtual void sltRetranslateUI() RT_OVERRIDE RT_FINAL;
204
205private:
206
207 /** Update local stuff. */
208 void updateLocalStuff();
209
210 /** Updates cloud stuff. */
211 void updateCloudStuff();
212
213 /** Holds whether default format should be Export to OCI. */
214 bool m_fExportToOCIByDefault;
215
216 /** Holds the default appliance name. */
217 QString m_strDefaultApplianceName;
218 /** Holds the file selector name. */
219 QString m_strFileSelectorName;
220 /** Holds the file selector ext. */
221 QString m_strFileSelectorExt;
222
223 /** Holds the Cloud Profile object instance. */
224 CCloudProfile m_comCloudProfile;
225
226
227 /** Holds the format label instance. */
228 QIRichTextLabel *m_pLabelFormat;
229 /** Holds the settings label instance. */
230 QIRichTextLabel *m_pLabelSettings;
231
232 /** Holds the format layout. */
233 QGridLayout *m_pFormatLayout;
234 /** Holds the format combo-box label instance. */
235 QLabel *m_pFormatComboBoxLabel;
236 /** Holds the format combo-box instance. */
237 QIComboBox *m_pFormatComboBox;
238
239 /** Holds the settings widget 1 instance. */
240 QStackedWidget *m_pSettingsWidget1;
241
242 /** Holds the settings layout 1. */
243 QGridLayout *m_pSettingsLayout1;
244 /** Holds the file selector label instance. */
245 QLabel *m_pFileSelectorLabel;
246 /** Holds the file selector instance. */
247 UIEmptyFilePathSelector *m_pFileSelector;
248 /** Holds the MAC address policy combo-box label instance. */
249 QLabel *m_pMACComboBoxLabel;
250 /** Holds the MAC address policy check-box instance. */
251 QIComboBox *m_pMACComboBox;
252 /** Holds the additional label instance. */
253 QLabel *m_pAdditionalLabel;
254 /** Holds the manifest check-box instance. */
255 QCheckBox *m_pManifestCheckbox;
256 /** Holds the include ISOs check-box instance. */
257 QCheckBox *m_pIncludeISOsCheckbox;
258
259 /** Holds the settings layout 2. */
260 QGridLayout *m_pSettingsLayout2;
261 /** Holds the profile label instance. */
262 QLabel *m_pProfileLabel;
263 /** Holds the profile combo-box instance. */
264 QIComboBox *m_pProfileComboBox;
265 /** Holds the profile management tool-button instance. */
266 QIToolButton *m_pProfileToolButton;
267
268 /** Holds the export mode label instance. */
269 QLabel *m_pExportModeLabel;
270 /** Holds the export mode button group instance. */
271 QButtonGroup *m_pExportModeButtonGroup;
272 /** Holds the map of export mode button instances. */
273 QMap<CloudExportMode, QAbstractButton*> m_exportModeButtons;
274};
275
276#endif /* !FEQT_INCLUDED_SRC_wizards_exportappliance_UIWizardExportAppPageFormat_h */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette