bool UIWizardNewVDPageBasic3::validatePage() { /* Initial result: */ bool fResult = true; /* Make sure such file doesn't exists already: */ QString strMediumPath(mediumPath()); fResult = !QFileInfo(strMediumPath).exists(); if (!fResult) msgCenter().cannotOverwriteHardDiskStorage(strMediumPath, this); if (fResult) { /* Lock finish button: */ startProcessing(); /* Try to create virtual hard drive file: */ fResult = qobject_cast<UIWizardNewVD*>(wizard())->createVirtualDisk(); /* Unlock finish button: */ endProcessing(); } /* Return result: */ return fResult; }
bool UIWizardCloneVDPageExpert::validatePage() { /* Initial result: */ bool fResult = true; /* Lock finish button: */ startProcessing(); /* Make sure such virtual-disk doesn't exists: */ QString strMediumPath(mediumPath()); fResult = !QFileInfo(strMediumPath).exists(); if (!fResult) msgCenter().cannotOverwriteHardDiskStorage(strMediumPath, this); /* Try to copy virtual-disk: */ if (fResult) fResult = qobject_cast<UIWizardCloneVD*>(wizard())->copyVirtualDisk(); /* Unlock finish button: */ endProcessing(); /* Return result: */ return fResult; }