Changeset 99406 in vbox
- Timestamp:
- Apr 14, 2023 5:04:14 PM (2 years ago)
- svn:sync-xref-src-repo-rev:
- 156856
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVD.cpp
r99390 r99406 172 172 const QString &strMachineGuestOSTypeId /* = QString() */) 173 173 { 174 /* Initialize variables: */ 175 QString strDefaultFolder = strMachineFolder; 176 if (strDefaultFolder.isEmpty()) 177 strDefaultFolder = uiCommon().defaultFolderPathForType(UIMediumDeviceType_HardDisk); 178 179 /* In case we dont have a 'guest os type id' default back to 'Other': */ 174 /* Default path: */ 175 const QString strDefaultPath = !strMachineFolder.isEmpty() 176 ? strMachineFolder 177 : uiCommon().defaultFolderPathForType(UIMediumDeviceType_HardDisk); 178 179 /* Default name: */ 180 const QString strDiskName = uiCommon().findUniqueFileName(strDefaultPath, 181 !strMachineName.isEmpty() 182 ? strMachineName 183 : "NewVirtualDisk"); 184 185 /* Default size: */ 180 186 const CGuestOSType comGuestOSType = uiCommon().virtualBox().GetGuestOSType( !strMachineGuestOSTypeId.isEmpty() 181 ? strMachineGuestOSTypeId 182 : "Other"); 183 const QString strDiskName = uiCommon().findUniqueFileName(strDefaultFolder, !strMachineName.isEmpty() 184 ? strMachineName 185 : "NewVirtualDisk"); 186 187 /* Show New VD wizard: */ 188 UISafePointerWizardNewVD pWizard = new UIWizardNewVD(pParent, 187 ? strMachineGuestOSTypeId 188 : "Other"); 189 const qulonglong uDefaultSize = comGuestOSType.GetRecommendedHDD(); 190 191 /* Show New VD wizard the safe way: */ 192 QWidget *pRealParent = windowManager().realParentWindow(pParent); 193 UISafePointerWizardNewVD pWizard = new UIWizardNewVD(pRealParent, 189 194 strDiskName, 190 strDefault Folder,191 comGuestOSType.GetRecommendedHDD());195 strDefaultPath, 196 uDefaultSize); 192 197 if (!pWizard) 193 198 return QUuid(); 194 QWidget *pDialogParent = windowManager().realParentWindow(pParent); 195 windowManager().registerNewParent(pWizard, pDialogParent); 196 QUuid mediumId = pWizard->mediumId(); 199 windowManager().registerNewParent(pWizard, pRealParent); 197 200 pWizard->exec(); 201 const QUuid uMediumId = pWizard->mediumId(); 198 202 delete pWizard; 199 return mediumId;203 return uMediumId; 200 204 } 201 205
Note:
See TracChangeset
for help on using the changeset viewer.