VirtualBox

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

Last change on this file since 92173 was 92173, checked in by vboxsync, 3 years ago

FE/Qt: bugref:10067: Migrate most of UIMessageCenter in UICloudNetworkingStuff to UINotificationCenter.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.6 KB
Line 
1/* $Id: UIWizardNewCloudVMPageSource.h 92173 2021-11-02 09:43:08Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIWizardNewCloudVMPageSource class declaration.
4 */
5
6/*
7 * Copyright (C) 2009-2021 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef FEQT_INCLUDED_SRC_wizards_newcloudvm_UIWizardNewCloudVMPageSource_h
19#define FEQT_INCLUDED_SRC_wizards_newcloudvm_UIWizardNewCloudVMPageSource_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24/* GUI includes: */
25#include "UINativeWizardPage.h"
26
27/* COM includes: */
28#include "COMEnums.h"
29#include "CVirtualSystemDescription.h"
30
31/* Forward declarations: */
32class QGridLayout;
33class QLabel;
34class QListWidget;
35class QTabBar;
36class QIComboBox;
37class QIRichTextLabel;
38class QIToolButton;
39class UINotificationCenter;
40class UIWizardNewCloudVM;
41class CCloudClient;
42class CCloudProvider;
43
44/** Provider combo data fields. */
45enum
46{
47 ProviderData_Name = Qt::UserRole + 1,
48 ProviderData_ShortName = Qt::UserRole + 2
49};
50
51/** Profile combo data fields. */
52enum
53{
54 ProfileData_Name = Qt::UserRole + 1
55};
56
57/** Namespace for source page of the New Cloud VM wizard. */
58namespace UIWizardNewCloudVMSource
59{
60 /** Populates @a pCombo with known providers. */
61 void populateProviders(QIComboBox *pCombo, UINotificationCenter *pCenter);
62 /** Populates @a pCombo with known profiles.
63 * @param strProviderShortName Brings the short name of provider profiles related to.
64 * @param strProfileName Brings the name of profile to be chosen by default. */
65 void populateProfiles(QIComboBox *pCombo,
66 UINotificationCenter *pCenter,
67 const QString &strProviderShortName,
68 const QString &strProfileName);
69 /** Populates @a pList with source images.
70 @param pTabBar Brings the tab-bar source images should be acquired for.
71 @param comClient Brings the cloud client source images should be acquired from. */
72 void populateSourceImages(QListWidget *pList,
73 QTabBar *pTabBar,
74 const CCloudClient &comClient);
75 /** Populates @a comVSD with form property.
76 * @param pWizard Brings the wizard used as parent for warnings inside.
77 * @param pTabBar Brings the tab-bar property should gather according to.
78 * @param strImageId Brings the image id which should be added as property. */
79 void populateFormProperties(CVirtualSystemDescription comVSD,
80 UIWizardNewCloudVM *pWizard,
81 QTabBar *pTabBar,
82 const QString &strImageId);
83
84 /** Updates @a pCombo tool-tips. */
85 void updateComboToolTip(QIComboBox *pCombo);
86
87 /** Returns current user data for @a pList specified. */
88 QString currentListWidgetData(QListWidget *pList);
89}
90
91/** UINativeWizardPage extension for source page of the New Cloud VM wizard,
92 * based on UIWizardNewCloudVMSource namespace functions. */
93class UIWizardNewCloudVMPageSource : public UINativeWizardPage
94{
95 Q_OBJECT;
96
97public:
98
99 /** Constructs source basic page. */
100 UIWizardNewCloudVMPageSource();
101
102protected:
103
104 /** Returns wizard this page belongs to. */
105 UIWizardNewCloudVM *wizard() const;
106
107 /** Handles translation event. */
108 virtual void retranslateUi() /* override final */;
109
110 /** Performs page initialization. */
111 virtual void initializePage() /* override final */;
112
113 /** Returns whether page is complete. */
114 virtual bool isComplete() const /* override final */;
115
116 /** Performs page validation. */
117 virtual bool validatePage() /* override final */;
118
119private slots:
120
121 /** Handles change in provider combo-box. */
122 void sltHandleProviderComboChange();
123
124 /** Handles change in profile combo-box. */
125 void sltHandleProfileComboChange();
126 /** Handles profile tool-button click. */
127 void sltHandleProfileButtonClick();
128
129 /** Handles change in source tab-bar. */
130 void sltHandleSourceTabBarChange();
131
132 /** Handles change in image list. */
133 void sltHandleSourceImageChange();
134
135private:
136
137 /** Holds the image ID. */
138 QString m_strSourceImageId;
139
140 /** Holds the main label instance. */
141 QIRichTextLabel *m_pLabelMain;
142
143 /** Holds the provider layout instance. */
144 QGridLayout *m_pProviderLayout;
145 /** Holds the provider type label instance. */
146 QLabel *m_pProviderLabel;
147 /** Holds the provider type combo-box instance. */
148 QIComboBox *m_pProviderComboBox;
149
150 /** Holds the description label instance. */
151 QIRichTextLabel *m_pLabelDescription;
152
153 /** Holds the options layout instance. */
154 QGridLayout *m_pOptionsLayout;
155 /** Holds the profile label instance. */
156 QLabel *m_pProfileLabel;
157 /** Holds the profile combo-box instance. */
158 QIComboBox *m_pProfileComboBox;
159 /** Holds the profile management tool-button instance. */
160 QIToolButton *m_pProfileToolButton;
161 /** Holds the source image label instance. */
162 QLabel *m_pSourceImageLabel;
163 /** Holds the source tab-bar instance. */
164 QTabBar *m_pSourceTabBar;
165 /** Holds the source image list instance. */
166 QListWidget *m_pSourceImageList;
167};
168
169#endif /* !FEQT_INCLUDED_SRC_wizards_newcloudvm_UIWizardNewCloudVMPageSource_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