Changeset 87981 in vbox
- Timestamp:
- Mar 5, 2021 5:46:36 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic4.cpp
r87974 r87981 18 18 /* Qt includes: */ 19 19 #include <QButtonGroup> 20 #include <QCheckBox> 20 21 #include <QGridLayout> 21 22 #include <QGroupBox> … … 246 247 void UIWizardNewVMPageBasic4::createConnections() 247 248 { 248 connect(m_pDiskSourceButtonGroup, static_cast<void(QButtonGroup::*)(QAbstractButton *)>(&QButtonGroup::buttonClicked), 249 this, &UIWizardNewVMPageBasic4::sltHandleSelectedDiskSourceChange); 250 connect(m_pDiskSelector, static_cast<void(UIMediaComboBox::*)(int)>(&UIMediaComboBox::currentIndexChanged), 251 this, &UIWizardNewVMPageBasic4::sltVirtualSelectedDiskSourceChanged); 252 connect(m_pDiskSelectionButton, &QIToolButton::clicked, 253 this, &UIWizardNewVMPageBasic4::sltGetWithFileOpenDialog); 254 connect(m_pSizeEditor, &UIMediumSizeEditor::sigSizeChanged, 255 this, &UIWizardNewVMPageBasic4::completeChanged); 256 connect(m_pSizeEditor, &UIMediumSizeEditor::sigSizeChanged, 257 this, &UIWizardNewVMPageBasic4::sltHandleSizeEditorChange); 258 } 259 260 void UIWizardNewVMPageBasic4::sltHandleSelectedDiskSourceChange() 249 if (m_pDiskSourceButtonGroup) 250 connect(m_pDiskSourceButtonGroup, static_cast<void(QButtonGroup::*)(QAbstractButton *)>(&QButtonGroup::buttonClicked), 251 this, &UIWizardNewVMPageBasic4::sltSelectedDiskSourceChanged); 252 if (m_pDiskSelector) 253 connect(m_pDiskSelector, static_cast<void(UIMediaComboBox::*)(int)>(&UIMediaComboBox::currentIndexChanged), 254 this, &UIWizardNewVMPageBasic4::sltMediaComboBoxIndexChanged); 255 if (m_pDiskSelectionButton) 256 connect(m_pDiskSelectionButton, &QIToolButton::clicked, 257 this, &UIWizardNewVMPageBasic4::sltGetWithFileOpenDialog); 258 if (m_pSizeEditor) 259 { 260 connect(m_pSizeEditor, &UIMediumSizeEditor::sigSizeChanged, 261 this, &UIWizardNewVMPageBasic4::completeChanged); 262 connect(m_pSizeEditor, &UIMediumSizeEditor::sigSizeChanged, 263 this, &UIWizardNewVMPageBasic4::sltHandleSizeEditorChange); 264 } 265 } 266 267 void UIWizardNewVMPageBasic4::sltSelectedDiskSourceChanged() 261 268 { 262 269 if (!m_pDiskSourceButtonGroup) … … 279 286 } 280 287 281 void UIWizardNewVMPageBasic4::slt VirtualSelectedDiskSourceChanged()288 void UIWizardNewVMPageBasic4::sltMediaComboBoxIndexChanged() 282 289 { 283 290 /* Make sure to set m_virtualDisk: */ … … 423 430 } 424 431 425 void UIWizardNewVMPageBasic4::setEnableNewDiskWidgets(bool ) 426 { 427 // if (m_pMediumVariantContainer) 428 // m_pMediumVariantContainer->setEnabled(fEnable); 429 430 // if (m_pSizeContainer) 431 // m_pSizeContainer->setEnabled(fEnable); 432 } 432 void UIWizardNewVMPageBasic4::setEnableNewDiskWidgets(bool fEnable) 433 { 434 if (m_pSizeEditor) 435 m_pSizeEditor->setEnabled(fEnable); 436 if (m_pSizeEditorLabel) 437 m_pSizeEditorLabel->setEnabled(fEnable); 438 if (m_pFixedCheckBox) 439 m_pFixedCheckBox->setEnabled(fEnable); 440 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic4.h
r87956 r87981 119 119 private slots: 120 120 121 void slt HandleSelectedDiskSourceChange();122 void slt VirtualSelectedDiskSourceChanged();121 void sltSelectedDiskSourceChanged(); 122 void sltMediaComboBoxIndexChanged(); 123 123 void sltGetWithFileOpenDialog(); 124 124 void sltHandleSizeEditorChange(); -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.cpp
r87974 r87981 73 73 /* Register classes: */ 74 74 qRegisterMetaType<CMedium>(); 75 qRegisterMetaType<SelectedDiskSource>(); 76 75 77 /* Register fields: */ 76 78 registerField("name*", m_pNameAndSystemEditor, "name", SIGNAL(sigNameChanged(const QString &))); … … 80 82 registerField("machineBaseName", this, "machineBaseName"); 81 83 registerField("baseMemory", this, "baseMemory"); 82 registerField("virtualDisk", this, "virtualDisk");83 84 registerField("guestOSFamiyId", this, "guestOSFamiyId"); 84 85 registerField("ISOFilePath", this, "ISOFilePath"); … … 98 99 registerField("mediumFormat", this, "mediumFormat"); 99 100 registerField("mediumSize", this, "mediumSize"); 100 101 registerField("selectedDiskSource", this, "selectedDiskSource"); 102 registerField("virtualDisk", this, "virtualDisk"); 103 registerField("mediumVariant", this, "mediumVariant"); 101 104 102 105 disableEnableUnattendedRelatedWidgets(isUnattendedEnabled()); 106 setEnableDiskSelectionWidgets(m_enmSelectedDiskSource == SelectedDiskSource_Existing); 107 setEnableNewDiskWidgets(m_enmSelectedDiskSource == SelectedDiskSource_New); 103 108 } 104 109 … … 277 282 connect(m_pSizeEditor, &UIMediumSizeEditor::sigSizeChanged, 278 283 this, &UIWizardNewVMPageExpert::sltMediumSizeChanged); 284 285 if (m_pDiskSelector) 286 connect(m_pDiskSelector, static_cast<void(UIMediaComboBox::*)(int)>(&UIMediaComboBox::currentIndexChanged), 287 this, &UIWizardNewVMPageExpert::sltMediaComboBoxIndexChanged); 288 289 if (m_pDiskSourceButtonGroup) 290 connect(m_pDiskSourceButtonGroup, static_cast<void(QButtonGroup::*)(QAbstractButton *)>(&QButtonGroup::buttonClicked), 291 this, &UIWizardNewVMPageExpert::sltSelectedDiskSourceChanged); 279 292 } 280 293 … … 572 585 if (!pSenderWidget) 573 586 return; 574 575 587 m_userSetWidgets << pSenderWidget; 576 588 } … … 590 602 } 591 603 604 void UIWizardNewVMPageExpert::sltMediaComboBoxIndexChanged() 605 { 606 /* Make sure to set m_virtualDisk: */ 607 setVirtualDiskFromDiskCombo(); 608 emit completeChanged(); 609 } 610 611 void UIWizardNewVMPageExpert::sltSelectedDiskSourceChanged() 612 { 613 if (!m_pDiskSourceButtonGroup) 614 return; 615 616 if (m_pDiskSourceButtonGroup->checkedButton() == m_pDiskEmpty) 617 setSelectedDiskSource(SelectedDiskSource_Empty); 618 else if (m_pDiskSourceButtonGroup->checkedButton() == m_pDiskExisting) 619 { 620 setSelectedDiskSource(SelectedDiskSource_Existing); 621 setVirtualDiskFromDiskCombo(); 622 } 623 else 624 setSelectedDiskSource(SelectedDiskSource_New); 625 626 setEnableDiskSelectionWidgets(m_enmSelectedDiskSource == SelectedDiskSource_Existing); 627 setEnableNewDiskWidgets(m_enmSelectedDiskSource == SelectedDiskSource_New); 628 629 completeChanged(); 630 } 631 592 632 void UIWizardNewVMPageExpert::updateVirtualDiskPathFromMachinePathName() 593 633 { … … 617 657 updateLocationEditorAfterFormatChange(comMediumFormat, m_formatExtensions); 618 658 } 659 660 void UIWizardNewVMPageExpert::setEnableNewDiskWidgets(bool fEnable) 661 { 662 if (m_pSizeEditor) 663 m_pSizeEditor->setEnabled(fEnable); 664 if (m_pSizeEditorLabel) 665 m_pSizeEditorLabel->setEnabled(fEnable); 666 if (m_pFixedCheckBox) 667 m_pFixedCheckBox->setEnabled(fEnable); 668 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageExpert.h
r87974 r87981 51 51 Q_PROPERTY(QString machineBaseName READ machineBaseName WRITE setMachineBaseName); 52 52 Q_PROPERTY(QString machineFilePath READ machineFilePath WRITE setMachineFilePath); 53 Q_PROPERTY(CMedium virtualDisk READ virtualDisk WRITE setVirtualDisk);54 53 Q_PROPERTY(int baseMemory READ baseMemory); 55 54 Q_PROPERTY(QString guestOSFamiyId READ guestOSFamiyId); … … 68 67 69 68 70 //Q_PROPERTY(CMedium virtualDisk READ virtualDisk WRITE setVirtualDisk);71 //Q_PROPERTY(SelectedDiskSource selectedDiskSource READ selectedDiskSource WRITE setSelectedDiskSource);69 Q_PROPERTY(CMedium virtualDisk READ virtualDisk WRITE setVirtualDisk); 70 Q_PROPERTY(SelectedDiskSource selectedDiskSource READ selectedDiskSource WRITE setSelectedDiskSource); 72 71 Q_PROPERTY(CMediumFormat mediumFormat READ mediumFormat); 73 //Q_PROPERTY(qulonglong mediumVariant READ mediumVariant WRITE setMediumVariant);72 Q_PROPERTY(qulonglong mediumVariant READ mediumVariant WRITE setMediumVariant); 74 73 Q_PROPERTY(QString mediumPath READ mediumPath); 75 74 Q_PROPERTY(qulonglong mediumSize READ mediumSize WRITE setMediumSize); … … 103 102 void sltMediumFormatChanged(); 104 103 void sltMediumSizeChanged(); 104 void sltMediaComboBoxIndexChanged(); 105 void sltSelectedDiskSourceChanged(); 105 106 106 107 private: … … 138 139 void updateVirtualDiskPathFromMachinePathName(); 139 140 void updateWidgetAterMediumFormatChange(); 141 void setEnableNewDiskWidgets(bool fEnable); 140 142 141 143 UIToolBox *m_pToolBox;
Note:
See TracChangeset
for help on using the changeset viewer.