Changeset 102743 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jan 2, 2024 3:33:52 PM (12 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp
r102723 r102743 519 519 /* If Error-pane is chosen currently => open tool currently chosen in Tools-pane: */ 520 520 if (m_pPaneToolsMachine->currentTool() == UIToolType_Error) 521 sltHandle ToolsPaneIndexChange();521 sltHandleMachineToolsPaneIndexChange(); 522 522 523 523 /* If we still have same item selected: */ … … 574 574 } 575 575 576 void UIVirtualBoxManagerWidget::sltHandleToolsPaneIndexChange() 577 { 578 /* Determine sender: */ 579 UITools *pMenu = qobject_cast<UITools*>(sender()); 580 if (!pMenu) 581 pMenu = m_pMenuToolsMachine; 582 583 /* Acquire current class/type: */ 584 UIToolClass enmCurrentClass = UIToolClass_Invalid; 585 if (pMenu == m_pMenuToolsGlobal) 586 enmCurrentClass = UIToolClass_Global; 587 else if (pMenu == m_pMenuToolsMachine) 588 enmCurrentClass = UIToolClass_Machine; 589 AssertReturnVoid(enmCurrentClass != UIToolClass_Invalid); 590 const UIToolType enmCurrentType = pMenu->toolsType(); 591 592 /* Invent default for fallback case: */ 593 const UIToolType enmDefaultType = enmCurrentClass == UIToolClass_Global ? UIToolType_Welcome 594 : enmCurrentClass == UIToolClass_Machine ? UIToolType_Details 595 : UIToolType_Invalid; 596 AssertReturnVoid(enmDefaultType != UIToolType_Invalid); 597 598 /* Calculate new type to choose: */ 599 const UIToolType enmNewType = UIToolStuff::isTypeOfClass(enmCurrentType, enmCurrentClass) 600 ? enmCurrentType : enmDefaultType; 601 602 /* Choose new type: */ 603 switch (enmCurrentClass) 604 { 605 case UIToolClass_Global: switchToGlobalTool(enmNewType); break; 606 case UIToolClass_Machine: switchToMachineTool(enmNewType); break; 607 default: break; 608 } 576 void UIVirtualBoxManagerWidget::sltHandleGlobalToolsPaneIndexChange() 577 { 578 switchToGlobalTool(m_pMenuToolsGlobal->toolsType()); 579 } 580 581 void UIVirtualBoxManagerWidget::sltHandleMachineToolsPaneIndexChange() 582 { 583 switchToMachineTool(m_pMenuToolsMachine->toolsType()); 609 584 } 610 585 … … 845 820 /* Tools-pane connections: */ 846 821 connect(m_pMenuToolsGlobal, &UITools::sigSelectionChanged, 847 this, &UIVirtualBoxManagerWidget::sltHandle ToolsPaneIndexChange);822 this, &UIVirtualBoxManagerWidget::sltHandleGlobalToolsPaneIndexChange); 848 823 connect(m_pMenuToolsMachine, &UITools::sigSelectionChanged, 849 this, &UIVirtualBoxManagerWidget::sltHandle ToolsPaneIndexChange);824 this, &UIVirtualBoxManagerWidget::sltHandleMachineToolsPaneIndexChange); 850 825 } 851 826 … … 1099 1074 /* Tools-pane connections: */ 1100 1075 disconnect(m_pMenuToolsGlobal, &UITools::sigSelectionChanged, 1101 this, &UIVirtualBoxManagerWidget::sltHandle ToolsPaneIndexChange);1076 this, &UIVirtualBoxManagerWidget::sltHandleGlobalToolsPaneIndexChange); 1102 1077 disconnect(m_pMenuToolsMachine, &UITools::sigSelectionChanged, 1103 this, &UIVirtualBoxManagerWidget::sltHandle ToolsPaneIndexChange);1078 this, &UIVirtualBoxManagerWidget::sltHandleMachineToolsPaneIndexChange); 1104 1079 } 1105 1080 … … 1177 1152 /* If Error-pane is chosen currently => open tool currently chosen in Tools-pane: */ 1178 1153 if (m_pPaneToolsMachine->currentTool() == UIToolType_Error) 1179 sltHandle ToolsPaneIndexChange();1154 sltHandleMachineToolsPaneIndexChange(); 1180 1155 1181 1156 /* Propagate current items to the Tools pane: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.h
r102723 r102743 324 324 void sltHandleToolMenuRequested(const QPoint &position, UIVirtualMachineItem *pItem); 325 325 326 /** Handles signal about Tools-pane index change. */ 327 void sltHandleToolsPaneIndexChange(); 326 /** Handles signal about global Tools-pane index change. */ 327 void sltHandleGlobalToolsPaneIndexChange(); 328 /** Handles signal about machine Tools-pane index change. */ 329 void sltHandleMachineToolsPaneIndexChange(); 328 330 329 331 /** Handles signal requesting switch to Activity pane of machine with @a uMachineId. */
Note:
See TracChangeset
for help on using the changeset viewer.