Changeset 85434 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jul 23, 2020 1:33:01 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp
r85426 r85434 2248 2248 setStatusTip(QApplication::translate("UIActionPool", "Show the properties of currently selected file object(s)")); 2249 2249 setToolTip( QApplication::translate("UIActionPool", "Show Properties of Current Object(s)") 2250 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));2251 }2252 };2253 2254 /** Menu action extension, used as 'Performance' menu class. */2255 class UIActionMenuPerformanceMonitor : public UIActionMenu2256 {2257 Q_OBJECT;2258 2259 public:2260 2261 /** Constructs action passing @a pParent to the base-class. */2262 UIActionMenuPerformanceMonitor(UIActionPool *pParent)2263 : UIActionMenu(pParent)2264 {}2265 2266 protected:2267 2268 /** Returns shortcut extra-data ID. */2269 virtual QString shortcutExtraDataID() const /* override */2270 {2271 return QString("PerformanceMonitorMenu");2272 }2273 2274 /** Handles translation event. */2275 virtual void retranslateUi() /* override */2276 {2277 setName(QApplication::translate("UIActionPool", "Performance"));2278 }2279 };2280 2281 /** Simple action extension, used as 'Export' action class. */2282 class UIActionMenuPerformanceMonitorExport : public UIActionSimple2283 {2284 Q_OBJECT;2285 2286 public:2287 2288 /** Constructs action passing @a pParent to the base-class. */2289 UIActionMenuPerformanceMonitorExport(UIActionPool *pParent)2290 : UIActionSimple(pParent,2291 ":/log_viewer_save_32px.png", ":/log_viewer_save_16px.png",2292 ":/log_viewer_save_disabled_32px.png", ":/log_viewer_save_disabled_16px.png")2293 {2294 setShortcutContext(Qt::WidgetWithChildrenShortcut);2295 }2296 2297 protected:2298 2299 /** Returns shortcut extra-data ID. */2300 virtual QString shortcutExtraDataID() const /* override */2301 {2302 return QString("ExportCharts");2303 }2304 2305 /** Returns default shortcut. */2306 virtual QKeySequence defaultShortcut(UIActionPoolType) const /* override */2307 {2308 return QKeySequence();2309 }2310 2311 /** Handles translation event. */2312 virtual void retranslateUi() /* override */2313 {2314 setName(QApplication::translate("UIActionPool", "Export..."));2315 setShortcutScope(QApplication::translate("UIActionPool", "Performance Monitor"));2316 setStatusTip(QApplication::translate("UIActionPool", "Export the chart data into a text file"));2317 setToolTip( QApplication::translate("UIActionPool", "Export the chart data into a text file")2318 2250 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString()))); 2319 2251 } … … 2569 2501 m_pool[UIActionIndex_M_FileManager_S_Guest_ShowProperties] = new UIActionMenuFileManagerShowProperties(this); 2570 2502 2571 /* Create 'Performance Monitor' actions: */2572 m_pool[UIActionIndex_M_PerformanceMonitor] = new UIActionMenuPerformanceMonitor(this);2573 m_pool[UIActionIndex_M_PerformanceMonitor_S_Export] = new UIActionMenuPerformanceMonitorExport(this);2574 2575 2576 2503 /* Prepare update-handlers for known menus: */ 2577 2504 #ifdef VBOX_WS_MAC -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h
r85426 r85434 136 136 UIActionIndex_M_FileManager_S_Guest_ShowProperties, 137 137 138 /* Machine performance monitor actions. */139 UIActionIndex_M_PerformanceMonitor,140 UIActionIndex_M_PerformanceMonitor_S_Export,141 142 143 138 /* Maximum index: */ 144 139 UIActionIndex_Max -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.cpp
r85426 r85434 1727 1727 1728 1728 /** Simple action extension, used as 'Show Performance Monitor' action class. */ 1729 class UIActionToggleSelectorToolsMachineShowPerformance Monitor: public UIActionToggle1730 { 1731 Q_OBJECT; 1732 1733 public: 1734 1735 /** Constructs action passing @a pParent to the base-class. */ 1736 UIActionToggleSelectorToolsMachineShowPerformance Monitor(UIActionPool *pParent)1729 class UIActionToggleSelectorToolsMachineShowPerformance : public UIActionToggle 1730 { 1731 Q_OBJECT; 1732 1733 public: 1734 1735 /** Constructs action passing @a pParent to the base-class. */ 1736 UIActionToggleSelectorToolsMachineShowPerformance(UIActionPool *pParent) 1737 1737 : UIActionToggle(pParent) 1738 1738 { … … 1754 1754 virtual void retranslateUi() /* override */ 1755 1755 { 1756 setName(QApplication::translate("UIActionPool", "&Performance Monitor"));1757 setStatusTip(QApplication::translate("UIActionPool", "Open the machine performance monitorpane"));1756 setName(QApplication::translate("UIActionPool", "&Performance")); 1757 setStatusTip(QApplication::translate("UIActionPool", "Open the machine performance pane")); 1758 1758 } 1759 1759 }; … … 2136 2136 setStatusTip(QApplication::translate("UIActionPool", "Clone selected virtual machine")); 2137 2137 setToolTip( QApplication::translate("UIActionPool", "Clone Virtual Machine") 2138 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString()))); 2139 } 2140 }; 2141 2142 2143 /** Menu action extension, used as 'Performance' menu class. */ 2144 class UIActionMenuSelectorPerformance : public UIActionMenu 2145 { 2146 Q_OBJECT; 2147 2148 public: 2149 2150 /** Constructs action passing @a pParent to the base-class. */ 2151 UIActionMenuSelectorPerformance(UIActionPool *pParent) 2152 : UIActionMenu(pParent) 2153 {} 2154 2155 protected: 2156 2157 /** Returns shortcut extra-data ID. */ 2158 virtual QString shortcutExtraDataID() const /* override */ 2159 { 2160 return QString("PerformanceMenu"); 2161 } 2162 2163 /** Handles translation event. */ 2164 virtual void retranslateUi() /* override */ 2165 { 2166 setName(QApplication::translate("UIActionPool", "&Performance")); 2167 } 2168 }; 2169 2170 /** Simple action extension, used as 'Export' action class. */ 2171 class UIActionMenuSelectorPerformanceExport : public UIActionSimple 2172 { 2173 Q_OBJECT; 2174 2175 public: 2176 2177 /** Constructs action passing @a pParent to the base-class. */ 2178 UIActionMenuSelectorPerformanceExport(UIActionPool *pParent) 2179 : UIActionSimple(pParent, 2180 ":/log_viewer_save_32px.png", ":/log_viewer_save_16px.png", 2181 ":/log_viewer_save_disabled_32px.png", ":/log_viewer_save_disabled_16px.png") 2182 { 2183 setShortcutContext(Qt::WidgetWithChildrenShortcut); 2184 } 2185 2186 protected: 2187 2188 /** Returns shortcut extra-data ID. */ 2189 virtual QString shortcutExtraDataID() const /* override */ 2190 { 2191 return QString("ExportCharts"); 2192 } 2193 2194 /** Handles translation event. */ 2195 virtual void retranslateUi() /* override */ 2196 { 2197 setName(QApplication::translate("UIActionPool", "&Export...")); 2198 setShortcutScope(QApplication::translate("UIActionPool", "Performance Monitor")); 2199 setStatusTip(QApplication::translate("UIActionPool", "Export the chart data into a text file")); 2200 setToolTip( QApplication::translate("UIActionPool", "Export Data to File") 2138 2201 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString()))); 2139 2202 } … … 3366 3429 m_pool[UIActionIndexST_M_Group_M_Tools_T_Snapshots] = new UIActionToggleSelectorToolsMachineShowSnapshots(this); 3367 3430 m_pool[UIActionIndexST_M_Group_M_Tools_T_Logs] = new UIActionToggleSelectorToolsMachineShowLogs(this); 3431 m_pool[UIActionIndexST_M_Group_M_Tools_T_Performance] = new UIActionToggleSelectorToolsMachineShowPerformance(this); 3368 3432 m_pool[UIActionIndexST_M_Group_S_Discard] = new UIActionSimpleSelectorCommonPerformDiscard(this); 3369 3433 m_pool[UIActionIndexST_M_Group_S_ShowLogDialog] = new UIActionSimpleSelectorCommonShowMachineLogs(this); … … 3406 3470 m_pool[UIActionIndexST_M_Machine_M_Tools_T_Snapshots] = new UIActionToggleSelectorToolsMachineShowSnapshots(this); 3407 3471 m_pool[UIActionIndexST_M_Machine_M_Tools_T_Logs] = new UIActionToggleSelectorToolsMachineShowLogs(this); 3408 m_pool[UIActionIndexST_M_Machine_M_Tools_T_Performance Monitor] = new UIActionToggleSelectorToolsMachineShowPerformanceMonitor(this);3472 m_pool[UIActionIndexST_M_Machine_M_Tools_T_Performance] = new UIActionToggleSelectorToolsMachineShowPerformance(this); 3409 3473 m_pool[UIActionIndexST_M_Machine_S_Discard] = new UIActionSimpleSelectorCommonPerformDiscard(this); 3410 3474 m_pool[UIActionIndexST_M_Machine_S_ShowLogDialog] = new UIActionSimpleSelectorCommonShowMachineLogs(this); … … 3429 3493 m_pool[UIActionIndexST_M_Snapshot_T_Properties] = new UIActionMenuSelectorSnapshotToggleProperties(this); 3430 3494 m_pool[UIActionIndexST_M_Snapshot_S_Clone] = new UIActionMenuSelectorSnapshotPerformClone(this); 3495 3496 /* Performance Monitor actions: */ 3497 m_pool[UIActionIndex_M_Performance] = new UIActionMenuSelectorPerformance(this); 3498 m_pool[UIActionIndex_M_Performance_S_Export] = new UIActionMenuSelectorPerformanceExport(this); 3431 3499 3432 3500 /* Virtual Medium Manager actions: */ … … 3479 3547 m_groupPool[UIActionIndexST_M_Group_M_Tools]->addAction(m_pool.value(UIActionIndexST_M_Group_M_Tools_T_Snapshots)); 3480 3548 m_groupPool[UIActionIndexST_M_Group_M_Tools]->addAction(m_pool.value(UIActionIndexST_M_Group_M_Tools_T_Logs)); 3549 m_groupPool[UIActionIndexST_M_Group_M_Tools]->addAction(m_pool.value(UIActionIndexST_M_Group_M_Tools_T_Performance)); 3481 3550 3482 3551 /* 'Machine' action groups: */ … … 3485 3554 m_groupPool[UIActionIndexST_M_Machine_M_Tools]->addAction(m_pool.value(UIActionIndexST_M_Machine_M_Tools_T_Snapshots)); 3486 3555 m_groupPool[UIActionIndexST_M_Machine_M_Tools]->addAction(m_pool.value(UIActionIndexST_M_Machine_M_Tools_T_Logs)); 3487 m_groupPool[UIActionIndexST_M_Machine_M_Tools]->addAction(m_pool.value(UIActionIndexST_M_Machine_M_Tools_T_Performance Monitor));3556 m_groupPool[UIActionIndexST_M_Machine_M_Tools]->addAction(m_pool.value(UIActionIndexST_M_Machine_M_Tools_T_Performance)); 3488 3557 3489 3558 /* Prepare update-handlers for known menus: */ … … 3599 3668 updateMenuLogViewerWindow(); 3600 3669 updateMenuLogViewer(); 3601 /* 'Performance' Menu: */3602 addMenu(m_mainMenus, action(UIActionIndex_M_Performance Monitor));3670 /* 'Performance' menu: */ 3671 addMenu(m_mainMenus, action(UIActionIndex_M_Performance)); 3603 3672 updateMenuPerformanceMonitor(); 3604 3673 … … 3872 3941 pMenu->addAction(action(UIActionIndexST_M_Group_M_Tools_T_Snapshots)); 3873 3942 pMenu->addAction(action(UIActionIndexST_M_Group_M_Tools_T_Logs)); 3943 pMenu->addAction(action(UIActionIndexST_M_Group_M_Tools_T_Performance)); 3874 3944 3875 3945 /* Mark menu as valid: */ … … 3889 3959 pMenu->addAction(action(UIActionIndexST_M_Machine_M_Tools_T_Snapshots)); 3890 3960 pMenu->addAction(action(UIActionIndexST_M_Machine_M_Tools_T_Logs)); 3891 pMenu->addAction(action(UIActionIndexST_M_Machine_M_Tools_T_Performance Monitor));3961 pMenu->addAction(action(UIActionIndexST_M_Machine_M_Tools_T_Performance)); 3892 3962 3893 3963 /* Mark menu as valid: */ … … 4156 4226 { 4157 4227 /* Get corresponding menu: */ 4158 UIMenu *pMenu = action(UIActionIndex_M_Performance Monitor)->menu();4228 UIMenu *pMenu = action(UIActionIndex_M_Performance)->menu(); 4159 4229 AssertPtrReturnVoid(pMenu); 4160 4230 /* Clear contents: */ 4161 4231 pMenu->clear(); 4162 4232 4163 /* Populate Snapshot-menu: */4164 pMenu->addAction(action(UIActionIndex_M_Performance Monitor_S_Export));4233 /* Populate Performance-menu: */ 4234 pMenu->addAction(action(UIActionIndex_M_Performance_S_Export)); 4165 4235 4166 4236 /* Mark menu as valid: */ 4167 m_invalidations.remove(UIActionIndex ST_M_Snapshot);4237 m_invalidations.remove(UIActionIndex_M_Performance); 4168 4238 } 4169 4239 … … 4219 4289 << action(UIActionIndexST_M_Group_M_Tools_T_Details) 4220 4290 << action(UIActionIndexST_M_Group_M_Tools_T_Snapshots) 4221 << action(UIActionIndexST_M_Group_M_Tools_T_Logs); 4291 << action(UIActionIndexST_M_Group_M_Tools_T_Logs) 4292 << action(UIActionIndexST_M_Group_M_Tools_T_Performance); 4222 4293 break; 4223 4294 } … … 4257 4328 << action(UIActionIndexST_M_Machine_M_Tools_T_Snapshots) 4258 4329 << action(UIActionIndexST_M_Machine_M_Tools_T_Logs) 4259 << action(UIActionIndexST_M_Machine_M_Tools_T_Performance Monitor);4330 << action(UIActionIndexST_M_Machine_M_Tools_T_Performance); 4260 4331 break; 4261 4332 } -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.h
r85426 r85434 83 83 UIActionIndexST_M_Group_M_Tools_T_Snapshots, 84 84 UIActionIndexST_M_Group_M_Tools_T_Logs, 85 UIActionIndexST_M_Group_M_Tools_T_Performance, 85 86 UIActionIndexST_M_Group_S_Discard, 86 87 UIActionIndexST_M_Group_S_ShowLogDialog, … … 122 123 UIActionIndexST_M_Machine_M_Tools_T_Snapshots, 123 124 UIActionIndexST_M_Machine_M_Tools_T_Logs, 124 UIActionIndexST_M_Machine_M_Tools_T_Performance Monitor,125 UIActionIndexST_M_Machine_M_Tools_T_Performance, 125 126 UIActionIndexST_M_Machine_S_Discard, 126 127 UIActionIndexST_M_Machine_S_ShowLogDialog, … … 145 146 UIActionIndexST_M_Snapshot_T_Properties, 146 147 UIActionIndexST_M_Snapshot_S_Clone, 148 149 /* Performance Monitor actions: */ 150 UIActionIndex_M_Performance, 151 UIActionIndex_M_Performance_S_Export, 147 152 148 153 /* Virtual Media Manager actions: */ -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r85426 r85434 2787 2787 m_pWidget->currentMachineTool() == UIToolType_Logs; 2788 2788 actionPool()->action(UIActionIndex_M_Log)->setVisible(fLogViewerMenuShown); 2789 2790 const bool fPerformanceMenuShown = fMachineMenuShown&&2791 m_pWidget->currentMachineTool() == UIToolType_Performance;2792 actionPool()->action(UIActionIndex_M_Performance Monitor)->setVisible(fPerformanceMenuShown);2789 /* Determine whether Performance menu should be visible: */ 2790 const bool fPerformanceMenuShown = (fMachineMenuShown || fGroupMenuShown) && 2791 m_pWidget->currentMachineTool() == UIToolType_Performance; 2792 actionPool()->action(UIActionIndex_M_Performance)->setVisible(fPerformanceMenuShown); 2793 2793 2794 2794 /* Hide action shortcuts: */ … … 2981 2981 case UIToolType_Performance: 2982 2982 { 2983 actionPool()->action(UIActionIndexST_M_Machine_M_Tools_T_PerformanceMonitor)->setChecked(true); 2983 actionPool()->action(UIActionIndexST_M_Group_M_Tools_T_Performance)->setChecked(true); 2984 actionPool()->action(UIActionIndexST_M_Machine_M_Tools_T_Performance)->setChecked(true); 2984 2985 break; 2985 2986 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.cpp
r85426 r85434 830 830 case UIToolType_Performance: 831 831 { 832 m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_Performance Monitor_S_Export));832 m_pToolBar->addAction(actionPool()->action(UIActionIndex_M_Performance_S_Export)); 833 833 m_pToolBar->addSeparator(); 834 834 m_pToolBar->addAction(actionPool()->action(UIActionIndexST_M_Machine_S_Settings));
Note:
See TracChangeset
for help on using the changeset viewer.