Changeset 87101 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Dec 17, 2020 2:30:07 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp
r87022 r87101 2264 2264 }; 2265 2265 2266 /** Simple action extension, used as 'To Resources' action class. */ 2267 class UIActionMenuSelectorPerformanceToResources : public UIActionSimple 2268 { 2269 Q_OBJECT; 2270 2271 public: 2272 2273 /** Constructs action passing @a pParent to the base-class. */ 2274 UIActionMenuSelectorPerformanceToResources(UIActionPool *pParent) 2275 : UIActionSimple(pParent, 2276 ":/resources_monitor_24px.png", ":/resource_monitor_16px.png", 2277 ":/resource_monitor_disabled_24px.png", ":/resource_monitor_disabled_16px.png") 2278 { 2279 setShortcutContext(Qt::WidgetWithChildrenShortcut); 2280 } 2281 2282 protected: 2283 2284 /** Returns shortcut extra-data ID. */ 2285 virtual QString shortcutExtraDataID() const /* override */ 2286 { 2287 return QString("ToResources"); 2288 } 2289 2290 /** Handles translation event. */ 2291 virtual void retranslateUi() /* override */ 2292 { 2293 setName(QApplication::translate("UIActionPool", "&To Resurces...")); 2294 setShortcutScope(QApplication::translate("UIActionPool", "Performance Monitor")); 2295 setStatusTip(QApplication::translate("UIActionPool", "Navigate to the resources widget")); 2296 setToolTip( QApplication::translate("UIActionPool", "Navigate to Resources Widget") 2297 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString()))); 2298 } 2299 }; 2300 2266 2301 2267 2302 /********************************************************************************************************************************* … … 2509 2544 m_pool[UIActionIndex_M_Performance] = new UIActionMenuSelectorPerformance(this); 2510 2545 m_pool[UIActionIndex_M_Performance_S_Export] = new UIActionMenuSelectorPerformancePerformExport(this); 2546 m_pool[UIActionIndex_M_Performance_S_ToResources] = new UIActionMenuSelectorPerformanceToResources(this); 2511 2547 2512 2548 /* Create 'File Manager' actions: */ … … 2939 2975 /* 'Export' action: */ 2940 2976 pMenu->addAction(action(UIActionIndex_M_Performance_S_Export)); 2977 pMenu->addAction(action(UIActionIndex_M_Performance_S_ToResources)); 2941 2978 2942 2979 /* Mark menu as valid: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h
r85661 r87101 101 101 UIActionIndex_M_Performance, 102 102 UIActionIndex_M_Performance_S_Export, 103 UIActionIndex_M_Performance_S_ToResources, 103 104 104 105 /* File Manager actions: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.cpp
r87022 r87101 208 208 m_pLayout->setCurrentWidget(m_pPanePerformanceMonitor); 209 209 210 connect(m_pPanePerformanceMonitor, &UIPerformanceMonitor::sigSwitchToResourcesPane, 211 this, &UIToolPaneMachine::sigSwitchToResourcesPane); 210 212 break; 211 213 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolPaneMachine.h
r87022 r87101 61 61 /** Notifies listeners about current Snapshot pane item change. */ 62 62 void sigCurrentSnapshotItemChange(); 63 64 /** Notifies listeners about request to switch to Resources pane. */ 65 void sigSwitchToResourcesPane(); 63 66 64 67 public: -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp
r87022 r87101 508 508 } 509 509 510 void UIVirtualBoxManagerWidget::sltSwitchToResourcesPane() 511 { 512 AssertPtrReturnVoid(m_pPaneTools); 513 m_pPaneToolsGlobal->setActive(true); 514 switchToGlobalTool(UIToolType_Resources); 515 m_pPaneTools->setToolsType(UIToolType_Resources); 516 } 517 510 518 void UIVirtualBoxManagerWidget::prepare() 511 519 { … … 618 626 connect(m_pPaneToolsMachine, &UIToolPaneMachine::sigCurrentSnapshotItemChange, 619 627 this, &UIVirtualBoxManagerWidget::sigCurrentSnapshotItemChange); 628 connect(m_pPaneToolsMachine, &UIToolPaneMachine::sigSwitchToResourcesPane, 629 this, &UIVirtualBoxManagerWidget::sltSwitchToResourcesPane); 620 630 621 631 /* Add into stack: */ … … 901 911 { 902 912 m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_Performance_S_Export)); 913 m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_Performance_S_ToResources)); 903 914 m_pToolBar->addSeparator(); 904 915 m_pToolBar->addAction(actionPool()->action(UIActionIndexMN_M_Machine_S_Settings)); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.h
r87022 r87101 271 271 /** Handles signal requesting switch to Performance pane of machine with @a uMachineId. */ 272 272 void sltSwitchToMachinePerformancePane(const QUuid &uMachineId); 273 /** Handles signal requesting switch to Resources pane. */ 274 void sltSwitchToResourcesPane(); 273 275 /** @} */ 274 276 -
trunk/src/VBox/Frontends/VirtualBox/src/monitor/performance/UIPerformanceMonitor.cpp
r86233 r87101 1096 1096 void UIPerformanceMonitor::prepareActions() 1097 1097 { 1098 QAction *p Action =1098 QAction *pExportAction = 1099 1099 m_pActionPool->action(UIActionIndex_M_Performance_S_Export); 1100 if (pAction) 1101 connect(pAction, &QAction::triggered, this, &UIPerformanceMonitor::sltExportMetricsToFile); 1100 if (pExportAction) 1101 connect(pExportAction, &QAction::triggered, this, &UIPerformanceMonitor::sltExportMetricsToFile); 1102 1103 QAction *pToResourcesAction = 1104 m_pActionPool->action(UIActionIndex_M_Performance_S_ToResources); 1105 if (pToResourcesAction) 1106 connect(pToResourcesAction, &QAction::triggered, this, &UIPerformanceMonitor::sigSwitchToResourcesPane); 1102 1107 } 1103 1108 -
trunk/src/VBox/Frontends/VirtualBox/src/monitor/performance/UIPerformanceMonitor.h
r86233 r87101 111 111 { 112 112 Q_OBJECT; 113 114 signals: 115 116 void sigSwitchToResourcesPane(); 113 117 114 118 public:
Note:
See TracChangeset
for help on using the changeset viewer.