Changeset 73597 in vbox
- Timestamp:
- Aug 9, 2018 5:32:32 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
-
globals/UIMessageCenter.cpp (modified) (1 diff)
-
wizards/newvd/UIWizardNewVD.cpp (modified) (2 diffs)
-
wizards/newvd/UIWizardNewVD.h (modified) (1 diff)
-
wizards/newvd/UIWizardNewVDPageBasic3.cpp (modified) (5 diffs)
-
wizards/newvd/UIWizardNewVDPageBasic3.h (modified) (1 diff)
-
wizards/newvd/UIWizardNewVDPageExpert.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r73595 r73597 1691 1691 { 1692 1692 alert(pParent, MessageType_Info, 1693 tr("Failed to create the hard disk storage <nobr><b>%1</b>.</nobr> FAT file systems have 4GB file size limit ")1693 tr("Failed to create the hard disk storage <nobr><b>%1</b>.</nobr> FAT file systems have 4GB file size limit.") 1694 1694 .arg(strLocation)); 1695 1695 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVD.cpp
r73592 r73597 38 38 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ 39 39 40 /* Other VBox includes: */41 #include <iprt/cdefs.h>42 #include <iprt/path.h>43 40 44 41 UIWizardNewVD::UIWizardNewVD(QWidget *pParent, … … 118 115 } 119 116 120 bool UIWizardNewVD::checkFATSizeLimitation()121 {122 qulonglong uVariant = field("mediumVariant").toULongLong();123 /* If the hard disk is split into 2GB parts then no need to make further checks: */124 if (uVariant & KMediumVariant_VmdkSplit2G)125 return true;126 127 QString strMediumPath = field("mediumPath").toString();128 qulonglong uSize = field("mediumSize").toULongLong();129 130 RTFSTYPE enmType;131 int rc = RTFsQueryType(QFileInfo(strMediumPath).absolutePath().toLatin1().constData(), &enmType);132 if (RT_SUCCESS(rc))133 {134 if (enmType == RTFSTYPE_FAT)135 {136 /* Limit the medium size to 4GB. minus 128 MB for file overhead: */137 qulonglong fatLimit = _4G - _128M;138 if (uSize >= fatLimit)139 return false;140 }141 }142 return true;143 }144 145 117 void UIWizardNewVD::retranslateUi() 146 118 { -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVD.h
r73592 r73597 64 64 bool createVirtualDisk(); 65 65 66 /* Checks if the medium file is bigger than what is allowed in FAT file systems. */67 bool checkFATSizeLimitation();68 69 66 /* Who will be able to create virtual-disk: */ 70 67 friend class UIWizardNewVDPageBasic3; -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageBasic3.cpp
r73592 r73597 48 48 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ 49 49 50 /* Other VBox includes: */ 51 #include <iprt/cdefs.h> 52 #include <iprt/path.h> 53 54 50 55 UIWizardNewVDPage3::UIWizardNewVDPage3(const QString &strDefaultName, const QString &strDefaultPath) 51 56 : m_strDefaultName(strDefaultName.isEmpty() ? QString("NewVirtualDisk1") : strDefaultName) … … 156 161 AssertMsgFailed(("Extension can't be NULL!\n")); 157 162 return QString(); 163 } 164 165 bool UIWizardNewVDPage3::checkFATSizeLimitation() 166 { 167 /* Acquire medium variant: */ 168 const qulonglong uVariant = fieldImp("mediumVariant").toULongLong(); 169 170 /* If the hard disk is split into 2GB parts then no need to make further checks: */ 171 if (uVariant & KMediumVariant_VmdkSplit2G) 172 return true; 173 174 /* Acquire medium path and size: */ 175 const QString strMediumPath = fieldImp("mediumPath").toString(); 176 const qulonglong uSize = fieldImp("mediumSize").toULongLong(); 177 178 RTFSTYPE enmType; 179 int rc = RTFsQueryType(QFileInfo(strMediumPath).absolutePath().toLatin1().constData(), &enmType); 180 if (RT_SUCCESS(rc)) 181 { 182 if (enmType == RTFSTYPE_FAT) 183 { 184 /* Limit the medium size to 4GB. minus 128 MB for file overhead: */ 185 qulonglong fatLimit = _4G - _128M; 186 if (uSize >= fatLimit) 187 return false; 188 } 189 } 190 191 return true; 158 192 } 159 193 … … 254 288 bool fResult = true; 255 289 256 /* Make sure such file doesn't exist salready: */257 QString strMediumPath(mediumPath());290 /* Make sure such file doesn't exist already: */ 291 const QString strMediumPath(mediumPath()); 258 292 fResult = !QFileInfo(strMediumPath).exists(); 259 293 if (!fResult) … … 263 297 } 264 298 265 fResult = qobject_cast<UIWizardNewVD*>(wizard())->checkFATSizeLimitation(); 299 /* Make sure we are passing FAT size limitation: */ 300 fResult = checkFATSizeLimitation(); 266 301 if (!fResult) 267 302 { … … 272 307 /* Lock finish button: */ 273 308 startProcessing(); 274 275 /* Try to create virtual hard drive file: */ 309 /* Try to create virtual-disk: */ 276 310 fResult = qobject_cast<UIWizardNewVD*>(wizard())->createVirtualDisk(); 277 311 /* Unlock finish button: */ -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageBasic3.h
r73592 r73597 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
r73592 r73597 260 260 bool fResult = true; 261 261 262 /* Make sure such virtual-disk doesn't exists: */263 QString strMediumPath(mediumPath());262 /* Make sure such file doesn't exist already: */ 263 const QString strMediumPath(mediumPath()); 264 264 fResult = !QFileInfo(strMediumPath).exists(); 265 265 if (!fResult) … … 269 269 } 270 270 271 fResult = qobject_cast<UIWizardNewVD*>(wizard())->checkFATSizeLimitation(); 271 /* Make sure we are passing FAT size limitation: */ 272 fResult = checkFATSizeLimitation(); 272 273 if (!fResult) 273 274 { … … 278 279 /* Lock finish button: */ 279 280 startProcessing(); 280 281 281 /* Try to create virtual-disk: */ 282 282 fResult = qobject_cast<UIWizardNewVD*>(wizard())->createVirtualDisk(); 283 284 283 /* Unlock finish button: */ 285 284 endProcessing();
Note:
See TracChangeset
for help on using the changeset viewer.

