VirtualBox

Changeset 77305 in vbox


Ignore:
Timestamp:
Feb 13, 2019 5:34:03 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
128830
Message:

FE/Qt: bugref:9390: Manager action-pool, VirtualBox Manager and Export Appliance wizard: Reworking Export menu action to Export to OCI menu action to be a shortcut to direct OCI export page.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.cpp

    r77298 r77305  
    692692};
    693693
    694 /** Simple action extension, used as 'Perform Export Machine' action class. */
    695 class UIActionSimpleSelectorMachinePerformExport : public UIActionSimple
    696 {
    697     Q_OBJECT;
    698 
    699 public:
    700 
    701     /** Constructs action passing @a pParent to the base-class. */
    702     UIActionSimpleSelectorMachinePerformExport(UIActionPool *pParent)
    703         : UIActionSimple(pParent, ":/export_16px.png", ":/export_disabled_16px.png")
    704     {}
    705 
    706 protected:
    707 
    708     /** Returns shortcut extra-data ID. */
    709     virtual QString shortcutExtraDataID() const /* override */
    710     {
    711         return QString("ExportVM");
    712     }
    713 
    714     /** Handles translation event. */
    715     virtual void retranslateUi() /* override */
    716     {
    717         setName(QApplication::translate("UIActionPool", "E&xport..."));
    718         setStatusTip(QApplication::translate("UIActionPool", "Export selected virtual machine"));
    719     }
    720 };
    721 
    722694/** Simple action extension, used as 'Perform Move Machine' action class. */
    723695class UIActionSimpleSelectorMachinePerformMove : public UIActionSimple
     
    745717        setName(QApplication::translate("UIActionPool", "&Move..."));
    746718        setStatusTip(QApplication::translate("UIActionPool", "Move selected virtual machine"));
     719    }
     720};
     721
     722/** Simple action extension, used as 'Perform Export Machine to OCI' action class. */
     723class UIActionSimpleSelectorMachinePerformExportToOCI : public UIActionSimple
     724{
     725    Q_OBJECT;
     726
     727public:
     728
     729    /** Constructs action passing @a pParent to the base-class. */
     730    UIActionSimpleSelectorMachinePerformExportToOCI(UIActionPool *pParent)
     731        : UIActionSimple(pParent, ":/export_16px.png", ":/export_disabled_16px.png")
     732    {}
     733
     734protected:
     735
     736    /** Returns shortcut extra-data ID. */
     737    virtual QString shortcutExtraDataID() const /* override */
     738    {
     739        return QString("ExportToOCI");
     740    }
     741
     742    /** Handles translation event. */
     743    virtual void retranslateUi() /* override */
     744    {
     745        setName(QApplication::translate("UIActionPool", "E&xport to OCI..."));
     746        setStatusTip(QApplication::translate("UIActionPool", "Export selected virtual machine to OCI"));
    747747    }
    748748};
     
    26872687    m_pool[UIActionIndexST_M_Machine_S_Settings] = new UIActionSimpleSelectorMachineShowSettings(this);
    26882688    m_pool[UIActionIndexST_M_Machine_S_Clone] = new UIActionSimpleSelectorMachinePerformClone(this);
    2689     m_pool[UIActionIndexST_M_Machine_S_Export] = new UIActionSimpleSelectorMachinePerformExport(this);
    26902689    m_pool[UIActionIndexST_M_Machine_S_Move] = new UIActionSimpleSelectorMachinePerformMove(this);
     2690    m_pool[UIActionIndexST_M_Machine_S_ExportToOCI] = new UIActionSimpleSelectorMachinePerformExportToOCI(this);
    26912691    m_pool[UIActionIndexST_M_Machine_S_Remove] = new UIActionSimpleSelectorMachinePerformRemove(this);
    26922692    m_pool[UIActionIndexST_M_Machine_S_AddGroup] = new UIActionSimpleSelectorMachinePerformGroup(this);
     
    30323032    pMenu->addAction(action(UIActionIndexST_M_Machine_S_Settings));
    30333033    pMenu->addAction(action(UIActionIndexST_M_Machine_S_Clone));
    3034     pMenu->addAction(action(UIActionIndexST_M_Machine_S_Export));
    30353034    pMenu->addAction(action(UIActionIndexST_M_Machine_S_Move));
     3035    pMenu->addAction(action(UIActionIndexST_M_Machine_S_ExportToOCI));
    30363036    pMenu->addAction(action(UIActionIndexST_M_Machine_S_Remove));
    30373037    pMenu->addAction(action(UIActionIndexST_M_Machine_S_AddGroup));
     
    34033403                    << action(UIActionIndexST_M_Machine_S_Settings)
    34043404                    << action(UIActionIndexST_M_Machine_S_Clone)
    3405                     << action(UIActionIndexST_M_Machine_S_Export)
    34063405                    << action(UIActionIndexST_M_Machine_S_Move)
     3406                    << action(UIActionIndexST_M_Machine_S_ExportToOCI)
    34073407                    << action(UIActionIndexST_M_Machine_S_Remove)
    34083408                    << action(UIActionIndexST_M_Machine_S_AddGroup)
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.h

    r77297 r77305  
    9090    UIActionIndexST_M_Machine_S_Settings,
    9191    UIActionIndexST_M_Machine_S_Clone,
    92     UIActionIndexST_M_Machine_S_Export,
    9392    UIActionIndexST_M_Machine_S_Move,
     93    UIActionIndexST_M_Machine_S_ExportToOCI,
    9494    UIActionIndexST_M_Machine_S_Remove,
    9595    UIActionIndexST_M_Machine_S_AddGroup,
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp

    r77297 r77305  
    530530    /* Lock the action preventing cascade calls: */
    531531    actionPool()->action(UIActionIndexST_M_File_S_ExportAppliance)->setProperty("opened", true);
    532     actionPool()->action(UIActionIndexST_M_Machine_S_Export)->setProperty("opened", true);
     532    actionPool()->action(UIActionIndexST_M_Machine_S_ExportToOCI)->setProperty("opened", true);
    533533    updateActionsAppearance();
    534534
     
    540540    UISafePointerWizard pWizard = new UIWizardExportApp(pWizardParent, names,
    541541                                                        pAction &&
    542                                                         pAction == actionPool()->action(UIActionIndexST_M_Machine_S_Export));
     542                                                        pAction == actionPool()->action(UIActionIndexST_M_Machine_S_ExportToOCI));
    543543    windowManager().registerNewParent(pWizard, pWizardParent);
    544544    pWizard->prepare();
     
    550550    {
    551551        actionPool()->action(UIActionIndexST_M_File_S_ExportAppliance)->setProperty("opened", QVariant());
    552         actionPool()->action(UIActionIndexST_M_Machine_S_Export)->setProperty("opened", QVariant());
     552        actionPool()->action(UIActionIndexST_M_Machine_S_ExportToOCI)->setProperty("opened", QVariant());
    553553        updateActionsAppearance();
    554554    }
     
    14361436    connect(actionPool()->action(UIActionIndexST_M_Machine_S_Clone), &UIAction::triggered,
    14371437            this, &UIVirtualBoxManager::sltOpenCloneMachineWizard);
    1438     connect(actionPool()->action(UIActionIndexST_M_Machine_S_Export), &UIAction::triggered,
    1439             this, &UIVirtualBoxManager::sltOpenExportApplianceWizard);
    14401438    connect(actionPool()->action(UIActionIndexST_M_Machine_S_Move), &UIAction::triggered,
    14411439            this, &UIVirtualBoxManager::sltPerformMachineMove);
     1440    connect(actionPool()->action(UIActionIndexST_M_Machine_S_ExportToOCI), &UIAction::triggered,
     1441            this, &UIVirtualBoxManager::sltOpenExportApplianceWizard);
    14421442    connect(actionPool()->action(UIActionIndexST_M_Machine_M_StartOrShow), &UIAction::triggered,
    14431443            this, &UIVirtualBoxManager::sltPerformStartOrShowMachine);
     
    17211721    actionPool()->action(UIActionIndexST_M_Machine_S_Settings)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_S_Settings, items));
    17221722    actionPool()->action(UIActionIndexST_M_Machine_S_Clone)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_S_Clone, items));
    1723     actionPool()->action(UIActionIndexST_M_Machine_S_Export)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_S_Export, items));
    17241723    actionPool()->action(UIActionIndexST_M_Machine_S_Move)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_S_Move, items));
     1724    actionPool()->action(UIActionIndexST_M_Machine_S_ExportToOCI)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_S_ExportToOCI, items));
    17251725    actionPool()->action(UIActionIndexST_M_Machine_S_Remove)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_S_Remove, items));
    17261726    actionPool()->action(UIActionIndexST_M_Machine_S_AddGroup)->setEnabled(isActionEnabled(UIActionIndexST_M_Machine_S_AddGroup, items));
     
    18861886                   UIVirtualMachineItem::isItemEditable(pItem);
    18871887        }
    1888         case UIActionIndexST_M_Machine_S_Export:
     1888        case UIActionIndexST_M_Machine_S_ExportToOCI:
    18891889        {
    18901890            return !actionPool()->action(iActionIndex)->property("opened").toBool() &&
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp

    r77297 r77305  
    14141414        m_pContextMenuMachine->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Settings));
    14151415        m_pContextMenuMachine->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Clone));
    1416         m_pContextMenuMachine->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Export));
    14171416        m_pContextMenuMachine->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Move));
     1417        m_pContextMenuMachine->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_ExportToOCI));
    14181418        m_pContextMenuMachine->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Remove));
    14191419        m_pContextMenuMachine->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_AddGroup));
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportApp.cpp

    r77297 r77305  
    4040UIWizardExportApp::UIWizardExportApp(QWidget *pParent,
    4141                                     const QStringList &selectedVMNames /* = QStringList() */,
    42                                      bool fFastTraverToPage2 /* = false */)
     42                                     bool fFastTraverToExportOCI /* = false */)
    4343    : UIWizard(pParent, WizardType_ExportAppliance)
    4444    , m_selectedVMNames(selectedVMNames)
    45     , m_fFastTraverToPage2(fFastTraverToPage2)
     45    , m_fFastTraverToExportOCI(fFastTraverToExportOCI)
    4646{
    4747#ifndef VBOX_WS_MAC
     
    212212        {
    213213            setPage(Page1, new UIWizardExportAppPageBasic1(m_selectedVMNames));
    214             setPage(Page2, new UIWizardExportAppPageBasic2);
     214            setPage(Page2, new UIWizardExportAppPageBasic2(m_fFastTraverToExportOCI));
    215215            setPage(Page3, new UIWizardExportAppPageBasic3);
    216216            break;
     
    218218        case WizardMode_Expert:
    219219        {
    220             setPage(PageExpert, new UIWizardExportAppPageExpert(m_selectedVMNames));
     220            setPage(PageExpert, new UIWizardExportAppPageExpert(m_selectedVMNames, m_fFastTraverToExportOCI));
    221221            break;
    222222        }
     
    233233    /* Now, when we are ready, we can
    234234     * fast traver to page 2 if requested: */
    235     if (m_fFastTraverToPage2)
     235    if (m_fFastTraverToExportOCI)
    236236        button(QWizard::NextButton)->click();
    237237}
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportApp.h

    r77297 r77305  
    5151    /** Constructs export appliance wizard passing @a pParent to the base-class.
    5252      * @param  selectedVMNames  Brings the names of VMs to be exported. */
    53     UIWizardExportApp(QWidget *pParent, const QStringList &selectedVMNames = QStringList(), bool fFastTraverToPage2 = false);
     53    UIWizardExportApp(QWidget *pParent, const QStringList &selectedVMNames = QStringList(), bool fFastTraverToExportOCI = false);
    5454
    5555    /** Exports full appliance. */
     
    8484    QStringList  m_selectedVMNames;
    8585    /** Holds whether we should fast travel to page 2. */
    86     bool         m_fFastTraverToPage2;
     86    bool         m_fFastTraverToExportOCI;
    8787};
    8888
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic2.cpp

    r76606 r77305  
    5454*********************************************************************************************************************************/
    5555
    56 UIWizardExportAppPage2::UIWizardExportAppPage2()
    57     : m_pFormatLayout(0)
     56UIWizardExportAppPage2::UIWizardExportAppPage2(bool fExportToOCIByDefault)
     57    : m_fExportToOCIByDefault(fExportToOCIByDefault)
     58    , m_pFormatLayout(0)
    5859    , m_pSettingsLayout1(0)
    5960    , m_pSettingsLayout2(0)
     
    9394
    9495    /* Initialize Cloud Provider Manager: */
     96    bool fOCIPresent = false;
    9597    CVirtualBox comVBox = vboxGlobal().virtualBox();
    9698    m_comCloudProviderManager = comVBox.GetCloudProviderManager();
     
    120122                m_pFormatComboBox->setItemData(m_pFormatComboBox->count() - 1, comProvider.GetShortName(), FormatData_ShortName);
    121123                m_pFormatComboBox->setItemData(m_pFormatComboBox->count() - 1, true,                       FormatData_IsItCloudFormat);
     124                if (m_pFormatComboBox->itemData(m_pFormatComboBox->count() - 1, FormatData_ShortName).toString() == "OCI")
     125                    fOCIPresent = true;
    122126            }
    123127        }
     
    125129
    126130    /* Set default: */
    127     setFormat("ovf-1.0");
     131    if (m_fExportToOCIByDefault && fOCIPresent)
     132        setFormat("OCI");
     133    else
     134        setFormat("ovf-1.0");
    128135}
    129136
     
    733740*********************************************************************************************************************************/
    734741
    735 UIWizardExportAppPageBasic2::UIWizardExportAppPageBasic2()
    736     : m_pLabelFormat(0)
     742UIWizardExportAppPageBasic2::UIWizardExportAppPageBasic2(bool fExportToOCIByDefault)
     743    : UIWizardExportAppPage2(fExportToOCIByDefault)
     744    , m_pLabelFormat(0)
    737745    , m_pLabelSettings(0)
    738746{
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageBasic2.h

    r76581 r77305  
    8080
    8181    /** Constructs 2nd page base. */
    82     UIWizardExportAppPage2();
     82    UIWizardExportAppPage2(bool fExportToOCIByDefault);
    8383
    8484    /** Populates formats. */
     
    167167    AbstractVSDParameterList cloudClientParameters() const;
    168168
     169    /** Holds whether default format should be Export to OCI. */
     170    bool  m_fExportToOCIByDefault;
     171
    169172    /** Holds the Cloud Provider Manager reference. */
    170173    CCloudProviderManager     m_comCloudProviderManager;
     
    245248
    246249    /** Constructs 2nd basic page. */
    247     UIWizardExportAppPageBasic2();
     250    UIWizardExportAppPageBasic2(bool fExportToOCIByDefault);
    248251
    249252protected:
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.cpp

    r76606 r77305  
    4646*********************************************************************************************************************************/
    4747
    48 UIWizardExportAppPageExpert::UIWizardExportAppPageExpert(const QStringList &selectedVMNames)
    49     : m_pSelectorCnt(0)
     48UIWizardExportAppPageExpert::UIWizardExportAppPageExpert(const QStringList &selectedVMNames, bool fExportToOCIByDefault)
     49    : UIWizardExportAppPage2(fExportToOCIByDefault)
     50    , m_pSelectorCnt(0)
    5051    , m_pApplianceCnt(0)
    5152    , m_pSettingsCnt(0)
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIWizardExportAppPageExpert.h

    r76581 r77305  
    5555    /** Constructs expert basic page.
    5656      * @param  selectedVMNames  Brings the list of selected VM names. */
    57     UIWizardExportAppPageExpert(const QStringList &selectedVMNames);
     57    UIWizardExportAppPageExpert(const QStringList &selectedVMNames, bool fExportToOCIByDefault);
    5858
    5959protected:
Note: See TracChangeset for help on using the changeset viewer.

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