VirtualBox

Changeset 99200 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 28, 2023 3:33:06 PM (22 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6669: VirtualBox Manager: Move Import Appliance wizard onto non-modal rails.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/manager
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r99199 r99200  
    470470    , m_pWidget(0)
    471471    , m_iGeometrySaveTimerId(-1)
     472    , m_fImportFromOCI(false)
    472473{
    473474    s_pInstance = this;
     
    710711            {
    711712                /* Allow only one file at the time: */
    712                 sltOpenImportApplianceWizard(strFile);
     713                openImportApplianceWizard(strFile);
    713714                break;
    714715            }
     
    924925}
    925926
    926 void UIVirtualBoxManager::sltOpenImportApplianceWizard(const QString &strFileName /* = QString() */)
    927 {
    928     /* Initialize variables: */
    929 #ifdef VBOX_WS_MAC
    930     QString strTmpFile = ::darwinResolveAlias(strFileName);
    931 #else
    932     QString strTmpFile = strFileName;
    933 #endif
    934 
    935     /* If there is no file-name passed,
    936      * check if cloud stuff focused currently: */
    937     bool fOCIByDefault = false;
    938     if (   strTmpFile.isEmpty()
    939         && (   m_pWidget->isSingleCloudProviderGroupSelected()
    940             || m_pWidget->isSingleCloudProfileGroupSelected()
    941             || m_pWidget->isCloudMachineItemSelected()))
    942     {
    943         /* We can generate cloud hints as well: */
    944         fOCIByDefault = true;
    945         strTmpFile = m_pWidget->fullGroupName();
    946     }
    947 
    948     /* Lock the action preventing cascade calls: */
    949     UIQObjectPropertySetter guardBlock(actionPool()->action(UIActionIndexMN_M_File_S_ImportAppliance), "opened", true);
    950     connect(&guardBlock, &UIQObjectPropertySetter::sigAboutToBeDestroyed,
    951             this, &UIVirtualBoxManager::sltHandleUpdateActionAppearanceRequest);
    952     updateActionsAppearance();
    953 
    954     /* Use the "safe way" to open stack of Mac OS X Sheets: */
    955     QWidget *pWizardParent = windowManager().realParentWindow(this);
    956     UINativeWizardPointer pWizard = new UIWizardImportApp(pWizardParent, fOCIByDefault, strTmpFile);
    957     windowManager().registerNewParent(pWizard, pWizardParent);
    958     pWizard->exec();
    959     delete pWizard;
    960 }
    961 
    962927void UIVirtualBoxManager::sltOpenExportApplianceWizard()
    963928{
     
    10361001        switch (enmType)
    10371002        {
     1003            case WizardType_ImportAppliance:
     1004                m_wizards[enmType] = new UIWizardImportApp(this, m_fImportFromOCI, m_strFileName);
     1005                break;
    10381006            case WizardType_NewCloudVM:
    10391007                m_wizards[enmType] = new UIWizardNewCloudVM(this, m_pWidget->fullGroupName());
     
    26602628}
    26612629
     2630void UIVirtualBoxManager::openImportApplianceWizard(const QString &strFileName /* = QString() */)
     2631{
     2632    /* Configure wizard variables: */
     2633    m_fImportFromOCI = false;
     2634#ifdef VBOX_WS_MAC
     2635    m_strFileName = ::darwinResolveAlias(strFileName);
     2636#else
     2637    m_strFileName = strFileName;
     2638#endif
     2639
     2640    /* If there is no file-name passed,
     2641     * check if cloud stuff focused currently: */
     2642    if (   m_strFileName.isEmpty()
     2643        && (   m_pWidget->isSingleCloudProviderGroupSelected()
     2644            || m_pWidget->isSingleCloudProfileGroupSelected()
     2645            || m_pWidget->isCloudMachineItemSelected()))
     2646    {
     2647        m_fImportFromOCI = true;
     2648        /* We can generate cloud hints as well: */
     2649        m_strFileName = m_pWidget->fullGroupName();
     2650    }
     2651
     2652    /* Open Import Appliance Wizard: */
     2653    sltOpenWizard(WizardType_ImportAppliance);
     2654}
     2655
    26622656/* static */
    26632657void UIVirtualBoxManager::launchMachine(CMachine &comMachine,
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h

    r99195 r99200  
    186186        void sltCloseManagerWindowDefault() { sltCloseManagerWindow(); }
    187187
    188         /** Handles call to open Import Appliance wizard.
    189           * @param strFileName can bring the name of file to import appliance from. */
    190         void sltOpenImportApplianceWizard(const QString &strFileName = QString());
    191188        /** Handles call to open Import Appliance wizard the default way. */
    192         void sltOpenImportApplianceWizardDefault() { sltOpenImportApplianceWizard(); }
     189        void sltOpenImportApplianceWizardDefault() { openImportApplianceWizard(); }
    193190        /** Handles call to open Export Appliance wizard. */
    194191        void sltOpenExportApplianceWizard();
     
    403400        /** Opens new machine dialog specifying initial name with @a strFileName. */
    404401        void openNewMachineWizard(const QString &strISOFilePath = QString());
     402
     403        /** Opens Import Appliance wizard.
     404          * @param strFileName can bring the name of file to import appliance from. */
     405        void openImportApplianceWizard(const QString &strFileName = QString());
     406
    405407        /** Launches certain @a comMachine in specified @a enmLaunchMode. */
    406408        static void launchMachine(CMachine &comMachine, UILaunchMode enmLaunchMode = UILaunchMode_Default);
     
    518520
    519521    /** Holds the geometry save timer ID. */
    520     int  m_iGeometrySaveTimerId;
     522    int      m_iGeometrySaveTimerId;
     523    /** Holds whether OCI importing should be started by default. */
     524    bool     m_fImportFromOCI;
     525    /** Holds the file-name used by import wizard. */
     526    QString  m_strFileName;
    521527};
    522528
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