VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageSource.h

Last change on this file was 103982, checked in by vboxsync, 2 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: 5.9 KB
Line 
1/* $Id: UIWizardNewCloudVMPageSource.h 103982 2024-03-21 11:43:53Z 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: */
41class QGridLayout;
42class QLabel;
43class QListWidget;
44class QTabBar;
45class QIComboBox;
46class QIRichTextLabel;
47class QIToolButton;
48class UINotificationCenter;
49class UIWizardNewCloudVM;
50class CCloudClient;
51class CCloudProvider;
52
53/** Provider combo data fields. */
54enum
55{
56 ProviderData_Name = Qt::UserRole + 1,
57 ProviderData_ShortName = Qt::UserRole + 2
58};
59
60/** Profile combo data fields. */
61enum
62{
63 ProfileData_Name = Qt::UserRole + 1
64};
65
66/** Namespace for source page of the New Cloud VM wizard. */
67namespace 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 /** Updates @a pCombo tool-tips. */
95 void updateComboToolTip(QIComboBox *pCombo);
96
97 /** Returns current user data for @a pList specified. */
98 QString currentListWidgetData(QListWidget *pList);
99}
100
101/** UINativeWizardPage extension for source page of the New Cloud VM wizard,
102 * based on UIWizardNewCloudVMSource namespace functions. */
103class UIWizardNewCloudVMPageSource : public UINativeWizardPage
104{
105 Q_OBJECT;
106
107public:
108
109 /** Constructs source basic page. */
110 UIWizardNewCloudVMPageSource();
111
112protected:
113
114 /** Returns wizard this page belongs to. */
115 UIWizardNewCloudVM *wizard() const;
116
117 /** Performs page initialization. */
118 virtual void initializePage() RT_OVERRIDE RT_FINAL;
119
120 /** Returns whether page is complete. */
121 virtual bool isComplete() const RT_OVERRIDE RT_FINAL;
122
123 /** Performs page validation. */
124 virtual bool validatePage() RT_OVERRIDE RT_FINAL;
125
126private slots:
127
128 /** Handles change in provider combo-box. */
129 void sltHandleProviderComboChange();
130
131 /** Handles change in profile combo-box. */
132 void sltHandleProfileComboChange();
133 /** Handles profile tool-button click. */
134 void sltHandleProfileButtonClick();
135
136 /** Handles change in source tab-bar. */
137 void sltHandleSourceTabBarChange();
138
139 /** Handles change in image list. */
140 void sltHandleSourceImageChange();
141
142 /** Handles translation event. */
143 virtual void sltRetranslateUI() RT_OVERRIDE RT_FINAL;
144
145private:
146
147 /** Holds the image ID. */
148 QString m_strSourceImageId;
149
150 /** Holds the main label instance. */
151 QIRichTextLabel *m_pLabelMain;
152
153 /** Holds the provider layout instance. */
154 QGridLayout *m_pProviderLayout;
155 /** Holds the provider type label instance. */
156 QLabel *m_pProviderLabel;
157 /** Holds the provider type combo-box instance. */
158 QIComboBox *m_pProviderComboBox;
159
160 /** Holds the description label instance. */
161 QIRichTextLabel *m_pLabelDescription;
162
163 /** Holds the options layout instance. */
164 QGridLayout *m_pOptionsLayout;
165 /** Holds the profile label instance. */
166 QLabel *m_pProfileLabel;
167 /** Holds the profile combo-box instance. */
168 QIComboBox *m_pProfileComboBox;
169 /** Holds the profile management tool-button instance. */
170 QIToolButton *m_pProfileToolButton;
171 /** Holds the source image label instance. */
172 QLabel *m_pSourceImageLabel;
173 /** Holds the source tab-bar instance. */
174 QTabBar *m_pSourceTabBar;
175 /** Holds the source image list instance. */
176 QListWidget *m_pSourceImageList;
177};
178
179#endif /* !FEQT_INCLUDED_SRC_wizards_newcloudvm_UIWizardNewCloudVMPageSource_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use