VirtualBox

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


Ignore:
Timestamp:
Dec 10, 2024 2:59:20 PM (5 weeks ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10814: VBox Manager: Make sure Manager isn't aware of global item concept which only Manager widget should know about; That is necessary to be able to implement another widget working different way.

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

Legend:

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

    r107277 r107279  
    11801180    AssertReturnVoid(enmType != UIToolType_Invalid);
    11811181
    1182     /* Make sure global item is selected: */
    1183     m_pWidget->switchToGlobalItem();
    1184 
    11851182    /* Open the tool finally: */
    1186     m_pWidget->setToolsTypeGlobal(enmType);
     1183    m_pWidget->setToolsTypeGlobal(enmType, true /* make sure it's visible */);
    11871184}
    11881185
     
    13001297    UIVirtualMachineItem *pItem = currentItem();
    13011298
    1302     /* For global item or local machine: */
    1303     if (   !pItem
    1304         || pItem->itemType() == UIVirtualMachineItemType_Local)
     1299    /* If there is no items at all or first selected item is a local machine: */
     1300    if (!pItem || pItem->itemType() == UIVirtualMachineItemType_Local)
    13051301        openNewMachineWizard();
    1306     /* For cloud machine: */
     1302    /* Otherwise we guess it's cloud related item selected: */
    13071303    else
    13081304        sltOpenWizard(WizardType_NewCloudVM);
     
    13141310    UIVirtualMachineItem *pItem = currentItem();
    13151311
    1316     /* For global item or local machine: */
    1317     if (   !pItem
    1318         || pItem->itemType() == UIVirtualMachineItemType_Local)
     1312    /* If there is no items at all or first selected item is a local machine: */
     1313    if (!pItem || pItem->itemType() == UIVirtualMachineItemType_Local)
    13191314        openAddMachineDialog();
    1320     /* For cloud machine: */
     1315    /* Otherwise we guess it's cloud related item selected: */
    13211316    else
    13221317        sltOpenWizard(WizardType_AddCloudVM);
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp

    r107275 r107279  
    199199}
    200200
    201 void UIVirtualBoxManagerWidget::switchToGlobalItem()
    202 {
    203     AssertPtrReturnVoid(m_pPaneChooser);
    204     m_pPaneChooser->setCurrentGlobal();
    205 }
    206 
    207201void UIVirtualBoxManagerWidget::openGroupNameEditor()
    208202{
     
    250244}
    251245
    252 void UIVirtualBoxManagerWidget::setToolsTypeGlobal(UIToolType enmType)
    253 {
     246void UIVirtualBoxManagerWidget::setToolsTypeGlobal(UIToolType enmType, bool fMakeSureItsVisible /* = false */)
     247{
     248    /* Make sure global item is selected if requested: */
     249    if (fMakeSureItsVisible)
     250    {
     251        AssertPtrReturnVoid(m_pPaneChooser);
     252        m_pPaneChooser->setCurrentGlobal();
     253    }
     254
     255    /* Change the tool to requested type: */
     256    AssertPtrReturnVoid(m_pMenuToolsGlobal);
    254257    m_pMenuToolsGlobal->setToolsType(enmType);
    255258}
     
    262265void UIVirtualBoxManagerWidget::setToolsTypeMachine(UIToolType enmType)
    263266{
     267    /* Change the tool to requested type: */
     268    AssertPtrReturnVoid(m_pMenuToolsMachine);
    264269    m_pMenuToolsMachine->setToolsType(enmType);
    265270}
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.h

    r107275 r107279  
    191191        bool isCloudProfileUpdateInProgress() const;
    192192
    193         /** Switches to global item. */
    194         void switchToGlobalItem();
    195193        /** Opens group name editor. */
    196194        void openGroupNameEditor();
     
    215213    /** @name Tools pane stuff.
    216214      * @{ */
    217         /** Defines Global tools @a enmType. */
    218         void setToolsTypeGlobal(UIToolType enmType);
     215        /** Defines Global tools @a enmType and @a fMakeSureItsVisible if requested. */
     216        void setToolsTypeGlobal(UIToolType enmType, bool fMakeSureItsVisible = false);
    219217        /** Returns Global tools type. */
    220218        UIToolType toolsTypeGlobal() const;
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