VirtualBox

Changeset 99195 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Mar 28, 2023 11:57:02 AM (22 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6669: VirtualBox Manager: Move New Cloud VM wizard onto non-modal rails; There is still work to do, but after all remaining wizards became non-modal as well.

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  
    10291029}
    10301030
     1031void 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
     1056void UIVirtualBoxManager::sltCloseWizard(WizardType enmType)
     1057{
     1058    delete m_wizards.take(enmType);
     1059}
     1060
    10311061void UIVirtualBoxManager::sltOpenNewMachineWizard()
    10321062{
    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);
    10341073}
    10351074
     
    26082647    updateActionsAppearance();
    26092648
    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);
    26502669}
    26512670
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h

    r98996 r99195  
    4949class UIAction;
    5050class UIActionPool;
     51class UINativeWizard;
    5152struct UIUnattendedInstallData;
    5253class UIVirtualBoxManagerWidget;
     
    209210    /** @name Machine menu stuff.
    210211      * @{ */
     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
    211217        /** Handles call to open new machine wizard. */
    212218        void sltOpenNewMachineWizard();
     
    502508    UISafePointerCloudMachineSettingsDialog                m_pCloudSettings;
    503509
     510    /** Holds the map of various wizards. */
     511    QMap<WizardType, UINativeWizard*>  m_wizards;
     512
    504513    /** Holds the instance of UIVMLogViewerDialog. */
    505514    QIManagerDialog *m_pLogViewerDialog;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette