VirtualBox

Changeset 83023 in vbox


Ignore:
Timestamp:
Feb 7, 2020 5:06:29 PM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9653: VirtualBox Manager: Details pane: A possibility to hide unwanted tools.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/manager/tools
Files:
4 edited

Legend:

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

    r82968 r83023  
    8989}
    9090
     91void UITools::setRestrictedToolTypes(const QList<UIToolType> &types)
     92{
     93    m_pToolsModel->setRestrictedToolTypes(types);
     94}
     95
     96QList<UIToolType> UITools::restrictedToolTypes() const
     97{
     98    return m_pToolsModel->restrictedToolTypes();
     99}
     100
    91101UIToolsItem *UITools::currentItem() const
    92102{
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UITools.h

    r82968 r83023  
    9393        /** Returns whether certain class of tools is enabled.*/
    9494        bool areToolsEnabled(UIToolClass enmClass) const;
     95
     96        /** Defines restructed tool @a types. */
     97        void setRestrictedToolTypes(const QList<UIToolType> &types);
     98        /** Returns restricted tool types. */
     99        QList<UIToolType> restrictedToolTypes() const;
    95100    /** @} */
    96101
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsModel.cpp

    r82968 r83023  
    5454
    5555
    56 UIToolsModel:: UIToolsModel(UITools *pParent)
     56UIToolsModel::UIToolsModel(UITools *pParent)
    5757    : QIWithRetranslateUI3<QObject>(pParent)
    5858    , m_pTools(pParent)
     
    175175{
    176176    return m_statesToolsEnabled.value(enmClass);
     177}
     178
     179void UIToolsModel::setRestrictedToolTypes(const QList<UIToolType> &types)
     180{
     181    /* Update linked values: */
     182    if (m_restrictedToolTypes != types)
     183    {
     184        m_restrictedToolTypes = types;
     185        updateLayout();
     186        updateNavigation();
     187        sltItemMinimumWidthHintChanged();
     188        sltItemMinimumHeightHintChanged();
     189    }
     190}
     191
     192QList<UIToolType> UIToolsModel::restrictedToolTypes() const
     193{
     194    return m_restrictedToolTypes;
    177195}
    178196
     
    332350    {
    333351        /* Hide/skip unrelated items: */
    334         if (pItem->itemClass() != m_enmCurrentClass)
     352        if (   pItem->itemClass() != m_enmCurrentClass
     353            || m_restrictedToolTypes.contains(pItem->itemType()))
    335354        {
    336355            pItem->hide();
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsModel.h

    r82968 r83023  
    120120        /** Returns whether certain class of tools is enabled.*/
    121121        bool areToolsEnabled(UIToolClass enmClass) const;
     122
     123        /** Defines restructed tool @a types. */
     124        void setRestrictedToolTypes(const QList<UIToolType> &types);
     125        /** Returns restricted tool types. */
     126        QList<UIToolType> restrictedToolTypes() const;
    122127
    123128        /** Closes parent. */
     
    264269        /** Holds whether tools of particular class are enabled. */
    265270        QMap<UIToolClass, bool>  m_statesToolsEnabled;
     271
     272        /** Holds a list of restricted tool types. */
     273        QList<UIToolType>  m_restrictedToolTypes;
    266274    /** @} */
    267275
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