1 | /* $Id: UIWizardAddCloudVMPageSource.h 98103 2023-01-17 14:15:46Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIWizardAddCloudVMPageSource 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_addcloudvm_UIWizardAddCloudVMPageSource_h
|
---|
29 | #define FEQT_INCLUDED_SRC_wizards_addcloudvm_UIWizardAddCloudVMPageSource_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 "COMEnums.h"
|
---|
39 | #include "CCloudClient.h"
|
---|
40 |
|
---|
41 | /* Forward declarations: */
|
---|
42 | class QGridLayout;
|
---|
43 | class QLabel;
|
---|
44 | class QListWidget;
|
---|
45 | class QIComboBox;
|
---|
46 | class QIRichTextLabel;
|
---|
47 | class QIToolButton;
|
---|
48 | class UINotificationCenter;
|
---|
49 | class UIWizardAddCloudVM;
|
---|
50 |
|
---|
51 | /** Provider combo data fields. */
|
---|
52 | enum
|
---|
53 | {
|
---|
54 | ProviderData_Name = Qt::UserRole + 1,
|
---|
55 | ProviderData_ShortName = Qt::UserRole + 2
|
---|
56 | };
|
---|
57 |
|
---|
58 | /** Profile combo data fields. */
|
---|
59 | enum
|
---|
60 | {
|
---|
61 | ProfileData_Name = Qt::UserRole + 1
|
---|
62 | };
|
---|
63 |
|
---|
64 | /** Namespace for source page of the Add Cloud VM wizard. */
|
---|
65 | namespace UIWizardAddCloudVMSource
|
---|
66 | {
|
---|
67 | /** Populates @a pCombo with known providers. */
|
---|
68 | void populateProviders(QIComboBox *pCombo, UINotificationCenter *pCenter);
|
---|
69 | /** Populates @a pCombo with known profiles.
|
---|
70 | * @param strProviderShortName Brings the short name of provider profiles related to.
|
---|
71 | * @param strProfileName Brings the name of profile to be chosen by default. */
|
---|
72 | void populateProfiles(QIComboBox *pCombo, UINotificationCenter *pCenter, const QString &strProviderShortName, const QString &strProfileName);
|
---|
73 | /** Populates @a pList with profile instances available in @a comClient. */
|
---|
74 | void populateProfileInstances(QListWidget *pList, UINotificationCenter *pCenter, const CCloudClient &comClient);
|
---|
75 |
|
---|
76 | /** Updates @a pCombo tool-tips. */
|
---|
77 | void updateComboToolTip(QIComboBox *pCombo);
|
---|
78 |
|
---|
79 | /** Returns current user data for @a pList specified. */
|
---|
80 | QStringList currentListWidgetData(QListWidget *pList);
|
---|
81 | }
|
---|
82 |
|
---|
83 | /** UINativeWizardPage extension for source page of the Add Cloud VM wizard,
|
---|
84 | * based on UIWizardAddCloudVMSource namespace functions. */
|
---|
85 | class UIWizardAddCloudVMPageSource : public UINativeWizardPage
|
---|
86 | {
|
---|
87 | Q_OBJECT;
|
---|
88 |
|
---|
89 | public:
|
---|
90 |
|
---|
91 | /** Constructs source page. */
|
---|
92 | UIWizardAddCloudVMPageSource();
|
---|
93 |
|
---|
94 | protected:
|
---|
95 |
|
---|
96 | /** Returns wizard this page belongs to. */
|
---|
97 | UIWizardAddCloudVM *wizard() const;
|
---|
98 |
|
---|
99 | /** Handles translation event. */
|
---|
100 | virtual void retranslateUi() /* override final */;
|
---|
101 |
|
---|
102 | /** Performs page initialization. */
|
---|
103 | virtual void initializePage() /* override final */;
|
---|
104 |
|
---|
105 | /** Returns whether page is complete. */
|
---|
106 | virtual bool isComplete() const /* override final */;
|
---|
107 |
|
---|
108 | /** Performs page validation. */
|
---|
109 | virtual bool validatePage() /* override final */;
|
---|
110 |
|
---|
111 | private slots:
|
---|
112 |
|
---|
113 | /** Handles change in provider combo-box. */
|
---|
114 | void sltHandleProviderComboChange();
|
---|
115 |
|
---|
116 | /** Handles change in profile combo-box. */
|
---|
117 | void sltHandleProfileComboChange();
|
---|
118 | /** Handles profile tool-button click. */
|
---|
119 | void sltHandleProfileButtonClick();
|
---|
120 |
|
---|
121 | /** Handles change in instance list. */
|
---|
122 | void sltHandleSourceInstanceChange();
|
---|
123 |
|
---|
124 | private:
|
---|
125 |
|
---|
126 | /** Holds the main label instance. */
|
---|
127 | QIRichTextLabel *m_pLabelMain;
|
---|
128 |
|
---|
129 | /** Holds the provider layout instance. */
|
---|
130 | QGridLayout *m_pProviderLayout;
|
---|
131 | /** Holds the provider type label instance. */
|
---|
132 | QLabel *m_pProviderLabel;
|
---|
133 | /** Holds the provider type combo-box instance. */
|
---|
134 | QIComboBox *m_pProviderComboBox;
|
---|
135 |
|
---|
136 | /** Holds the description label instance. */
|
---|
137 | QIRichTextLabel *m_pLabelDescription;
|
---|
138 |
|
---|
139 | /** Holds the options layout instance. */
|
---|
140 | QGridLayout *m_pOptionsLayout;
|
---|
141 | /** Holds the profile label instance. */
|
---|
142 | QLabel *m_pProfileLabel;
|
---|
143 | /** Holds the profile combo-box instance. */
|
---|
144 | QIComboBox *m_pProfileComboBox;
|
---|
145 | /** Holds the profile management tool-button instance. */
|
---|
146 | QIToolButton *m_pProfileToolButton;
|
---|
147 | /** Holds the source instance label instance. */
|
---|
148 | QLabel *m_pSourceInstanceLabel;
|
---|
149 | /** Holds the source instance list instance. */
|
---|
150 | QListWidget *m_pSourceInstanceList;
|
---|
151 | };
|
---|
152 |
|
---|
153 | #endif /* !FEQT_INCLUDED_SRC_wizards_addcloudvm_UIWizardAddCloudVMPageSource_h */
|
---|