Changeset 91499 in vbox for trunk/src/VBox
- Timestamp:
- Sep 30, 2021 2:39:22 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVM.cpp
r91335 r91499 16 16 */ 17 17 18 /* Qt includes: */19 #include <QPushButton>20 21 18 /* GUI includes: */ 22 #include "UICommon.h"23 19 #include "UIMessageCenter.h" 24 20 #include "UINotificationCenter.h" … … 35 31 36 32 UIWizardNewCloudVM::UIWizardNewCloudVM(QWidget *pParent, 37 const QString &strFullGroupName /* = QString() */, 38 const CCloudClient &comClient /* = CCloudClient() */, 39 const CVirtualSystemDescription &comVSD /* = CVirtualSystemDescription() */, 40 WizardMode enmMode /* = WizardMode_Auto */) 41 : UINativeWizard(pParent, WizardType_NewCloudVM, enmMode) 42 , m_comClient(comClient) 43 , m_comVSD(comVSD) 44 , m_fFullWizard(m_comClient.isNull() || m_comVSD.isNull()) 45 , m_fFinalStepPrevented(false) 33 const QString &strFullGroupName /* = QString() */) 34 : UINativeWizard(pParent, WizardType_NewCloudVM) 46 35 { 47 36 #ifndef VBOX_WS_MAC … … 131 120 bool fResult = false; 132 121 133 /* Do nothing if prevented: */134 if (m_fFinalStepPrevented)135 {136 fResult = true;137 return fResult;138 }139 140 122 /* Acquire prepared client and description: */ 141 123 CCloudClient comClient = client(); … … 163 145 } 164 146 165 void UIWizardNewCloudVM::scheduleAutoFinish()166 {167 QMetaObject::invokeMethod(this, "sltTriggerFinishButton", Qt::QueuedConnection);168 }169 170 147 void UIWizardNewCloudVM::populatePages() 171 148 { … … 175 152 case WizardMode_Basic: 176 153 { 177 if (m_fFullWizard) 178 addPage(new UIWizardNewCloudVMPageSource); 154 addPage(new UIWizardNewCloudVMPageSource); 179 155 addPage(new UIWizardNewCloudVMPageProperties); 180 156 break; … … 182 158 case WizardMode_Expert: 183 159 { 184 addPage(new UIWizardNewCloudVMPageExpert (m_fFullWizard));160 addPage(new UIWizardNewCloudVMPageExpert); 185 161 break; 186 162 } … … 203 179 //setButtonText(QWizard::FinishButton, tr("Create")); 204 180 } 205 206 void UIWizardNewCloudVM::sltTriggerFinishButton()207 {208 wizardButton(WizardButtonType_Next)->click();209 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVM.h
r91335 r91499 39 39 40 40 /** Constructs New Cloud VM wizard passing @a pParent & @a enmMode to the base-class. 41 * @param strFullGroupName Brings full group name (/provider/profile) to create VM in. 42 * @param comClient Brings the Cloud Client object to work with. 43 * @param comVSD Brings the Virtual System Description object to use. */ 44 UIWizardNewCloudVM(QWidget *pParent, 45 const QString &strFullGroupName = QString(), 46 const CCloudClient &comClient = CCloudClient(), 47 const CVirtualSystemDescription &comVSD = CVirtualSystemDescription(), 48 WizardMode enmMode = WizardMode_Auto); 49 50 /** Sets whether the final step is @a fPrevented. */ 51 void setFinalStepPrevented(bool fPrevented) { m_fFinalStepPrevented = fPrevented; } 41 * @param strFullGroupName Brings full group name (/provider/profile) to create VM in. */ 42 UIWizardNewCloudVM(QWidget *pParent, const QString &strFullGroupName); 52 43 53 44 /** Defines @a strProviderShortName. */ … … 82 73 bool createCloudVM(); 83 74 84 /** Schedules Finish button trigger for85 * the next event-loop cicle. */86 void scheduleAutoFinish();87 88 75 protected: 89 76 … … 93 80 /** Handles translation event. */ 94 81 virtual void retranslateUi() /* override final */; 95 96 private slots:97 98 /** Triggers Finish button. */99 void sltTriggerFinishButton();100 82 101 83 private: … … 111 93 /** Holds the Virtual System Description Form object reference. */ 112 94 CVirtualSystemDescriptionForm m_comVSDForm; 113 114 /** Holds whether we want full wizard form or short one. */115 bool m_fFullWizard;116 /** Holds whether the final step is prevented. */117 bool m_fFinalStepPrevented;118 95 }; 119 96 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageExpert.cpp
r91412 r91499 40 40 41 41 42 UIWizardNewCloudVMPageExpert::UIWizardNewCloudVMPageExpert(bool fFullWizard) 43 : m_fFullWizard(fFullWizard) 44 , m_pCntLocation(0) 42 UIWizardNewCloudVMPageExpert::UIWizardNewCloudVMPageExpert() 43 : m_pCntLocation(0) 45 44 , m_pProviderComboBox(0) 46 45 , m_pProfileComboBox(0) … … 63 62 if (m_pCntLocation) 64 63 { 65 /* There is no location container in short wizard form: */66 if (!m_fFullWizard)67 m_pCntLocation->setVisible(false);68 69 64 /* Prepare location layout: */ 70 65 QVBoxLayout *pLocationLayout = new QVBoxLayout(m_pCntLocation); … … 110 105 if (m_pCntSource) 111 106 { 112 /* There is no source table in short wizard form: */113 if (!m_fFullWizard)114 m_pCntSource->setVisible(false);115 116 107 /* Prepare source layout: */ 117 108 QVBoxLayout *pSourceLayout = new QVBoxLayout(m_pCntSource); … … 256 247 void UIWizardNewCloudVMPageExpert::initializePage() 257 248 { 258 if (m_fFullWizard) 259 { 260 /* Populate providers: */ 261 populateProviders(m_pProviderComboBox); 262 /* Translate providers: */ 263 retranslateUi(); 264 /* Fetch it, asynchronously: */ 265 QMetaObject::invokeMethod(this, "sltHandleProviderComboChange", Qt::QueuedConnection); 266 /* Make image list focused by default: */ 267 m_pSourceImageList->setFocus(); 268 } 269 else 270 { 271 /* Generate VSD form, asynchronously: */ 272 QMetaObject::invokeMethod(this, "sltInitShortWizardForm", Qt::QueuedConnection); 273 } 249 /* Populate providers: */ 250 populateProviders(m_pProviderComboBox); 251 /* Translate providers: */ 252 retranslateUi(); 253 /* Make image list focused by default: */ 254 m_pSourceImageList->setFocus(); 255 /* Fetch it, asynchronously: */ 256 QMetaObject::invokeMethod(this, "sltHandleProviderComboChange", Qt::QueuedConnection); 274 257 } 275 258 … … 316 299 { 317 300 wizard()->setVSDForm(CVirtualSystemDescriptionForm()); 318 sltInitShortWizardForm(); 301 wizard()->createVSDForm(); 302 updatePropertiesTable(); 303 emit completeChanged(); 319 304 } 320 305 } … … 351 336 { 352 337 updateSourceImage(); 353 emit completeChanged();354 }355 356 void UIWizardNewCloudVMPageExpert::sltInitShortWizardForm()357 {358 if (wizard()->vsdForm().isNull())359 wizard()->createVSDForm();360 updatePropertiesTable();361 338 emit completeChanged(); 362 339 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageExpert.h
r91412 r91499 39 39 40 40 /** Constructs expert page. */ 41 UIWizardNewCloudVMPageExpert( bool fFullWizard);41 UIWizardNewCloudVMPageExpert(); 42 42 43 43 protected: … … 73 73 /** Handles change in instance list. */ 74 74 void sltHandleSourceImageChange(); 75 76 /** Initializes short wizard form. */77 void sltInitShortWizardForm();78 75 79 76 private: -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageProperties.h
r91412 r91499 25 25 #include "UINativeWizardPage.h" 26 26 27 /* COM includes: */28 #include "CVirtualSystemDescriptionForm.h"29 30 27 /* Forward declarations: */ 31 28 class QIRichTextLabel; 32 29 class UIFormEditorWidget; 33 30 class UIWizardNewCloudVM; 31 class CVirtualSystemDescriptionForm; 34 32 35 33 /** Namespace for properties page of the New Cloud VM wizard. */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageSource.cpp
r91411 r91499 17 17 18 18 /* Qt includes: */ 19 #include <QHeaderView>20 19 #include <QGridLayout> 21 20 #include <QLabel> 22 21 #include <QListWidget> 23 22 #include <QTabBar> 24 #include <QTableWidget>25 23 #include <QVBoxLayout> 26 24 … … 38 36 39 37 /* COM includes: */ 40 #include "CAppliance.h"41 38 #include "CStringArray.h" 42 39 … … 164 161 } 165 162 166 void UIWizardNewCloudVMSource::populateSourceImages(QListWidget *pList, QTabBar *pTabBar, const CCloudClient &comClient) 163 void UIWizardNewCloudVMSource::populateSourceImages(QListWidget *pList, 164 QTabBar *pTabBar, 165 const CCloudClient &comClient) 167 166 { 168 167 /* Sanity check: */ … … 217 216 } 218 217 219 void UIWizardNewCloudVMSource::populateFormProperties(CVirtualSystemDescription comVSD, QTabBar *pTabBar, const QString &strImageId) 218 void UIWizardNewCloudVMSource::populateFormProperties(CVirtualSystemDescription comVSD, 219 QTabBar *pTabBar, 220 const QString &strImageId) 220 221 { 221 222 /* Sanity check: */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newcloudvm/UIWizardNewCloudVMPageSource.h
r91410 r91499 27 27 /* COM includes: */ 28 28 #include "COMEnums.h" 29 #include "CCloudClient.h"30 29 #include "CVirtualSystemDescription.h" 31 #include "CVirtualSystemDescriptionForm.h"32 30 33 31 /* Forward declarations: */ … … 40 38 class QIToolButton; 41 39 class UIWizardNewCloudVM; 40 class CCloudClient; 42 41 class CCloudProvider; 43 42
Note:
See TracChangeset
for help on using the changeset viewer.