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