Changeset 93673 in vbox
- Timestamp:
- Feb 10, 2022 7:04:54 AM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 149838
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDExpertPage.cpp
r93115 r93673 31 31 32 32 UIWizardCloneVDExpertPage::UIWizardCloneVDExpertPage(KDeviceType enmDeviceType, qulonglong uSourceDiskLogicaSize) 33 : m_pFormatGroupBox(0)33 : m_pFormatComboBox(0) 34 34 , m_pVariantWidget(0) 35 35 , m_pMediumSizePathGroupBox(0) 36 , m_pFormatVariantGroupBox(0) 36 37 , m_enmDeviceType(enmDeviceType) 37 38 { … … 41 42 void UIWizardCloneVDExpertPage::prepare(KDeviceType enmDeviceType, qulonglong uSourceDiskLogicaSize) 42 43 { 43 Q GridLayout *pMainLayout = new QGridLayout(this);44 QVBoxLayout *pMainLayout = new QVBoxLayout(this); 44 45 45 46 m_pMediumSizePathGroupBox = new UIMediumSizeAndPathGroupBox(true /* expert mode */, 0 /* parent */, uSourceDiskLogicaSize); … … 47 48 if (m_pMediumSizePathGroupBox) 48 49 { 49 pMainLayout->addWidget(m_pMediumSizePathGroupBox , 0, 0, 4, 2);50 pMainLayout->addWidget(m_pMediumSizePathGroupBox); 50 51 connect(m_pMediumSizePathGroupBox, &UIMediumSizeAndPathGroupBox::sigMediumLocationButtonClicked, 51 52 this, &UIWizardCloneVDExpertPage::sltSelectLocationButtonClicked); … … 56 57 } 57 58 58 m_pFormatGroupBox = new UIDiskFormatsGroupBox(true /* expert mode */, enmDeviceType, 0); 59 if (m_pFormatGroupBox) 60 { 61 pMainLayout-> addWidget(m_pFormatGroupBox, 4, 0, 7, 1); 62 connect(m_pFormatGroupBox, &UIDiskFormatsGroupBox::sigMediumFormatChanged, 59 m_pFormatComboBox = new UIDiskFormatsComboBox(true /* expert mode */, enmDeviceType, 0); 60 if (m_pFormatComboBox) 61 connect(m_pFormatComboBox, &UIDiskFormatsComboBox::sigMediumFormatChanged, 63 62 this, &UIWizardCloneVDExpertPage::sltMediumFormatChanged); 64 }65 63 66 64 m_pVariantWidget = new UIDiskVariantWidget(0); 67 65 if (m_pVariantWidget) 68 {69 pMainLayout-> addWidget(m_pVariantWidget, 4, 1, 3, 1);70 66 connect(m_pVariantWidget, &UIDiskVariantWidget::sigMediumVariantChanged, 71 67 this, &UIWizardCloneVDExpertPage::sltMediumVariantChanged); 68 69 m_pFormatVariantGroupBox = new QGroupBox; 70 if (m_pFormatVariantGroupBox) 71 { 72 QHBoxLayout *pFormatVariantLayout = new QHBoxLayout(m_pFormatVariantGroupBox); 73 pFormatVariantLayout->addWidget(m_pFormatComboBox, 0, Qt::AlignTop); 74 pFormatVariantLayout->addWidget(m_pVariantWidget); 75 pMainLayout->addWidget(m_pFormatVariantGroupBox); 72 76 } 73 77 } … … 75 79 void UIWizardCloneVDExpertPage::sltMediumFormatChanged() 76 80 { 77 if (wizardWindow<UIWizardCloneVD>() && m_pFormat GroupBox)78 wizardWindow<UIWizardCloneVD>()->setMediumFormat(m_pFormat GroupBox->mediumFormat());81 if (wizardWindow<UIWizardCloneVD>() && m_pFormatComboBox) 82 wizardWindow<UIWizardCloneVD>()->setMediumFormat(m_pFormatComboBox->mediumFormat()); 79 83 updateDiskWidgetsAfterMediumFormatChange(); 80 84 emit completeChanged(); … … 125 129 void UIWizardCloneVDExpertPage::retranslateUi() 126 130 { 131 if (m_pFormatVariantGroupBox) 132 m_pFormatVariantGroupBox->setTitle(UIWizardCloneVD::tr("Hard Disk File &Type and Variant")); 127 133 } 128 134 129 135 void UIWizardCloneVDExpertPage::initializePage() 130 136 { 131 AssertReturnVoid(wizardWindow<UIWizardCloneVD>() && m_pMediumSizePathGroupBox && m_pFormat GroupBox && m_pVariantWidget);132 UIWizardCloneVD *pWizard = wizardWindow<UIWizardCloneVD>(); 133 134 pWizard->setMediumFormat(m_pFormat GroupBox->mediumFormat());137 AssertReturnVoid(wizardWindow<UIWizardCloneVD>() && m_pMediumSizePathGroupBox && m_pFormatComboBox && m_pVariantWidget); 138 UIWizardCloneVD *pWizard = wizardWindow<UIWizardCloneVD>(); 139 140 pWizard->setMediumFormat(m_pFormatComboBox->mediumFormat()); 135 141 136 142 pWizard->setMediumVariant(m_pVariantWidget->mediumVariant()); … … 160 166 bool fResult = true; 161 167 162 if (m_pFormat GroupBox)163 fResult = m_pFormat GroupBox->mediumFormat().isNull();168 if (m_pFormatComboBox) 169 fResult = m_pFormatComboBox->mediumFormat().isNull(); 164 170 if (m_pVariantWidget) 165 171 fResult = m_pVariantWidget->isComplete(); … … 188 194 { 189 195 UIWizardCloneVD *pWizard = wizardWindow<UIWizardCloneVD>(); 190 AssertReturnVoid(pWizard && m_pVariantWidget && m_pMediumSizePathGroupBox && m_pFormat GroupBox);196 AssertReturnVoid(pWizard && m_pVariantWidget && m_pMediumSizePathGroupBox && m_pFormatComboBox); 191 197 const CMediumFormat &comMediumFormat = pWizard->mediumFormat(); 192 198 AssertReturnVoid(!comMediumFormat.isNull()); … … 197 203 198 204 m_pMediumSizePathGroupBox->blockSignals(true); 199 m_pMediumSizePathGroupBox->updateMediumPath(comMediumFormat, m_pFormat GroupBox->formatExtensions(), m_enmDeviceType);205 m_pMediumSizePathGroupBox->updateMediumPath(comMediumFormat, m_pFormatComboBox->formatExtensions(), m_enmDeviceType); 200 206 m_pMediumSizePathGroupBox->blockSignals(false); 201 207 /* Update the wizard parameters explicitly since we blocked th signals: */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDExpertPage.h
r93115 r93673 29 29 30 30 /* Forward declarations: */ 31 class UIDiskFormatsGroupBox; 31 class QGroupBox; 32 class UIDiskFormatsComboBox; 32 33 class UIDiskVariantWidget; 33 34 class UIMediumSizeAndPathGroupBox; 35 34 36 35 37 /** Expert page of the Clone Virtual Disk Image wizard: */ … … 76 78 void updateDiskWidgetsAfterMediumFormatChange(); 77 79 78 UIDiskFormats GroupBox *m_pFormatGroupBox;80 UIDiskFormatsComboBox *m_pFormatComboBox; 79 81 UIDiskVariantWidget *m_pVariantWidget; 80 82 UIMediumSizeAndPathGroupBox *m_pMediumSizePathGroupBox; 83 QGroupBox *m_pFormatVariantGroupBox; 81 84 KDeviceType m_enmDeviceType; 82 85 }; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/clonevd/UIWizardCloneVDFormatPage.cpp
r93115 r93673 56 56 { 57 57 /* Translate page: */ 58 setTitle(UIWizardCloneVD::tr(" Disk imagefile type"));58 setTitle(UIWizardCloneVD::tr("Virtual Hard disk file type")); 59 59 60 60 /* Translate widgets: */ 61 61 m_pLabel->setText(UIWizardCloneVD::tr("Please choose the type of file that you would like to use " 62 "for the newvirtual disk image. If you do not need to use it "62 "for the destination virtual disk image. If you do not need to use it " 63 63 "with other virtualization software you can leave this setting unchanged.")); 64 64 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDExpertPage.cpp
r93115 r93673 33 33 : UINativeWizardPage() 34 34 , m_pSizeAndPathGroup(0) 35 , m_pFormatCombo xBox(0)35 , m_pFormatComboBox(0) 36 36 , m_pVariantWidget(0) 37 37 , m_pFormatVariantGroupBox(0) … … 49 49 QVBoxLayout *pMainLayout = new QVBoxLayout(this); 50 50 m_pSizeAndPathGroup = new UIMediumSizeAndPathGroupBox(true /* fExpertMode */, 0 /* parent */, _4M /* minimum size */); 51 m_pFormatCombo xBox = new UIDiskFormatsComboBox(true /* fExpertMode */, KDeviceType_HardDisk, 0);51 m_pFormatComboBox = new UIDiskFormatsComboBox(true /* fExpertMode */, KDeviceType_HardDisk, 0); 52 52 m_pVariantWidget = new UIDiskVariantWidget(0); 53 53 54 54 m_pFormatVariantGroupBox = new QGroupBox; 55 55 QHBoxLayout *pFormatVariantLayout = new QHBoxLayout(m_pFormatVariantGroupBox); 56 pFormatVariantLayout->addWidget(m_pFormatCombo xBox, 0, Qt::AlignTop);56 pFormatVariantLayout->addWidget(m_pFormatComboBox, 0, Qt::AlignTop); 57 57 pFormatVariantLayout->addWidget(m_pVariantWidget); 58 58 … … 60 60 pMainLayout->addWidget(m_pFormatVariantGroupBox); 61 61 62 connect(m_pFormatCombo xBox, &UIDiskFormatsComboBox::sigMediumFormatChanged,62 connect(m_pFormatComboBox, &UIDiskFormatsComboBox::sigMediumFormatChanged, 63 63 this, &UIWizardNewVDExpertPage::sltMediumFormatChanged); 64 64 connect(m_pVariantWidget, &UIDiskVariantWidget::sigMediumVariantChanged, … … 101 101 void UIWizardNewVDExpertPage::sltMediumFormatChanged() 102 102 { 103 AssertReturnVoid(m_pFormatCombo xBox);103 AssertReturnVoid(m_pFormatComboBox); 104 104 AssertReturnVoid(wizardWindow<UIWizardNewVD>()); 105 wizardWindow<UIWizardNewVD>()->setMediumFormat(m_pFormatCombo xBox->mediumFormat());105 wizardWindow<UIWizardNewVD>()->setMediumFormat(m_pFormatComboBox->mediumFormat()); 106 106 updateDiskWidgetsAfterMediumFormatChange(); 107 107 completeChanged(); … … 137 137 AssertReturnVoid(pWizard); 138 138 /* First set the medium format of the wizard: */ 139 AssertReturnVoid(m_pFormatCombo xBox);140 const CMediumFormat &comMediumFormat = m_pFormatCombo xBox->mediumFormat();139 AssertReturnVoid(m_pFormatComboBox); 140 const CMediumFormat &comMediumFormat = m_pFormatComboBox->mediumFormat(); 141 141 AssertReturnVoid(!comMediumFormat.isNull()); 142 142 pWizard->setMediumFormat(comMediumFormat); … … 211 211 { 212 212 UIWizardNewVD *pWizard = wizardWindow<UIWizardNewVD>(); 213 AssertReturnVoid(pWizard && m_pVariantWidget && m_pSizeAndPathGroup && m_pFormatCombo xBox);213 AssertReturnVoid(pWizard && m_pVariantWidget && m_pSizeAndPathGroup && m_pFormatComboBox); 214 214 const CMediumFormat &comMediumFormat = pWizard->mediumFormat(); 215 215 AssertReturnVoid(!comMediumFormat.isNull()); 216 216 217 217 m_pVariantWidget->updateMediumVariantWidgetsAfterFormatChange(comMediumFormat); 218 m_pSizeAndPathGroup->updateMediumPath(comMediumFormat, m_pFormatCombo xBox->formatExtensions(), KDeviceType_HardDisk);219 } 218 m_pSizeAndPathGroup->updateMediumPath(comMediumFormat, m_pFormatComboBox->formatExtensions(), KDeviceType_HardDisk); 219 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDExpertPage.h
r93115 r93673 65 65 * @{ */ 66 66 UIMediumSizeAndPathGroupBox *m_pSizeAndPathGroup; 67 UIDiskFormatsComboBox *m_pFormatCombo xBox;67 UIDiskFormatsComboBox *m_pFormatComboBox; 68 68 UIDiskVariantWidget *m_pVariantWidget; 69 69 QGroupBox *m_pFormatVariantGroupBox;
Note:
See TracChangeset
for help on using the changeset viewer.