- Timestamp:
- Mar 2, 2021 12:46:18 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageBasic2.cpp
r87890 r87912 83 83 pMainLayout->addLayout(pVariantLayout); 84 84 pMainLayout->addStretch(); 85 pMainLayout->setContentsMargins(0, 0, 0, 0); 85 86 } 86 87 return pContainerWidget; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic4.cpp
r87907 r87912 19 19 #include <QButtonGroup> 20 20 #include <QGridLayout> 21 #include <QGroupBox> 21 22 #include <QMetaType> 22 23 #include <QRadioButton> … … 46 47 , m_pDiskSelector(0) 47 48 , m_pDiskSelectionButton(0) 49 , m_pMediumVariantContainer(0) 50 , m_pSizeContainer(0) 48 51 , m_enmSelectedDiskSource(SelectedDiskSource_New) 49 52 { … … 138 141 if (m_pDiskSelectionButton) 139 142 m_pDiskSelectionButton->setToolTip(UIWizardNewVM::tr("Choose a virtual hard disk file...")); 143 if (m_pMediumVariantContainer) 144 m_pMediumVariantContainer->setTitle(UIWizardNewVM::tr("Storage on physical hard disk")); 145 if (m_pSizeContainer) 146 m_pSizeContainer->setTitle(UIWizardNewVM::tr("File size")); 140 147 } 141 148 … … 147 154 m_pDiskSelector->setEnabled(fEnabled); 148 155 m_pDiskSelectionButton->setEnabled(fEnabled); 156 } 157 158 QWidget *UIWizardNewVMPage4::createDiskVariantAndSizeWidgets() 159 { 160 return new QWidget(); 149 161 } 150 162 … … 174 186 m_pDiskSelectionButton->setIcon(UIIconPool::iconSet(":/select_file_16px.png", ":/select_file_disabled_16px.png")); 175 187 } 176 pDiskLayout->addWidget(m_pDiskEmpty, 0, 0, 1, 3); 177 pDiskLayout->addWidget(m_pDiskNew, 1, 0, 1, 3); 178 pDiskLayout->addWidget(m_pDiskExisting, 2, 0, 1, 3); 179 pDiskLayout->addWidget(m_pDiskSelector, 3, 1); 180 pDiskLayout->addWidget(m_pDiskSelectionButton, 3, 2); 188 pDiskLayout->addWidget(m_pDiskEmpty, 0, 0, 1, 4); 189 pDiskLayout->addWidget(m_pDiskNew, 1, 0, 1, 4); 190 pDiskLayout->addWidget(createDiskVariantAndSizeWidgets(), 2, 1, 3, 3); 191 pDiskLayout->addWidget(m_pDiskExisting, 5, 0, 1, 4); 192 pDiskLayout->addWidget(m_pDiskSelector, 6, 1, 1, 2); 193 pDiskLayout->addWidget(m_pDiskSelectionButton, 6, 3, 1, 1); 181 194 return pDiskContainer; 182 195 } … … 246 259 pMainLayout->addStretch(); 247 260 setEnableDiskSelectionWidgets(m_enmSelectedDiskSource == SelectedDiskSource_Existing); 248 249 250 pMainLayout->addWidget(createMediumVariantWidgets(true)); 251 261 setEnableNewDiskWidgets(m_enmSelectedDiskSource == SelectedDiskSource_New); 262 263 createConnections(); 264 } 265 266 QWidget *UIWizardNewVMPageBasic4::createDiskVariantAndSizeWidgets() 267 { 268 269 QWidget *pWidget = new QWidget; 270 QHBoxLayout *pLayout = new QHBoxLayout(pWidget); 271 pLayout->setContentsMargins(0, 0, 0, 0); 272 273 m_pMediumVariantContainer = new QGroupBox; 274 QVBoxLayout *pMediumVariantLayout = new QVBoxLayout(m_pMediumVariantContainer); 275 pMediumVariantLayout->addWidget(createMediumVariantWidgets(false /* no labels */)); 276 pLayout->addWidget(m_pMediumVariantContainer); 277 278 m_pSizeContainer = new QGroupBox; 279 QVBoxLayout *pSizeLayout = new QVBoxLayout(m_pSizeContainer); 252 280 m_pSizeLabel = new QIRichTextLabel; 253 281 m_pSizeEditor = new UIMediumSizeEditor; 254 255 pMainLayout->addWidget(m_pSizeLabel); 256 pMainLayout->addWidget(m_pSizeEditor); 257 258 createConnections(); 282 pSizeLayout->addWidget(m_pSizeLabel); 283 pSizeLayout->addWidget(m_pSizeEditor); 284 pSizeLayout->addStretch(); 285 pLayout->addWidget(m_pSizeContainer); 286 287 return pWidget; 259 288 } 260 289 … … 286 315 287 316 setEnableDiskSelectionWidgets(m_enmSelectedDiskSource == SelectedDiskSource_Existing); 317 setEnableNewDiskWidgets(m_enmSelectedDiskSource == SelectedDiskSource_New); 318 288 319 completeChanged(); 289 320 } … … 373 404 bool UIWizardNewVMPageBasic4::isComplete() const 374 405 { 375 if ( !m_pDiskEmpty)376 return false;377 return m_pDiskEmpty->isChecked() ||378 !m_pDiskExisting->isChecked() ||379 !uiCommon().medium(m_pDiskSelector->id()).isNull();406 if (selectedDiskSource() == SelectedDiskSource_New) 407 return mediumSize() >= m_uMediumSizeMin && mediumSize() <= m_uMediumSizeMax; 408 if (selectedDiskSource() == SelectedDiskSource_Existing) 409 return m_virtualDisk.isNull(); 410 return true; 380 411 } 381 412 … … 396 427 m_fUserSetSize = true; 397 428 } 429 430 void UIWizardNewVMPageBasic4::setEnableNewDiskWidgets(bool fEnable) 431 { 432 if (m_pMediumVariantContainer) 433 m_pMediumVariantContainer->setEnabled(fEnable); 434 435 if (m_pSizeContainer) 436 m_pSizeContainer->setEnabled(fEnable); 437 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic4.h
r87907 r87912 38 38 /* Forward declarations: */ 39 39 class QButtonGroup; 40 class QGroupBox; 40 41 class QRadioButton; 41 42 class QIRichTextLabel; … … 64 65 65 66 QWidget *createDiskWidgets(); 67 virtual QWidget *createDiskVariantAndSizeWidgets(); 66 68 67 69 void ensureNewVirtualDiskDeleted(); … … 84 86 UIMediaComboBox *m_pDiskSelector; 85 87 QIToolButton *m_pDiskSelectionButton; 88 QGroupBox *m_pMediumVariantContainer; 89 QGroupBox *m_pSizeContainer; 86 90 /** @} */ 87 91 SelectedDiskSource m_enmSelectedDiskSource; … … 129 133 private: 130 134 131 132 135 void prepare(); 133 136 void createConnections(); 137 QWidget *createDiskVariantAndSizeWidgets(); 134 138 void retranslateUi(); 135 139 void initializePage(); 136 140 void cleanupPage(); 141 void setEnableNewDiskWidgets(bool fEnable); 137 142 138 143 bool isComplete() const; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp
r87892 r87912 53 53 m_pToolBox->insertPage(ExpertToolboxItems_NameAndOSType, createNameOSTypeWidgets(/* fCreateLabels */ false), ""); 54 54 m_pToolBox->insertPage(ExpertToolboxItems_Unattended, createUnattendedWidgets(), "", false); 55 m_pToolBox->insertPage(ExpertToolboxItems_Disk, createDiskWidgets(), "");55 //m_pToolBox->insertPage(ExpertToolboxItems_Disk, createDiskWidgets(), ""); 56 56 m_pToolBox->insertPage(ExpertToolboxItems_Hardware, createHardwareWidgets(), ""); 57 57
Note:
See TracChangeset
for help on using the changeset viewer.