Changeset 73586 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Aug 9, 2018 1:34:57 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r73198 r73586 1688 1688 } 1689 1689 1690 void UIMessageCenter::cannotCreateHardDiskStorageInFAT(const QString &strLocation, QWidget *pParent /* = 0 */) const 1691 { 1692 error(pParent, MessageType_Error, 1693 tr("Failed to create the hard disk storage <nobr><b>%1</b>.</nobr> FAT file systems has 4GB (minus some overhead) size limit") 1694 .arg(strLocation), QString()); 1695 } 1696 1690 1697 void UIMessageCenter::cannotCreateMediumStorage(const CVirtualBox &comVBox, const QString &strLocation, QWidget *pParent /* = 0 */) const 1691 1698 { … … 2889 2896 return iResultCode; 2890 2897 } 2891 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r73198 r73586 370 370 void cannotCreateHardDiskStorage(const CMedium &medium, const QString &strLocation, QWidget *pParent = 0) const; 371 371 void cannotCreateHardDiskStorage(const CProgress &progress, const QString &strLocation, QWidget *pParent = 0) const; 372 void cannotCreateHardDiskStorageInFAT(const QString &strLocation, QWidget *pParent = 0) const; 372 373 void cannotCreateMediumStorage(const CVirtualBox &comVBox, const QString &strLocation, QWidget *pParent = 0) const; 373 374 void cannotCreateMediumStorage(const CMedium &comMedium, const QString &strLocation, QWidget *pParent = 0) const; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVD.cpp
r72696 r73586 151 151 UIWizard::prepare(); 152 152 } 153 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageBasic3.cpp
r71027 r73586 48 48 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ 49 49 50 /* Other VBox includes: */ 51 #include <iprt/path.h> 50 52 51 53 UIWizardNewVDPage3::UIWizardNewVDPage3(const QString &strDefaultName, const QString &strDefaultPath) … … 262 264 263 265 if (fResult) 266 fResult = checkFATSizeLimitation(); 267 268 if (!fResult) 269 msgCenter().cannotCreateHardDiskStorageInFAT(strMediumPath, this); 270 else 264 271 { 265 272 /* Lock finish button: */ … … 268 275 /* Try to create virtual hard drive file: */ 269 276 fResult = qobject_cast<UIWizardNewVD*>(wizard())->createVirtualDisk(); 270 271 /* Unlock finish button: */ 277 /* Unlock finish button: */ 272 278 endProcessing(); 273 279 } … … 277 283 } 278 284 285 bool UIWizardNewVDPage3::checkFATSizeLimitation() 286 { 287 QString strMediumPath(mediumPath()); 288 RTFSTYPE enmType; 289 int rc = RTFsQueryType(QFileInfo(strMediumPath).absolutePath().toLatin1().constData(), &enmType); 290 if (RT_SUCCESS(rc)) 291 { 292 if (enmType == RTFSTYPE_FAT) 293 { 294 /* Limit the medium size to 4GB. minus 128 MB for file overhead: */ 295 qulonglong fatLimit = 4 * pow(2,30) - 128 * pow(2, 20); 296 if (mediumSize() >= fatLimit) 297 return false; 298 } 299 } 300 return true; 301 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageBasic3.h
r72021 r73586 45 45 static QString absoluteFilePath(const QString &strFileName, const QString &strDefaultPath); 46 46 static QString defaultExtension(const CMediumFormat &mediumFormatRef); 47 48 /* Checks if the medium file is bigger than what is allowed in FAT file systems. */ 49 bool checkFATSizeLimitation(); 47 50 48 51 /* Stuff for 'mediumPath' field: */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageExpert.cpp
r72821 r73586 269 269 msgCenter().cannotOverwriteHardDiskStorage(strMediumPath, this); 270 270 271 if (fResult) 272 fResult = checkFATSizeLimitation(); 273 274 if (!fResult) 275 msgCenter().cannotCreateHardDiskStorageInFAT(strMediumPath, this); 276 271 277 /* Try to create virtual-disk: */ 272 278 if (fResult) … … 279 285 return fResult; 280 286 } 281
Note:
See TracChangeset
for help on using the changeset viewer.