Changeset 87878 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Feb 25, 2021 5:17:43 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 142951
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/wizards
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageBasic2.cpp
r87871 r87878 31 31 32 32 UIWizardNewVDPage2::UIWizardNewVDPage2() 33 : m_pVariantButtonGroup(0) 34 , m_pDynamicalButton(0) 35 , m_pFixedButton(0) 36 , m_pSplitBox(0) 33 37 { 34 38 } … … 40 44 41 45 /* Exclusive options: */ 42 if (m_pDynamicalButton ->isChecked())46 if (m_pDynamicalButton && m_pDynamicalButton->isChecked()) 43 47 uMediumVariant = (qulonglong)KMediumVariant_Standard; 44 else if (m_pFixedButton ->isChecked())48 else if (m_pFixedButton && m_pFixedButton->isChecked()) 45 49 uMediumVariant = (qulonglong)KMediumVariant_Fixed; 46 50 47 51 /* Additional options: */ 48 if (m_pSplitBox ->isChecked())52 if (m_pSplitBox && m_pSplitBox->isChecked()) 49 53 uMediumVariant |= (qulonglong)KMediumVariant_VmdkSplit2G; 50 54 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageBasic3.cpp
r87874 r87878 184 184 } 185 185 186 bool UIWizardNewVDPage3::checkFATSizeLimitation() const 187 { 188 /* Acquire medium variant: */ 189 const qulonglong uVariant = fieldImp("mediumVariant").toULongLong(); 190 186 /* static */ 187 bool UIWizardNewVDPage3::checkFATSizeLimitation(const qulonglong uVariant, const QString &strMediumPath, const qulonglong uSize) 188 { 191 189 /* If the hard disk is split into 2GB parts then no need to make further checks: */ 192 190 if (uVariant & KMediumVariant_VmdkSplit2G) 193 191 return true; 194 195 /* Acquire medium path and size: */196 const QString strMediumPath = fieldImp("mediumPath").toString();197 const qulonglong uSize = fieldImp("mediumSize").toULongLong();198 192 199 193 RTFSTYPE enmType; … … 332 326 333 327 /* Make sure we are passing FAT size limitation: */ 334 fResult = checkFATSizeLimitation(); 328 fResult = checkFATSizeLimitation(fieldImp("mediumVariant").toULongLong(), 329 fieldImp("mediumPath").toString(), 330 fieldImp("mediumSize").toULongLong()); 335 331 if (!fResult) 336 332 { -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageBasic3.h
r87874 r87878 40 40 41 41 static QString defaultExtension(const CMediumFormat &mediumFormatRef); 42 /* Checks if the medium file is bigger than what is allowed in FAT file systems. */ 43 static bool checkFATSizeLimitation(const qulonglong uVariant, const QString &strMediumPath, const qulonglong uSize); 42 44 43 45 protected: … … 56 58 /* Returns the full image file path including the extension. */ 57 59 static QString absoluteFilePath(const QString &strFileName, const QString &strPath, const QString &strExtension); 58 59 /* Checks if the medium file is bigger than what is allowed in FAT file systems. */60 bool checkFATSizeLimitation() const;61 60 62 61 /* Stuff for 'mediumPath' field: */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageExpert.cpp
r87859 r87878 258 258 259 259 /* Make sure we are passing FAT size limitation: */ 260 fResult = checkFATSizeLimitation(); 260 fResult = UIWizardNewVDPage3::checkFATSizeLimitation(fieldImp("mediumVariant").toULongLong(), 261 fieldImp("mediumPath").toString(), 262 fieldImp("mediumSize").toULongLong()); 261 263 if (!fResult) 262 264 { -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic5.cpp
r87874 r87878 25 25 #include "QIRichTextLabel.h" 26 26 #include "UIBaseMemoryEditor.h" 27 #include "UICommon.h" 27 28 #include "UIVirtualCPUEditor.h" 28 29 #include "UIWizardNewVM.h" … … 31 32 /* COM includes: */ 32 33 #include "CGuestOSType.h" 34 #include "CSystemProperties.h" 33 35 34 36 UIWizardNewVMPageBasic5::UIWizardNewVMPageBasic5() … … 42 44 registerField("mediumSize", this, "mediumSize"); 43 45 44 // fieldImp("machineBaseName").toString(), 45 // fieldImp("machineFolder").toString(), 46 // fieldImp("type").value<CGuestOSType>().GetRecommendedHDD(), 47 QString strDefaultName = fieldImp("machineBaseName").toString(); 48 m_strDefaultName = strDefaultName.isEmpty() ? QString("NewVirtualDisk1") : strDefaultName; 49 m_strDefaultPath = fieldImp("machineFolder").toString(); 46 /* We do not have any UI elements for HDD format selection since we default to VDI in case of guided wizard mode: */ 47 bool fFoundVDI = false; 48 CSystemProperties properties = uiCommon().virtualBox().GetSystemProperties(); 49 const QVector<CMediumFormat> &formats = properties.GetMediumFormats(); 50 foreach (const CMediumFormat &format, formats) 51 { 52 if (format.GetName() == "VDI") 53 { 54 m_mediumFormat = format; 55 fFoundVDI = true; 56 } 57 } 58 Assert(fFoundVDI); 59 m_strDefaultExtension = defaultExtension(m_mediumFormat); 60 } 50 61 62 CMediumFormat UIWizardNewVMPageBasic5::mediumFormat() const 63 { 64 return m_mediumFormat; 51 65 } 52 66 … … 57 71 m_pLabel = new QIRichTextLabel(this); 58 72 pMainLayout->addWidget(m_pLabel); 59 //pMainLayout->addWidget(createHardwareWidgets());60 73 61 74 pMainLayout->addStretch(); … … 80 93 void UIWizardNewVMPageBasic5::initializePage() 81 94 { 95 /* We set the medium name and path according to machine name/path and do let user change these in the guided mode: */ 96 QString strDefaultName = fieldImp("machineBaseName").toString(); 97 m_strDefaultName = strDefaultName.isEmpty() ? QString("NewVirtualDisk1") : strDefaultName; 98 m_strDefaultPath = fieldImp("machineFolder").toString(); 99 // fieldImp("type").value<CGuestOSType>().GetRecommendedHDD() 82 100 retranslateUi(); 83 84 // if (!field("type").canConvert<CGuestOSType>())85 // return;86 87 // CGuestOSType type = field("type").value<CGuestOSType>();88 // ULONG recommendedRam = type.GetRecommendedRAM();89 // if (m_pBaseMemoryEditor)90 // m_pBaseMemoryEditor->setValue(recommendedRam);91 92 // KFirmwareType fwType = type.GetRecommendedFirmware();93 // if (m_pEFICheckBox)94 // m_pEFICheckBox->setChecked(fwType != KFirmwareType_BIOS);95 101 } 96 102 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic5.h
r87874 r87878 48 48 { 49 49 Q_OBJECT; 50 Q_PROPERTY(CMediumFormat mediumFormat READ mediumFormat WRITE setMediumFormat);50 Q_PROPERTY(CMediumFormat mediumFormat READ mediumFormat); 51 51 Q_PROPERTY(qulonglong mediumVariant READ mediumVariant WRITE setMediumVariant); 52 52 Q_PROPERTY(QString mediumPath READ mediumPath); … … 57 57 /** Constructor. */ 58 58 UIWizardNewVMPageBasic5(); 59 CMediumFormat mediumFormat() const; 59 60 60 61 protected: … … 85 86 /** Widgets. */ 86 87 QIRichTextLabel *m_pLabel; 88 /** For guided new vm wizard VDI is the only format. Thus we have no UI item for it. */ 89 CMediumFormat m_mediumFormat; 87 90 }; 88 91 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVMPageBasic8.cpp
r87864 r87878 18 18 /* Qt includes: */ 19 19 #include <QCheckBox> 20 #include <QFileInfo> 20 21 #include <QGridLayout> 21 22 #include <QMetaType> … … 25 26 #include "QIRichTextLabel.h" 26 27 #include "UIBaseMemoryEditor.h" 28 #include "UIMessageCenter.h" 27 29 #include "UIVirtualCPUEditor.h" 28 30 #include "UIWizardNewVM.h" 29 31 #include "UIWizardNewVMPageBasic8.h" 32 #include "UIWizardNewVDPageBasic3.h" 30 33 31 34 /* COM includes: */ … … 152 155 bool UIWizardNewVMPageBasic8::validatePage() 153 156 { 154 /* Lock finish button: */ 157 bool fResult = true; 158 159 const QString strMediumPath(fieldImp("mediumPath").toString()); 160 fResult = !QFileInfo(strMediumPath).exists(); 161 if (!fResult) 162 { 163 msgCenter().cannotOverwriteHardDiskStorage(strMediumPath, this); 164 return fResult; 165 } 166 167 fResult = UIWizardNewVDPage3::checkFATSizeLimitation(fieldImp("mediumVariant").toULongLong(), 168 fieldImp("mediumPath").toString(), 169 fieldImp("mediumSize").toULongLong()); 170 if (!fResult) 171 { 172 msgCenter().cannotCreateHardDiskStorageInFAT(strMediumPath, this); 173 return fResult; 174 } 175 176 155 177 startProcessing(); 156 178 157 /* Try to create VM: */158 boolfResult = qobject_cast<UIWizardNewVM*>(wizard())->createVM();179 fResult = qobject_cast<UIWizardNewVM*>(wizard())->createVirtualDisk(); 180 fResult = qobject_cast<UIWizardNewVM*>(wizard())->createVM(); 159 181 160 /* Unlock finish button: */161 182 endProcessing(); 183 162 184 163 185 return fResult;
Note:
See TracChangeset
for help on using the changeset viewer.