Changeset 84084 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Apr 29, 2020 2:15:52 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 137666
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp
r84083 r84084 50 50 , m_pSlidingAnimation(0) 51 51 , m_pPaneTools(0) 52 , m_fSingleGroupSelected(false) 52 , m_enmSelectionType(SelectionType_Invalid) 53 , m_fSelectedMachineItemAccessible(false) 53 54 { 54 55 prepare(); … … 257 258 } 258 259 259 /* If that wasmachine or group item selected: */260 /* Recache current item info if machine or group item selected: */ 260 261 if (isMachineItemSelected() || isGroupItemSelected()) 261 {262 /* Recache current item info: */263 262 recacheCurrentItemInformation(); 264 263 265 /* Update toolbar if we are switching beween single group item and rest of possible items: */ 266 if (m_fSingleGroupSelected != isSingleGroupSelected()) 267 updateToolbar(); 268 } 269 270 /* Remember whether single group item was selected: */ 271 m_fSingleGroupSelected = isSingleGroupSelected(); 264 /* Calculate selection type: */ 265 const SelectionType enmSelectedItemType = isSingleGroupSelected() 266 ? SelectionType_SingleGroupItem 267 : isGlobalItemSelected() 268 ? SelectionType_FirstIsGlobalItem 269 : isMachineItemSelected() 270 ? SelectionType_FirstIsMachineItem 271 : SelectionType_Invalid; 272 /* Acquire current item: */ 273 UIVirtualMachineItem *pItem = currentItem(); 274 const bool fCurrentItemIsOk = pItem && pItem->accessible(); 275 276 /* Update toolbar if selection type or item accessibility got changed: */ 277 if ( m_enmSelectionType != enmSelectedItemType 278 || m_fSelectedMachineItemAccessible != fCurrentItemIsOk) 279 updateToolbar(); 280 281 /* Remember the last selection type: */ 282 m_enmSelectionType = enmSelectedItemType; 283 /* Remember whether the last selected item was accessible: */ 284 m_fSelectedMachineItemAccessible = fCurrentItemIsOk; 272 285 } 273 286 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.h
r84083 r84084 46 46 { 47 47 Q_OBJECT; 48 49 /** Possible selection types. */ 50 enum SelectionType 51 { 52 SelectionType_Invalid, 53 SelectionType_SingleGroupItem, 54 SelectionType_FirstIsGlobalItem, 55 SelectionType_FirstIsMachineItem 56 }; 48 57 49 58 signals: … … 226 235 UITools *m_pPaneTools; 227 236 228 /** Holds whether last time single group item was selected exclusively. */ 229 bool m_fSingleGroupSelected; 237 /** Holds the last selection type. */ 238 SelectionType m_enmSelectionType; 239 /** Holds whether the last selected item was accessible. */ 240 bool m_fSelectedMachineItemAccessible; 230 241 }; 231 242
Note:
See TracChangeset
for help on using the changeset viewer.