1 | /* $Id: UIWizardNewCloudVMPageSource.h 104555 2024-05-08 13:20:58Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIWizardNewCloudVMPageSource 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_newcloudvm_UIWizardNewCloudVMPageSource_h
|
---|
29 | #define FEQT_INCLUDED_SRC_wizards_newcloudvm_UIWizardNewCloudVMPageSource_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /* GUI includes: */
|
---|
35 | #include "UINativeWizardPage.h"
|
---|
36 |
|
---|
37 | /* COM includes: */
|
---|
38 | #include "CVirtualSystemDescription.h"
|
---|
39 |
|
---|
40 | /* Forward declarations: */
|
---|
41 | class QGridLayout;
|
---|
42 | class QLabel;
|
---|
43 | class QListWidget;
|
---|
44 | class QTabBar;
|
---|
45 | class QIComboBox;
|
---|
46 | class QIRichTextLabel;
|
---|
47 | class QIToolButton;
|
---|
48 | class UINotificationCenter;
|
---|
49 | class UIWizardNewCloudVM;
|
---|
50 | class CCloudClient;
|
---|
51 | class CCloudProvider;
|
---|
52 |
|
---|
53 | /** Provider combo data fields. */
|
---|
54 | enum
|
---|
55 | {
|
---|
56 | ProviderData_Name = Qt::UserRole + 1,
|
---|
57 | ProviderData_ShortName = Qt::UserRole + 2
|
---|
58 | };
|
---|
59 |
|
---|
60 | /** Profile combo data fields. */
|
---|
61 | enum
|
---|
62 | {
|
---|
63 | ProfileData_Name = Qt::UserRole + 1
|
---|
64 | };
|
---|
65 |
|
---|
66 | /** Namespace for source page of the New Cloud VM wizard. */
|
---|
67 | namespace UIWizardNewCloudVMSource
|
---|
68 | {
|
---|
69 | /** Populates @a pCombo with known providers. */
|
---|
70 | void populateProviders(QIComboBox *pCombo, UINotificationCenter *pCenter);
|
---|
71 | /** Populates @a pCombo with known profiles.
|
---|
72 | * @param strProviderShortName Brings the short name of provider profiles related to.
|
---|
73 | * @param strProfileName Brings the name of profile to be chosen by default. */
|
---|
74 | void populateProfiles(QIComboBox *pCombo,
|
---|
75 | UINotificationCenter *pCenter,
|
---|
76 | const QString &strProviderShortName,
|
---|
77 | const QString &strProfileName);
|
---|
78 | /** Populates @a pList with source images.
|
---|
79 | @param pTabBar Brings the tab-bar source images should be acquired for.
|
---|
80 | @param comClient Brings the cloud client source images should be acquired from. */
|
---|
81 | void populateSourceImages(QListWidget *pList,
|
---|
82 | QTabBar *pTabBar,
|
---|
83 | UINotificationCenter *pCenter,
|
---|
84 | const CCloudClient &comClient);
|
---|
85 | /** Populates @a comVSD with form property.
|
---|
86 | * @param pWizard Brings the wizard used as parent for warnings inside.
|
---|
87 | * @param pTabBar Brings the tab-bar property should gather according to.
|
---|
88 | * @param strImageId Brings the image id which should be added as property. */
|
---|
89 | void populateFormProperties(CVirtualSystemDescription comVSD,
|
---|
90 | UIWizardNewCloudVM *pWizard,
|
---|
91 | QTabBar *pTabBar,
|
---|
92 | const QString &strImageId);
|
---|
93 |
|
---|
94 | /** Returns current user data for @a pList specified. */
|
---|
95 | QString currentListWidgetData(QListWidget *pList);
|
---|
96 | }
|
---|
97 |
|
---|
98 | /** UINativeWizardPage extension for source page of the New Cloud VM wizard,
|
---|
99 | * based on UIWizardNewCloudVMSource namespace functions. */
|
---|
100 | class UIWizardNewCloudVMPageSource : public UINativeWizardPage
|
---|
101 | {
|
---|
102 | Q_OBJECT;
|
---|
103 |
|
---|
104 | public:
|
---|
105 |
|
---|
106 | /** Constructs source basic page. */
|
---|
107 | UIWizardNewCloudVMPageSource();
|
---|
108 |
|
---|
109 | protected:
|
---|
110 |
|
---|
111 | /** Returns wizard this page belongs to. */
|
---|
112 | UIWizardNewCloudVM *wizard() const;
|
---|
113 |
|
---|
114 | /** Performs page initialization. */
|
---|
115 | virtual void initializePage() RT_OVERRIDE RT_FINAL;
|
---|
116 |
|
---|
117 | /** Returns whether page is complete. */
|
---|
118 | virtual bool isComplete() const RT_OVERRIDE RT_FINAL;
|
---|
119 |
|
---|
120 | /** Performs page validation. */
|
---|
121 | virtual bool validatePage() RT_OVERRIDE RT_FINAL;
|
---|
122 |
|
---|
123 | private slots:
|
---|
124 |
|
---|
125 | /** Handles change in provider combo-box. */
|
---|
126 | void sltHandleProviderComboChange();
|
---|
127 |
|
---|
128 | /** Handles change in profile combo-box. */
|
---|
129 | void sltHandleProfileComboChange();
|
---|
130 | /** Handles profile tool-button click. */
|
---|
131 | void sltHandleProfileButtonClick();
|
---|
132 |
|
---|
133 | /** Handles change in source tab-bar. */
|
---|
134 | void sltHandleSourceTabBarChange();
|
---|
135 |
|
---|
136 | /** Handles change in image list. */
|
---|
137 | void sltHandleSourceImageChange();
|
---|
138 |
|
---|
139 | /** Handles translation event. */
|
---|
140 | virtual void sltRetranslateUI() RT_OVERRIDE RT_FINAL;
|
---|
141 |
|
---|
142 | private:
|
---|
143 |
|
---|
144 | /** Holds the image ID. */
|
---|
145 | QString m_strSourceImageId;
|
---|
146 |
|
---|
147 | /** Holds the main label instance. */
|
---|
148 | QIRichTextLabel *m_pLabelMain;
|
---|
149 |
|
---|
150 | /** Holds the provider layout instance. */
|
---|
151 | QGridLayout *m_pProviderLayout;
|
---|
152 | /** Holds the provider type label instance. */
|
---|
153 | QLabel *m_pProviderLabel;
|
---|
154 | /** Holds the provider type combo-box instance. */
|
---|
155 | QIComboBox *m_pProviderComboBox;
|
---|
156 |
|
---|
157 | /** Holds the description label instance. */
|
---|
158 | QIRichTextLabel *m_pLabelDescription;
|
---|
159 |
|
---|
160 | /** Holds the options layout instance. */
|
---|
161 | QGridLayout *m_pOptionsLayout;
|
---|
162 | /** Holds the profile label instance. */
|
---|
163 | QLabel *m_pProfileLabel;
|
---|
164 | /** Holds the profile combo-box instance. */
|
---|
165 | QIComboBox *m_pProfileComboBox;
|
---|
166 | /** Holds the profile management tool-button instance. */
|
---|
167 | QIToolButton *m_pProfileToolButton;
|
---|
168 | /** Holds the source image label instance. */
|
---|
169 | QLabel *m_pSourceImageLabel;
|
---|
170 | /** Holds the source tab-bar instance. */
|
---|
171 | QTabBar *m_pSourceTabBar;
|
---|
172 | /** Holds the source image list instance. */
|
---|
173 | QListWidget *m_pSourceImageList;
|
---|
174 | };
|
---|
175 |
|
---|
176 | #endif /* !FEQT_INCLUDED_SRC_wizards_newcloudvm_UIWizardNewCloudVMPageSource_h */
|
---|