- Timestamp:
- Oct 27, 2021 2:01:36 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r91664 r92106 95 95 #include <VBox/version.h> 96 96 97 #define checkUnattendedInstallError(comUnattendedInstaller) \98 do { \99 if (!comUnattendedInstaller.isOk()) \100 { \101 COMErrorInfo comErrorInfo = comUnattendedInstaller.errorInfo(); \102 QString strErrorInfo = UIErrorString::formatErrorInfo(comErrorInfo); \103 msgCenter().cannotRunUnattendedGuestInstall(comUnattendedInstaller); \104 return; \105 } \106 } while (0)107 108 109 97 /** QDialog extension used to ask for a public key for console connection needs. */ 110 98 class UIAcquirePublicKeyDialog : public QIWithRetranslateUI<QDialog> … … 2431 2419 } 2432 2420 2421 bool UIVirtualBoxManager::checkUnattendedInstallError(CUnattended &comUnattendedInstaller) const 2422 { 2423 if (!comUnattendedInstaller.isOk()) 2424 { 2425 COMErrorInfo comErrorInfo = comUnattendedInstaller.errorInfo(); 2426 QString strErrorInfo = UIErrorString::formatErrorInfo(comErrorInfo); 2427 msgCenter().cannotRunUnattendedGuestInstall(comUnattendedInstaller); 2428 return false; 2429 } 2430 return true; 2431 } 2432 2433 2433 void UIVirtualBoxManager::openAddMachineDialog(const QString &strFileName /* = QString() */) 2434 2434 { … … 2542 2542 2543 2543 comUnattendedInstaller.SetIsoPath(unattendedData.m_strISOPath); 2544 checkUnattendedInstallError(comUnattendedInstaller);2544 AssertReturnVoid(checkUnattendedInstallError(comUnattendedInstaller)); 2545 2545 comUnattendedInstaller.SetMachine(comMachine); 2546 checkUnattendedInstallError(comUnattendedInstaller);2546 AssertReturnVoid(checkUnattendedInstallError(comUnattendedInstaller)); 2547 2547 comUnattendedInstaller.SetUser(unattendedData.m_strUserName); 2548 checkUnattendedInstallError(comUnattendedInstaller);2548 AssertReturnVoid(checkUnattendedInstallError(comUnattendedInstaller)); 2549 2549 comUnattendedInstaller.SetPassword(unattendedData.m_strPassword); 2550 checkUnattendedInstallError(comUnattendedInstaller);2550 AssertReturnVoid(checkUnattendedInstallError(comUnattendedInstaller)); 2551 2551 comUnattendedInstaller.SetHostname(unattendedData.m_strHostnameDomainName); 2552 checkUnattendedInstallError(comUnattendedInstaller);2552 AssertReturnVoid(checkUnattendedInstallError(comUnattendedInstaller)); 2553 2553 comUnattendedInstaller.SetProductKey(unattendedData.m_strProductKey); 2554 checkUnattendedInstallError(comUnattendedInstaller);2554 AssertReturnVoid(checkUnattendedInstallError(comUnattendedInstaller)); 2555 2555 comUnattendedInstaller.SetInstallGuestAdditions(unattendedData.m_fInstallGuestAdditions); 2556 checkUnattendedInstallError(comUnattendedInstaller);2556 AssertReturnVoid(checkUnattendedInstallError(comUnattendedInstaller)); 2557 2557 comUnattendedInstaller.SetAdditionsIsoPath(unattendedData.m_strGuestAdditionsISOPath); 2558 2558 2559 2559 comUnattendedInstaller.Prepare(); 2560 checkUnattendedInstallError(comUnattendedInstaller);2560 AssertReturnVoid(checkUnattendedInstallError(comUnattendedInstaller)); 2561 2561 comUnattendedInstaller.ConstructMedia(); 2562 checkUnattendedInstallError(comUnattendedInstaller);2562 AssertReturnVoid(checkUnattendedInstallError(comUnattendedInstaller)); 2563 2563 comUnattendedInstaller.ReconfigureVM(); 2564 checkUnattendedInstallError(comUnattendedInstaller);2564 AssertReturnVoid(checkUnattendedInstallError(comUnattendedInstaller)); 2565 2565 2566 2566 UICommon::LaunchMode enmLaunchMode = UICommon::LaunchMode_Default; -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h
r91001 r92106 41 41 class UIVirtualMachineItem; 42 42 class CCloudMachine; 43 class CUnattended; 43 44 44 45 /* Type definitions: */ … … 353 354 /** Returns whether at least one cloud profile currently being updated. */ 354 355 bool isCloudProfileUpdateInProgress() const; 356 357 /* Checks if @p comUnattendedInstaller has any errors. If so shows an error message and return false, else returns true. */ 358 bool checkUnattendedInstallError(CUnattended &comUnattendedInstaller) const; 355 359 /** @} */ 356 360
Note:
See TracChangeset
for help on using the changeset viewer.