Changeset 99207 in vbox for trunk/src/VBox
- Timestamp:
- Mar 29, 2023 12:07:11 PM (22 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r99202 r99207 987 987 switch (enmType) 988 988 { 989 case WizardType_NewVM: 990 m_wizards[enmType] = new UIWizardNewVM(this, actionPool(), m_pWidget->fullGroupName(), m_strISOFilePath); 991 break; 989 992 case WizardType_ExportAppliance: 990 993 m_wizards[enmType] = new UIWizardExportApp(this, m_names, m_fExportToOCI); … … 1016 1019 void UIVirtualBoxManager::sltCloseWizard(WizardType enmType) 1017 1020 { 1021 /* Postprocess wizard if still exists: */ 1022 if (m_wizards.contains(enmType)) 1023 { 1024 switch (enmType) 1025 { 1026 case WizardType_NewVM: 1027 { 1028 UIWizardNewVM *pWizard = qobject_cast<UIWizardNewVM*>(m_wizards.value(enmType)); 1029 if (pWizard->isUnattendedEnabled()) 1030 startUnattendedInstall(pWizard->installer(), 1031 pWizard->startHeadless(), 1032 pWizard->createdMachineId().toString()); 1033 break; 1034 } 1035 default: 1036 break; 1037 } 1038 } 1039 1040 /* Cleanup instance: */ 1018 1041 delete m_wizards.take(enmType); 1019 1042 } … … 2586 2609 void UIVirtualBoxManager::openNewMachineWizard(const QString &strISOFilePath /* = QString() */) 2587 2610 { 2588 /* Lock the actions preventing cascade calls: */ 2589 UIQObjectPropertySetter guardBlock(QList<QObject*>() << actionPool()->action(UIActionIndexMN_M_Welcome_S_New) 2590 << actionPool()->action(UIActionIndexMN_M_Machine_S_New) 2591 << actionPool()->action(UIActionIndexMN_M_Group_S_New), 2592 "opened", true); 2593 connect(&guardBlock, &UIQObjectPropertySetter::sigAboutToBeDestroyed, 2594 this, &UIVirtualBoxManager::sltHandleUpdateActionAppearanceRequest); 2595 updateActionsAppearance(); 2596 2597 CUnattended comUnattendedInstaller = uiCommon().virtualBox().CreateUnattendedInstaller(); 2598 AssertMsg(!comUnattendedInstaller.isNull(), ("Could not create unattended installer!\n")); 2599 2600 /* Use the "safe way" to open stack of Mac OS X Sheets: */ 2601 QWidget *pWizardParent = windowManager().realParentWindow(this); 2602 UISafePointerWizardNewVM pWizard = new UIWizardNewVM(pWizardParent, actionPool(), 2603 m_pWidget->fullGroupName(), 2604 comUnattendedInstaller, strISOFilePath); 2605 windowManager().registerNewParent(pWizard, pWizardParent); 2606 2607 /* Execute wizard: */ 2608 pWizard->exec(); 2609 2610 bool fStartHeadless = pWizard->startHeadless(); 2611 bool fUnattendedEnabled = pWizard->isUnattendedEnabled(); 2612 QString strMachineId = pWizard->createdMachineId().toString(); 2613 delete pWizard; 2614 /* Handle unattended install stuff: */ 2615 if (fUnattendedEnabled) 2616 startUnattendedInstall(comUnattendedInstaller, fStartHeadless, strMachineId); 2611 /* Configure wizard variables: */ 2612 m_strISOFilePath = strISOFilePath; 2613 2614 /* Open New VM Wizard: */ 2615 sltOpenWizard(WizardType_NewVM); 2617 2616 } 2618 2617 … … 2683 2682 } 2684 2683 2685 void UIVirtualBoxManager::startUnattendedInstall( CUnattended &comUnattendedInstaller,2684 void UIVirtualBoxManager::startUnattendedInstall(const CUnattended &comUnattendedRef, 2686 2685 bool fStartHeadless, const QString &strMachineId) 2687 2686 { … … 2691 2690 return; 2692 2691 2693 comUnattendedInstaller.Prepare(); 2694 AssertReturnVoid(checkUnattendedInstallError(comUnattendedInstaller)); 2695 comUnattendedInstaller.ConstructMedia(); 2696 AssertReturnVoid(checkUnattendedInstallError(comUnattendedInstaller)); 2697 comUnattendedInstaller.ReconfigureVM(); 2698 AssertReturnVoid(checkUnattendedInstallError(comUnattendedInstaller)); 2692 CUnattended comUnattended = comUnattendedRef; 2693 comUnattended.Prepare(); 2694 AssertReturnVoid(checkUnattendedInstallError(comUnattended)); 2695 comUnattended.ConstructMedia(); 2696 AssertReturnVoid(checkUnattendedInstallError(comUnattended)); 2697 comUnattended.ReconfigureVM(); 2698 AssertReturnVoid(checkUnattendedInstallError(comUnattended)); 2699 2699 2700 2700 launchMachine(comMachine, fStartHeadless ? UILaunchMode_Headless : UILaunchMode_Default); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h
r99202 r99207 411 411 412 412 /** Creates an unattended installer and uses it to install guest os to newly created vm. */ 413 void startUnattendedInstall( CUnattended &comUnattendedInstaller, bool fStartHeadless, const QString &strMachineId);413 void startUnattendedInstall(const CUnattended &comUnattended, bool fStartHeadless, const QString &strMachineId); 414 414 415 415 /** Launches or shows virtual machines represented by passed @a items in corresponding @a enmLaunchMode (for launch). */ … … 522 522 int m_iGeometrySaveTimerId; 523 523 524 /** Holds the ISO file path used by new VM wizard. */ 525 QString m_strISOFilePath; 526 524 527 /** Holds whether OCI importing should be started by default. */ 525 528 bool m_fImportFromOCI; -
trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsModel.cpp
r98103 r99207 50 50 #include "UIVirtualBoxManagerWidget.h" 51 51 #include "UIVirtualBoxEventHandler.h" 52 #include "UIWizardNewVM.h"53 52 54 53 /* COM includes: */ -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIToolBox.cpp
r98103 r99207 39 39 #include "UIIconPool.h" 40 40 #include "UIToolBox.h" 41 #include "UIWizardNewVM.h"42 41 43 42 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIHostnameDomainNameEditor.cpp
r98103 r99207 41 41 #include "UIIconPool.h" 42 42 #include "UIHostnameDomainNameEditor.h" 43 #include "UIWizardNewVM.h"44 45 43 46 44 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIUserNamePasswordEditor.cpp
r98103 r99207 39 39 #include "UIIconPool.h" 40 40 #include "UIUserNamePasswordEditor.h" 41 #include "UIWizardNewVM.h" 41 42 /* Other VBox includes: */ 43 #include "iprt/assert.h" 42 44 43 45 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/editors/UIWizardDiskEditors.cpp
r98103 r99207 47 47 #include "UIUserNamePasswordEditor.h" 48 48 #include "UIWizardDiskEditors.h" 49 #include "UIWizardNewVM.h"50 49 #include "UIWizardNewVMDiskPage.h" 51 50 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.cpp
r98103 r99207 52 52 #include "CUSBController.h" 53 53 #include "CUSBDeviceFilters.h" 54 #include "CUnattended.h"55 54 56 55 /* Namespaces: */ … … 61 60 UIActionPool *pActionPool, 62 61 const QString &strMachineGroup, 63 CUnattended &comUnattended,64 62 const QString &strISOFilePath /* = QString() */) 65 63 : UINativeWizard(pParent, WizardType_NewVM, WizardMode_Auto, "create-vm-wizard" /* help keyword */) … … 82 80 , m_fEmptyDiskRecommended(false) 83 81 , m_pActionPool(pActionPool) 84 , m_comUnattended(comUnattended)85 82 , m_fStartHeadless(false) 86 83 , m_strInitialISOFilePath(strISOFilePath) … … 97 94 98 95 connect(this, &UIWizardNewVM::rejected, this, &UIWizardNewVM::sltHandleWizardCancel); 96 97 /* Create installer: */ 98 m_comUnattended = uiCommon().virtualBox().CreateUnattendedInstaller(); 99 AssertMsg(!m_comUnattended.isNull(), ("Could not create unattended installer!\n")); 99 100 } 100 101 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvm/UIWizardNewVM.h
r98103 r99207 41 41 #include "CMediumFormat.h" 42 42 #include "CGuestOSType.h" 43 #include "CUnattended.h" 43 44 44 45 /* Forward declarations: */ … … 63 64 UIActionPool *pActionPool, 64 65 const QString &strMachineGroup, 65 CUnattended &comUnattended,66 66 const QString &strISOFilePath = QString()); 67 67 … … 79 79 const QString &machineGroup() const; 80 80 QUuid createdMachineId() const; 81 82 CUnattended installer() const { return m_comUnattended; } 81 83 82 84 /** @name Setter/getters for vm parameters … … 237 239 QVector<KMediumVariant> m_mediumVariants; 238 240 UIActionPool *m_pActionPool; 239 CUnattended &m_comUnattended;241 CUnattended m_comUnattended; 240 242 bool m_fStartHeadless; 241 243 QString m_strInitialISOFilePath;
Note:
See TracChangeset
for help on using the changeset viewer.