VirtualBox

Changeset 108153 in vbox


Ignore:
Timestamp:
Feb 11, 2025 11:38:51 AM (10 days ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
167464
Message:

FE/Qt: bugref:10814: VBox Manager: Replace obsolete meaning of global item selected with global tool selected; That should fix the menu shown for various tools.

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

Legend:

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

    r108138 r108153  
    34163416{
    34173417    /* Determine whether Machine or Group menu should be shown at all: */
    3418     const bool fGlobalMenuShown  = m_pWidget->isGlobalItemSelected();
    3419     const bool fGroupMenuShown   = m_pWidget->isGroupItemSelected()   &&  isSingleGroupSelected();
    3420     const bool fMachineMenuShown = m_pWidget->isMachineItemSelected() && !isSingleGroupSelected();
    3421     actionPool()->action(UIActionIndexMN_M_Home)->setVisible(fGlobalMenuShown);
     3418    const bool fMachinesToolShown  = m_pWidget->currentGlobalTool() == UIToolType_Machines;
     3419    const bool fGlobalToolShown    = !fMachinesToolShown;
     3420    const bool fGroupMenuShown   = fMachinesToolShown && m_pWidget->isGroupItemSelected() && isSingleGroupSelected();
     3421    const bool fMachineMenuShown = fMachinesToolShown && m_pWidget->isMachineItemSelected() && !isSingleGroupSelected();
     3422    actionPool()->action(UIActionIndexMN_M_Home)->setVisible(fGlobalToolShown);
    34223423    actionPool()->action(UIActionIndexMN_M_Group)->setVisible(fGroupMenuShown);
    34233424    actionPool()->action(UIActionIndexMN_M_Machine)->setVisible(fMachineMenuShown);
    34243425
    34253426    /* Determine whether Extensions menu should be visible: */
    3426     const bool fExtensionsMenuShown = fGlobalMenuShown && m_pWidget->currentGlobalTool() == UIToolType_Extensions;
     3427    const bool fExtensionsMenuShown = fGlobalToolShown && m_pWidget->currentGlobalTool() == UIToolType_Extensions;
    34273428    actionPool()->action(UIActionIndexMN_M_Extension)->setVisible(fExtensionsMenuShown);
    34283429    /* Determine whether Media menu should be visible: */
    3429     const bool fMediumMenuShown = fGlobalMenuShown && m_pWidget->currentGlobalTool() == UIToolType_Media;
     3430    const bool fMediumMenuShown = fGlobalToolShown && m_pWidget->currentGlobalTool() == UIToolType_Media;
    34303431    actionPool()->action(UIActionIndexMN_M_Medium)->setVisible(fMediumMenuShown);
    34313432    /* Determine whether Network menu should be visible: */
    3432     const bool fNetworkMenuShown = fGlobalMenuShown && m_pWidget->currentGlobalTool() == UIToolType_Network;
     3433    const bool fNetworkMenuShown = fGlobalToolShown && m_pWidget->currentGlobalTool() == UIToolType_Network;
    34333434    actionPool()->action(UIActionIndexMN_M_Network)->setVisible(fNetworkMenuShown);
    34343435    /* Determine whether Cloud menu should be visible: */
    3435     const bool fCloudMenuShown = fGlobalMenuShown && m_pWidget->currentGlobalTool() == UIToolType_Cloud;
     3436    const bool fCloudMenuShown = fGlobalToolShown && m_pWidget->currentGlobalTool() == UIToolType_Cloud;
    34363437    actionPool()->action(UIActionIndexMN_M_Cloud)->setVisible(fCloudMenuShown);
    34373438    /* Determine whether Activities menu should be visible: */
    3438     const bool fResourcesMenuShown = fGlobalMenuShown && m_pWidget->currentGlobalTool() == UIToolType_Activities;
     3439    const bool fResourcesMenuShown = fGlobalToolShown && m_pWidget->currentGlobalTool() == UIToolType_Activities;
    34393440    actionPool()->action(UIActionIndexMN_M_VMActivityOverview)->setVisible(fResourcesMenuShown);
    34403441
     
    34573458
    34583459    /* Hide action shortcuts: */
    3459     if (!fGlobalMenuShown)
     3460    if (!fGlobalToolShown)
    34603461        actionPool()->setShortcutsVisible(UIActionIndexMN_M_Home, false);
    34613462    if (!fGroupMenuShown)
     
    34653466
    34663467    /* Show action shortcuts: */
    3467     if (fGlobalMenuShown)
     3468    if (fGlobalToolShown)
    34683469        actionPool()->setShortcutsVisible(UIActionIndexMN_M_Home, true);
    34693470    if (fGroupMenuShown)
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerAdvancedWidget.cpp

    r108137 r108153  
    9595    AssertPtrReturn(chooser(), false);
    9696    return chooser()->isGroupItemSelected();
    97 }
    98 
    99 bool UIVirtualBoxManagerAdvancedWidget::isGlobalItemSelected() const
    100 {
    101     AssertPtrReturn(chooser(), false);
    102     return chooser()->isGlobalItemSelected();
    10397}
    10498
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerAdvancedWidget.h

    r107359 r108153  
    137137        /** Returns whether group item is selected. */
    138138        bool isGroupItemSelected() const;
    139         /** Returns whether global item is selected. */
    140         bool isGlobalItemSelected() const;
    141139        /** Returns whether machine item is selected. */
    142140        bool isMachineItemSelected() const;
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooser.cpp

    r107299 r108153  
    9090    AssertPtrReturn(model(), false);
    9191    return model()->isGroupItemSelected();
    92 }
    93 
    94 bool UIChooser::isGlobalItemSelected() const
    95 {
    96     AssertPtrReturn(model(), false);
    97     return model()->isGlobalItemSelected();
    9892}
    9993
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooser.h

    r107299 r108153  
    146146        /** Returns whether group item is selected. */
    147147        bool isGroupItemSelected() const;
    148         /** Returns whether global item is selected. */
    149         bool isGlobalItemSelected() const;
    150148        /** Returns whether machine item is selected. */
    151149        bool isMachineItemSelected() const;
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp

    r108147 r108153  
    285285{
    286286    return firstSelectedItem() && firstSelectedItem()->type() == UIChooserNodeType_Group;
    287 }
    288 
    289 bool UIChooserModel::isGlobalItemSelected() const
    290 {
    291     return firstSelectedItem() && firstSelectedItem()->type() == UIChooserNodeType_Global;
    292287}
    293288
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.h

    r108147 r108153  
    151151        /** Returns whether group item is selected. */
    152152        bool isGroupItemSelected() const;
    153         /** Returns whether global item is selected. */
    154         bool isGlobalItemSelected() const;
    155153        /** Returns whether machine item is selected. */
    156154        bool isMachineItemSelected() 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