Changeset 99195 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Mar 28, 2023 11:57:02 AM (22 months 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
r99185 r99195 1029 1029 } 1030 1030 1031 void UIVirtualBoxManager::sltOpenWizard(WizardType enmType) 1032 { 1033 /* Create instance if not yet created: */ 1034 if (!m_wizards.contains(enmType)) 1035 { 1036 switch (enmType) 1037 { 1038 case WizardType_NewCloudVM: 1039 m_wizards[enmType] = new UIWizardNewCloudVM(this, m_pWidget->fullGroupName()); 1040 break; 1041 default: 1042 break; 1043 } 1044 1045 connect(m_wizards.value(enmType), &UINativeWizard::sigClose, 1046 this, &UIVirtualBoxManager::sltCloseWizard); 1047 } 1048 1049 /* Expose instance: */ 1050 m_wizards.value(enmType)->show(); 1051 m_wizards.value(enmType)->setWindowState(m_wizards.value(enmType)->windowState() & ~Qt::WindowMinimized); 1052 m_wizards.value(enmType)->activateWindow(); 1053 m_wizards.value(enmType)->raise(); 1054 } 1055 1056 void UIVirtualBoxManager::sltCloseWizard(WizardType enmType) 1057 { 1058 delete m_wizards.take(enmType); 1059 } 1060 1031 1061 void UIVirtualBoxManager::sltOpenNewMachineWizard() 1032 1062 { 1033 openNewMachineWizard(); 1063 /* Get first selected item: */ 1064 UIVirtualMachineItem *pItem = currentItem(); 1065 1066 /* For global item or local machine: */ 1067 if ( !pItem 1068 || pItem->itemType() == UIVirtualMachineItemType_Local) 1069 openNewMachineWizard(); 1070 /* For cloud machine: */ 1071 else 1072 sltOpenWizard(WizardType_NewCloudVM); 1034 1073 } 1035 1074 … … 2608 2647 updateActionsAppearance(); 2609 2648 2610 /* Get first selected item: */ 2611 UIVirtualMachineItem *pItem = currentItem(); 2612 2613 /* For global item or local machine: */ 2614 if ( !pItem 2615 || pItem->itemType() == UIVirtualMachineItemType_Local) 2616 { 2617 CUnattended comUnattendedInstaller = uiCommon().virtualBox().CreateUnattendedInstaller(); 2618 AssertMsg(!comUnattendedInstaller.isNull(), ("Could not create unattended installer!\n")); 2619 2620 /* Use the "safe way" to open stack of Mac OS X Sheets: */ 2621 QWidget *pWizardParent = windowManager().realParentWindow(this); 2622 UISafePointerWizardNewVM pWizard = new UIWizardNewVM(pWizardParent, actionPool(), 2623 m_pWidget->fullGroupName(), 2624 comUnattendedInstaller, strISOFilePath); 2625 windowManager().registerNewParent(pWizard, pWizardParent); 2626 2627 /* Execute wizard: */ 2628 pWizard->exec(); 2629 2630 bool fStartHeadless = pWizard->startHeadless(); 2631 bool fUnattendedEnabled = pWizard->isUnattendedEnabled(); 2632 QString strMachineId = pWizard->createdMachineId().toString(); 2633 delete pWizard; 2634 /* Handle unattended install stuff: */ 2635 if (fUnattendedEnabled) 2636 startUnattendedInstall(comUnattendedInstaller, fStartHeadless, strMachineId); 2637 } 2638 /* For cloud machine: */ 2639 else 2640 { 2641 /* Use the "safe way" to open stack of Mac OS X Sheets: */ 2642 QWidget *pWizardParent = windowManager().realParentWindow(this); 2643 UISafePointerWizardNewCloudVM pWizard = new UIWizardNewCloudVM(pWizardParent, m_pWidget->fullGroupName()); 2644 windowManager().registerNewParent(pWizard, pWizardParent); 2645 2646 /* Execute wizard: */ 2647 pWizard->exec(); 2648 delete pWizard; 2649 } 2649 CUnattended comUnattendedInstaller = uiCommon().virtualBox().CreateUnattendedInstaller(); 2650 AssertMsg(!comUnattendedInstaller.isNull(), ("Could not create unattended installer!\n")); 2651 2652 /* Use the "safe way" to open stack of Mac OS X Sheets: */ 2653 QWidget *pWizardParent = windowManager().realParentWindow(this); 2654 UISafePointerWizardNewVM pWizard = new UIWizardNewVM(pWizardParent, actionPool(), 2655 m_pWidget->fullGroupName(), 2656 comUnattendedInstaller, strISOFilePath); 2657 windowManager().registerNewParent(pWizard, pWizardParent); 2658 2659 /* Execute wizard: */ 2660 pWizard->exec(); 2661 2662 bool fStartHeadless = pWizard->startHeadless(); 2663 bool fUnattendedEnabled = pWizard->isUnattendedEnabled(); 2664 QString strMachineId = pWizard->createdMachineId().toString(); 2665 delete pWizard; 2666 /* Handle unattended install stuff: */ 2667 if (fUnattendedEnabled) 2668 startUnattendedInstall(comUnattendedInstaller, fStartHeadless, strMachineId); 2650 2669 } 2651 2670 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h
r98996 r99195 49 49 class UIAction; 50 50 class UIActionPool; 51 class UINativeWizard; 51 52 struct UIUnattendedInstallData; 52 53 class UIVirtualBoxManagerWidget; … … 209 210 /** @name Machine menu stuff. 210 211 * @{ */ 212 /** Handles call to open wizard of specified @a enmType. */ 213 void sltOpenWizard(WizardType enmType); 214 /** Handles call to close wizard of specified @a enmType. */ 215 void sltCloseWizard(WizardType enmType); 216 211 217 /** Handles call to open new machine wizard. */ 212 218 void sltOpenNewMachineWizard(); … … 502 508 UISafePointerCloudMachineSettingsDialog m_pCloudSettings; 503 509 510 /** Holds the map of various wizards. */ 511 QMap<WizardType, UINativeWizard*> m_wizards; 512 504 513 /** Holds the instance of UIVMLogViewerDialog. */ 505 514 QIManagerDialog *m_pLogViewerDialog;
Note:
See TracChangeset
for help on using the changeset viewer.