Changeset 83023 in vbox
- Timestamp:
- Feb 7, 2020 5:06:29 PM (5 years ago)
- 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 89 89 } 90 90 91 void UITools::setRestrictedToolTypes(const QList<UIToolType> &types) 92 { 93 m_pToolsModel->setRestrictedToolTypes(types); 94 } 95 96 QList<UIToolType> UITools::restrictedToolTypes() const 97 { 98 return m_pToolsModel->restrictedToolTypes(); 99 } 100 91 101 UIToolsItem *UITools::currentItem() const 92 102 { -
trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UITools.h
r82968 r83023 93 93 /** Returns whether certain class of tools is enabled.*/ 94 94 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; 95 100 /** @} */ 96 101 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsModel.cpp
r82968 r83023 54 54 55 55 56 UIToolsModel:: 56 UIToolsModel::UIToolsModel(UITools *pParent) 57 57 : QIWithRetranslateUI3<QObject>(pParent) 58 58 , m_pTools(pParent) … … 175 175 { 176 176 return m_statesToolsEnabled.value(enmClass); 177 } 178 179 void 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 192 QList<UIToolType> UIToolsModel::restrictedToolTypes() const 193 { 194 return m_restrictedToolTypes; 177 195 } 178 196 … … 332 350 { 333 351 /* Hide/skip unrelated items: */ 334 if (pItem->itemClass() != m_enmCurrentClass) 352 if ( pItem->itemClass() != m_enmCurrentClass 353 || m_restrictedToolTypes.contains(pItem->itemType())) 335 354 { 336 355 pItem->hide(); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/tools/UIToolsModel.h
r82968 r83023 120 120 /** Returns whether certain class of tools is enabled.*/ 121 121 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; 122 127 123 128 /** Closes parent. */ … … 264 269 /** Holds whether tools of particular class are enabled. */ 265 270 QMap<UIToolClass, bool> m_statesToolsEnabled; 271 272 /** Holds a list of restricted tool types. */ 273 QList<UIToolType> m_restrictedToolTypes; 266 274 /** @} */ 267 275
Note:
See TracChangeset
for help on using the changeset viewer.