Changeset 68199 in vbox
- Timestamp:
- Jul 31, 2017 12:32:17 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 117296
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/selector
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp
r68175 r68199 206 206 UIVMItem *pItem = currentItem(); 207 207 208 /* Determine which menu to show: */ 209 m_pGroupMenuAction->setVisible(m_pPaneChooser->isSingleGroupSelected()); 210 m_pMachineMenuAction->setVisible(!m_pPaneChooser->isSingleGroupSelected()); 211 if (m_pGroupMenuAction->isVisible()) 212 { 213 foreach (UIAction *pAction, m_machineActions) 214 pAction->hideShortcut(); 215 foreach (UIAction *pAction, m_groupActions) 216 pAction->showShortcut(); 217 } 218 else if (m_pMachineMenuAction->isVisible()) 219 { 220 foreach (UIAction *pAction, m_groupActions) 221 pAction->hideShortcut(); 222 foreach (UIAction *pAction, m_machineActions) 223 pAction->showShortcut(); 224 } 225 208 /* Update action visibility: */ 209 updateActionsVisibility(); 226 210 /* Update action appearance: */ 227 211 updateActionsAppearance(); … … 1699 1683 m_pToolBar->setContextMenuPolicy(Qt::CustomContextMenu); 1700 1684 m_pToolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); 1701 // TODO: Get r ed of hard-coded stuff:1685 // TODO: Get rid of hard-coded stuff: 1702 1686 const QSize toolBarIconSize = m_pToolBar->iconSize(); 1703 1687 if (toolBarIconSize.width() < 32 || toolBarIconSize.height() < 32) … … 1931 1915 connect(m_pPaneToolsMachine, SIGNAL(sigLinkClicked(const QString&, const QString&, const QString&)), 1932 1916 this, SLOT(sltOpenMachineSettingsDialog(const QString&, const QString&, const QString&))); 1933 1934 1917 1935 1918 /* Global event handlers: */ … … 2085 2068 vboxGlobal().launchMachine(machine, enmItemLaunchMode); 2086 2069 } 2070 } 2071 2072 void UISelectorWindow::updateActionsVisibility() 2073 { 2074 /* Determine whether Machine or Group menu should be shown at all: */ 2075 const bool fMachineMenuShown = !m_pPaneChooser->isSingleGroupSelected(); 2076 m_pMachineMenuAction->setVisible(fMachineMenuShown); 2077 m_pGroupMenuAction->setVisible(!fMachineMenuShown); 2078 2079 /* Hide action shortcuts: */ 2080 if (!fMachineMenuShown) 2081 foreach (UIAction *pAction, m_machineActions) 2082 pAction->hideShortcut(); 2083 if (fMachineMenuShown) 2084 foreach (UIAction *pAction, m_groupActions) 2085 pAction->hideShortcut(); 2086 2087 /* Show what should be shown: */ 2088 if (fMachineMenuShown) 2089 foreach (UIAction *pAction, m_machineActions) 2090 pAction->showShortcut(); 2091 if (!fMachineMenuShown) 2092 foreach (UIAction *pAction, m_groupActions) 2093 pAction->showShortcut(); 2087 2094 } 2088 2095 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.h
r68175 r68199 267 267 /** @name Action update stuff. 268 268 * @{ */ 269 /** Performs update of actions visibility. */ 270 void updateActionsVisibility(); 269 271 /** Performs update of actions appearance. */ 270 272 void updateActionsAppearance(); … … 325 327 /** Holds the Chooser-pane instance. */ 326 328 UIGChooser *m_pPaneChooser; 327 /** Holds the Tools-pane instance. */329 /** Holds the Machine Tools-pane instance. */ 328 330 UIToolsPaneMachine *m_pPaneToolsMachine; 329 331
Note:
See TracChangeset
for help on using the changeset viewer.