Changeset 108153 in vbox
- Timestamp:
- Feb 11, 2025 11:38:51 AM (10 days ago)
- svn:sync-xref-src-repo-rev:
- 167464
- 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 3416 3416 { 3417 3417 /* 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); 3422 3423 actionPool()->action(UIActionIndexMN_M_Group)->setVisible(fGroupMenuShown); 3423 3424 actionPool()->action(UIActionIndexMN_M_Machine)->setVisible(fMachineMenuShown); 3424 3425 3425 3426 /* Determine whether Extensions menu should be visible: */ 3426 const bool fExtensionsMenuShown = fGlobal MenuShown && m_pWidget->currentGlobalTool() == UIToolType_Extensions;3427 const bool fExtensionsMenuShown = fGlobalToolShown && m_pWidget->currentGlobalTool() == UIToolType_Extensions; 3427 3428 actionPool()->action(UIActionIndexMN_M_Extension)->setVisible(fExtensionsMenuShown); 3428 3429 /* Determine whether Media menu should be visible: */ 3429 const bool fMediumMenuShown = fGlobal MenuShown && m_pWidget->currentGlobalTool() == UIToolType_Media;3430 const bool fMediumMenuShown = fGlobalToolShown && m_pWidget->currentGlobalTool() == UIToolType_Media; 3430 3431 actionPool()->action(UIActionIndexMN_M_Medium)->setVisible(fMediumMenuShown); 3431 3432 /* Determine whether Network menu should be visible: */ 3432 const bool fNetworkMenuShown = fGlobal MenuShown && m_pWidget->currentGlobalTool() == UIToolType_Network;3433 const bool fNetworkMenuShown = fGlobalToolShown && m_pWidget->currentGlobalTool() == UIToolType_Network; 3433 3434 actionPool()->action(UIActionIndexMN_M_Network)->setVisible(fNetworkMenuShown); 3434 3435 /* Determine whether Cloud menu should be visible: */ 3435 const bool fCloudMenuShown = fGlobal MenuShown && m_pWidget->currentGlobalTool() == UIToolType_Cloud;3436 const bool fCloudMenuShown = fGlobalToolShown && m_pWidget->currentGlobalTool() == UIToolType_Cloud; 3436 3437 actionPool()->action(UIActionIndexMN_M_Cloud)->setVisible(fCloudMenuShown); 3437 3438 /* Determine whether Activities menu should be visible: */ 3438 const bool fResourcesMenuShown = fGlobal MenuShown && m_pWidget->currentGlobalTool() == UIToolType_Activities;3439 const bool fResourcesMenuShown = fGlobalToolShown && m_pWidget->currentGlobalTool() == UIToolType_Activities; 3439 3440 actionPool()->action(UIActionIndexMN_M_VMActivityOverview)->setVisible(fResourcesMenuShown); 3440 3441 … … 3457 3458 3458 3459 /* Hide action shortcuts: */ 3459 if (!fGlobal MenuShown)3460 if (!fGlobalToolShown) 3460 3461 actionPool()->setShortcutsVisible(UIActionIndexMN_M_Home, false); 3461 3462 if (!fGroupMenuShown) … … 3465 3466 3466 3467 /* Show action shortcuts: */ 3467 if (fGlobal MenuShown)3468 if (fGlobalToolShown) 3468 3469 actionPool()->setShortcutsVisible(UIActionIndexMN_M_Home, true); 3469 3470 if (fGroupMenuShown) -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerAdvancedWidget.cpp
r108137 r108153 95 95 AssertPtrReturn(chooser(), false); 96 96 return chooser()->isGroupItemSelected(); 97 }98 99 bool UIVirtualBoxManagerAdvancedWidget::isGlobalItemSelected() const100 {101 AssertPtrReturn(chooser(), false);102 return chooser()->isGlobalItemSelected();103 97 } 104 98 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerAdvancedWidget.h
r107359 r108153 137 137 /** Returns whether group item is selected. */ 138 138 bool isGroupItemSelected() const; 139 /** Returns whether global item is selected. */140 bool isGlobalItemSelected() const;141 139 /** Returns whether machine item is selected. */ 142 140 bool isMachineItemSelected() const; -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooser.cpp
r107299 r108153 90 90 AssertPtrReturn(model(), false); 91 91 return model()->isGroupItemSelected(); 92 }93 94 bool UIChooser::isGlobalItemSelected() const95 {96 AssertPtrReturn(model(), false);97 return model()->isGlobalItemSelected();98 92 } 99 93 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooser.h
r107299 r108153 146 146 /** Returns whether group item is selected. */ 147 147 bool isGroupItemSelected() const; 148 /** Returns whether global item is selected. */149 bool isGlobalItemSelected() const;150 148 /** Returns whether machine item is selected. */ 151 149 bool isMachineItemSelected() const; -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.cpp
r108147 r108153 285 285 { 286 286 return firstSelectedItem() && firstSelectedItem()->type() == UIChooserNodeType_Group; 287 }288 289 bool UIChooserModel::isGlobalItemSelected() const290 {291 return firstSelectedItem() && firstSelectedItem()->type() == UIChooserNodeType_Global;292 287 } 293 288 -
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserModel.h
r108147 r108153 151 151 /** Returns whether group item is selected. */ 152 152 bool isGroupItemSelected() const; 153 /** Returns whether global item is selected. */154 bool isGlobalItemSelected() const;155 153 /** Returns whether machine item is selected. */ 156 154 bool isMachineItemSelected() const;
Note:
See TracChangeset
for help on using the changeset viewer.