Changeset 88065 in vbox
- Timestamp:
- Mar 10, 2021 11:05:15 AM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.cpp
r87941 r88065 180 180 UIWizardNewVMPage1::UIWizardNewVMPage1(const QString &strGroup) 181 181 : m_pNameAndSystemEditor(0) 182 , m_pNameOSTypeLabel(0)183 182 , m_pISOFilePathSelector(0) 184 , m_pUnattendedLabel(0)185 183 , m_pISOPathSelectorLabel(0) 186 184 , m_strGroup(strGroup) … … 235 233 } 236 234 237 QWidget *UIWizardNewVMPage1::createNameOSTypeWidgets(bool fCreateLabels) 238 { 239 QWidget *pContainer = new QWidget; 240 QGridLayout *pLayout = new QGridLayout(pContainer); 241 242 int iRow = 0; 243 if (fCreateLabels) 244 { 245 m_pNameOSTypeLabel = new QIRichTextLabel; 246 if (m_pNameOSTypeLabel) 247 pLayout->addWidget(m_pNameOSTypeLabel, iRow++, 0, 1, 6); 248 } 249 250 m_pNameAndSystemEditor = new UINameAndSystemEditor(0, true, true, true); 251 if (m_pNameAndSystemEditor) 252 pLayout->addWidget(m_pNameAndSystemEditor, iRow++, 0, 1, 6); 253 254 return pContainer; 235 QWidget *UIWizardNewVMPage1::createNameOSTypeWidgets() 236 { 237 /* Prepare Name and OS Type editor: */ 238 m_pNameAndSystemEditor = new UINameAndSystemEditor(0, 239 true /* fChooseName? */, 240 true /* fChoosePath? */, 241 true /* fChooseType? */); 242 return m_pNameAndSystemEditor; 255 243 } 256 244 … … 420 408 } 421 409 410 422 411 UIWizardNewVMPageBasic1::UIWizardNewVMPageBasic1(const QString &strGroup) 423 412 : UIWizardNewVMPage1(strGroup) 413 , m_pNameOSTypeLabel(0) 414 , m_pUnattendedLabel(0) 424 415 { 425 416 prepare(); … … 428 419 void UIWizardNewVMPageBasic1::prepare() 429 420 { 421 /* Prepare page layout: */ 430 422 QVBoxLayout *pPageLayout = new QVBoxLayout(this); 431 pPageLayout->addWidget(createNameOSTypeWidgets(/* fCreateLabels */ true)); 432 433 m_pUnattendedLabel = new QIRichTextLabel; 434 if (m_pUnattendedLabel) 435 pPageLayout->addWidget(m_pUnattendedLabel); 436 437 QHBoxLayout *pISOSelectorLayout = new QHBoxLayout; 438 439 m_pISOPathSelectorLabel = new QLabel; 440 pISOSelectorLayout->addWidget(m_pISOPathSelectorLabel); 441 m_pISOPathSelectorLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed); 442 443 m_pISOFilePathSelector = new UIFilePathSelector; 444 if (m_pISOFilePathSelector) 445 { 446 m_pISOFilePathSelector->setResetEnabled(false); 447 m_pISOFilePathSelector->setMode(UIFilePathSelector::Mode_File_Open); 448 m_pISOFilePathSelector->setFileDialogFilters("*.iso *.ISO"); 449 m_pISOFilePathSelector->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); 450 m_pISOFilePathSelector->setInitialPath(uiCommon().defaultFolderPathForType(UIMediumDeviceType_DVD)); 451 m_pISOPathSelectorLabel->setBuddy(m_pISOFilePathSelector); 452 pISOSelectorLayout->addWidget(m_pISOFilePathSelector); 453 } 454 455 pPageLayout->addLayout(pISOSelectorLayout); 456 pPageLayout->addStretch(); 457 458 459 423 if (pPageLayout) 424 { 425 /* Prepare Name and OS Type label: */ 426 m_pNameOSTypeLabel = new QIRichTextLabel(this); 427 if (m_pNameOSTypeLabel) 428 pPageLayout->addWidget(m_pNameOSTypeLabel); 429 430 /* Prepare Name and OS Type editor: */ 431 pPageLayout->addWidget(createNameOSTypeWidgets()); 432 433 /* Prepare Unattended description label: */ 434 m_pUnattendedLabel = new QIRichTextLabel(this); 435 if (m_pUnattendedLabel) 436 pPageLayout->addWidget(m_pUnattendedLabel); 437 438 /* Prepare ISO Selector layout: */ 439 QHBoxLayout *pISOSelectorLayout = new QHBoxLayout; 440 if (pISOSelectorLayout) 441 { 442 /* Prepare ISO Selector label: */ 443 m_pISOPathSelectorLabel = new QLabel(this); 444 if (m_pISOPathSelectorLabel) 445 { 446 m_pISOPathSelectorLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed); 447 pISOSelectorLayout->addWidget(m_pISOPathSelectorLabel); 448 } 449 /* Prepare ISO Selector editor: */ 450 m_pISOFilePathSelector = new UIFilePathSelector(this); 451 if (m_pISOFilePathSelector) 452 { 453 m_pISOFilePathSelector->setResetEnabled(false); 454 m_pISOFilePathSelector->setMode(UIFilePathSelector::Mode_File_Open); 455 m_pISOFilePathSelector->setFileDialogFilters("*.iso *.ISO"); 456 m_pISOFilePathSelector->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); 457 m_pISOFilePathSelector->setInitialPath(uiCommon().defaultFolderPathForType(UIMediumDeviceType_DVD)); 458 m_pISOPathSelectorLabel->setBuddy(m_pISOFilePathSelector); 459 460 pISOSelectorLayout->addWidget(m_pISOFilePathSelector); 461 } 462 463 pPageLayout->addLayout(pISOSelectorLayout); 464 } 465 466 pPageLayout->addStretch(); 467 } 460 468 461 469 createConnections(); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic1.h
r87892 r88065 40 40 class UIWizardNewVMPage1 : public UIWizardPageBase 41 41 { 42 43 42 protected: 44 43 … … 76 75 void composeMachineFilePath(); 77 76 78 QWidget *createNameOSTypeWidgets(bool fCreateLabels); 79 int createNameOSTypeWidgets(QGridLayout *pLayout, bool fCreateLabels = true); 77 QWidget *createNameOSTypeWidgets(); 80 78 /** Colors the widgets red if they cause isComplete to fail. */ 81 79 void markWidgets() const; … … 91 89 /** @name Widgets 92 90 * @{ */ 93 UINameAndSystemEditor *m_pNameAndSystemEditor; 94 QIRichTextLabel *m_pNameOSTypeLabel; 95 mutable UIFilePathSelector *m_pISOFilePathSelector; 96 QIRichTextLabel *m_pUnattendedLabel; 97 QLabel *m_pISOPathSelectorLabel; 91 UINameAndSystemEditor *m_pNameAndSystemEditor; 92 UIFilePathSelector *m_pISOFilePathSelector; 93 QLabel *m_pISOPathSelectorLabel; 98 94 /** @} */ 99 95 … … 166 162 /** Validation stuff. */ 167 163 virtual bool validatePage() /* override */; 164 165 166 /** @name Widgets 167 * @{ */ 168 QIRichTextLabel *m_pNameOSTypeLabel; 169 QIRichTextLabel *m_pUnattendedLabel; 170 /** @} */ 168 171 }; 169 172 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic3.cpp
r88038 r88065 77 77 QWidget *pHardwareContainer = new QWidget; 78 78 QGridLayout *pHardwareLayout = new QGridLayout(pHardwareContainer); 79 pHardwareLayout->setContentsMargins(0, 0, 0, 0); 79 80 80 81 m_pBaseMemoryEditor = new UIBaseMemoryEditor(0, true); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic4.cpp
r88038 r88065 109 109 QWidget *pDiskContainer = new QWidget; 110 110 QGridLayout *pDiskLayout = new QGridLayout(pDiskContainer); 111 pDiskLayout->setContentsMargins(0, 0, 0, 0); 111 112 m_pDiskSourceButtonGroup = new QButtonGroup; 112 113 m_pDiskEmpty = new QRadioButton; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp
r88046 r88065 59 59 { 60 60 m_pToolBox = new UIToolBox; 61 m_pToolBox->insertPage(ExpertToolboxItems_NameAndOSType, createNameOSTypeWidgets( /* fCreateLabels */ false), "");61 m_pToolBox->insertPage(ExpertToolboxItems_NameAndOSType, createNameOSTypeWidgets(), ""); 62 62 m_pToolBox->insertPage(ExpertToolboxItems_Unattended, createUnattendedWidgets(), "", false); 63 63 m_pToolBox->insertPage(ExpertToolboxItems_Hardware, createHardwareWidgets(), ""); … … 345 345 QWidget *pContainerWidget = new QWidget; 346 346 QGridLayout *pLayout = new QGridLayout(pContainerWidget); 347 pLayout->setContentsMargins(0, 0, 0, 0); 347 348 int iRow = 0; 348 349
Note:
See TracChangeset
for help on using the changeset viewer.