VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPoolManager.h@ 102493

Last change on this file since 102493 was 102265, checked in by vboxsync, 10 months ago

FE/Qt: bugref:10513: Make sure UIActionPoolManager updates available tool menus when experience mode is changed.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 12.0 KB
Line 
1/* $Id: UIActionPoolManager.h 102265 2023-11-22 15:59:48Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIActionPoolManager class declaration.
4 */
5
6/*
7 * Copyright (C) 2010-2023 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28#ifndef FEQT_INCLUDED_SRC_globals_UIActionPoolManager_h
29#define FEQT_INCLUDED_SRC_globals_UIActionPoolManager_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* GUI includes: */
35#include "UIActionPool.h"
36#include "UILibraryDefs.h"
37
38
39/** VirtualBox Manager action-pool index enum.
40 * Naming convention is following:
41 * 1. Every menu index prepended with 'M',
42 * 2. Every simple-action index prepended with 'S',
43 * 3. Every toggle-action index presended with 'T',
44 * 5. Every sub-index contains full parent-index name. */
45enum UIActionIndexMN
46{
47 /* 'File' menu actions: */
48 UIActionIndexMN_M_File = UIActionIndex_Max + 1,
49 UIActionIndexMN_M_File_S_ImportAppliance,
50 UIActionIndexMN_M_File_S_ExportAppliance,
51 UIActionIndexMN_M_File_M_Tools,
52 UIActionIndexMN_M_File_M_Tools_T_WelcomeScreen,
53 UIActionIndexMN_M_File_M_Tools_T_ExtensionPackManager,
54 UIActionIndexMN_M_File_M_Tools_T_VirtualMediaManager,
55 UIActionIndexMN_M_File_M_Tools_T_NetworkManager,
56 UIActionIndexMN_M_File_M_Tools_T_CloudProfileManager,
57 UIActionIndexMN_M_File_M_Tools_T_VMActivityOverview,
58#ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
59 UIActionIndexMN_M_File_S_ShowExtraDataManager,
60#endif
61 UIActionIndexMN_M_File_S_Close,
62
63 /* 'Welcome' menu actions: */
64 UIActionIndexMN_M_Welcome,
65 UIActionIndexMN_M_Welcome_S_New,
66 UIActionIndexMN_M_Welcome_S_Add,
67
68 /* 'Group' menu actions: */
69 UIActionIndexMN_M_Group,
70 UIActionIndexMN_M_Group_S_New,
71 UIActionIndexMN_M_Group_S_Add,
72 UIActionIndexMN_M_Group_S_Rename,
73 UIActionIndexMN_M_Group_S_Remove,
74 UIActionIndexMN_M_Group_M_MoveToGroup,
75 UIActionIndexMN_M_Group_M_StartOrShow,
76 UIActionIndexMN_M_Group_M_StartOrShow_S_StartNormal,
77 UIActionIndexMN_M_Group_M_StartOrShow_S_StartHeadless,
78 UIActionIndexMN_M_Group_M_StartOrShow_S_StartDetachable,
79 UIActionIndexMN_M_Group_T_Pause,
80 UIActionIndexMN_M_Group_S_Reset,
81 UIActionIndexMN_M_Group_S_Detach,
82 UIActionIndexMN_M_Group_M_Console,
83 UIActionIndexMN_M_Group_M_Console_S_CreateConnection,
84 UIActionIndexMN_M_Group_M_Console_S_DeleteConnection,
85 UIActionIndexMN_M_Group_M_Console_S_ConfigureApplications,
86 UIActionIndexMN_M_Group_M_Stop,
87 UIActionIndexMN_M_Group_M_Stop_S_SaveState,
88 UIActionIndexMN_M_Group_M_Stop_S_Terminate,
89 UIActionIndexMN_M_Group_M_Stop_S_Shutdown,
90 UIActionIndexMN_M_Group_M_Stop_S_PowerOff,
91 UIActionIndexMN_M_Group_M_Tools,
92 UIActionIndexMN_M_Group_M_Tools_T_Details,
93 UIActionIndexMN_M_Group_M_Tools_T_Snapshots,
94 UIActionIndexMN_M_Group_M_Tools_T_Logs,
95 UIActionIndexMN_M_Group_M_Tools_T_Activity,
96 UIActionIndexMN_M_Group_M_Tools_T_FileManager,
97 UIActionIndexMN_M_Group_S_Discard,
98 UIActionIndexMN_M_Group_S_ShowLogDialog,
99 UIActionIndexMN_M_Group_S_Refresh,
100 UIActionIndexMN_M_Group_S_ShowInFileManager,
101 UIActionIndexMN_M_Group_S_CreateShortcut,
102 UIActionIndexMN_M_Group_S_Sort,
103 UIActionIndexMN_M_Group_T_Search,
104
105 /* 'Machine' menu actions: */
106 UIActionIndexMN_M_Machine,
107 UIActionIndexMN_M_Machine_S_New,
108 UIActionIndexMN_M_Machine_S_Add,
109 UIActionIndexMN_M_Machine_S_Settings,
110 UIActionIndexMN_M_Machine_S_Clone,
111 UIActionIndexMN_M_Machine_S_Move,
112 UIActionIndexMN_M_Machine_S_ExportToOCI,
113 UIActionIndexMN_M_Machine_S_Remove,
114 UIActionIndexMN_M_Machine_M_MoveToGroup,
115 UIActionIndexMN_M_Machine_M_MoveToGroup_S_New,
116 UIActionIndexMN_M_Machine_M_StartOrShow,
117 UIActionIndexMN_M_Machine_M_StartOrShow_S_StartNormal,
118 UIActionIndexMN_M_Machine_M_StartOrShow_S_StartHeadless,
119 UIActionIndexMN_M_Machine_M_StartOrShow_S_StartDetachable,
120 UIActionIndexMN_M_Machine_T_Pause,
121 UIActionIndexMN_M_Machine_S_Reset,
122 UIActionIndexMN_M_Machine_S_Detach,
123 UIActionIndexMN_M_Machine_M_Console,
124 UIActionIndexMN_M_Machine_M_Console_S_CreateConnection,
125 UIActionIndexMN_M_Machine_M_Console_S_DeleteConnection,
126 UIActionIndexMN_M_Machine_M_Console_S_CopyCommandSerialUnix,
127 UIActionIndexMN_M_Machine_M_Console_S_CopyCommandSerialWindows,
128 UIActionIndexMN_M_Machine_M_Console_S_CopyCommandVNCUnix,
129 UIActionIndexMN_M_Machine_M_Console_S_CopyCommandVNCWindows,
130 UIActionIndexMN_M_Machine_M_Console_S_ConfigureApplications,
131 UIActionIndexMN_M_Machine_M_Console_S_ShowLog,
132 UIActionIndexMN_M_Machine_M_Stop,
133 UIActionIndexMN_M_Machine_M_Stop_S_SaveState,
134 UIActionIndexMN_M_Machine_M_Stop_S_Terminate,
135 UIActionIndexMN_M_Machine_M_Stop_S_Shutdown,
136 UIActionIndexMN_M_Machine_M_Stop_S_PowerOff,
137 UIActionIndexMN_M_Machine_M_Tools,
138 UIActionIndexMN_M_Machine_M_Tools_T_Details,
139 UIActionIndexMN_M_Machine_M_Tools_T_Snapshots,
140 UIActionIndexMN_M_Machine_M_Tools_T_Logs,
141 UIActionIndexMN_M_Machine_M_Tools_T_Activity,
142 UIActionIndexMN_M_Machine_M_Tools_T_FileManager,
143 UIActionIndexMN_M_Machine_S_Discard,
144 UIActionIndexMN_M_Machine_S_ShowLogDialog,
145 UIActionIndexMN_M_Machine_S_Refresh,
146 UIActionIndexMN_M_Machine_S_ShowInFileManager,
147 UIActionIndexMN_M_Machine_S_CreateShortcut,
148 UIActionIndexMN_M_Machine_S_SortParent,
149 UIActionIndexMN_M_Machine_T_Search,
150
151 /* Snapshot Pane actions: */
152 UIActionIndexMN_M_Snapshot,
153 UIActionIndexMN_M_Snapshot_S_Take,
154 UIActionIndexMN_M_Snapshot_S_Delete,
155 UIActionIndexMN_M_Snapshot_S_Restore,
156 UIActionIndexMN_M_Snapshot_T_Properties,
157 UIActionIndexMN_M_Snapshot_S_Clone,
158
159 /* Extension Pack Manager actions: */
160 UIActionIndexMN_M_ExtensionWindow,
161 UIActionIndexMN_M_Extension,
162 UIActionIndexMN_M_Extension_S_Install,
163 UIActionIndexMN_M_Extension_S_Uninstall,
164
165 /* Virtual Media Manager actions: */
166 UIActionIndexMN_M_MediumWindow,
167 UIActionIndexMN_M_Medium,
168 UIActionIndexMN_M_Medium_S_Add,
169 UIActionIndexMN_M_Medium_S_Create,
170 UIActionIndexMN_M_Medium_S_Copy,
171 UIActionIndexMN_M_Medium_S_Move,
172 UIActionIndexMN_M_Medium_S_Remove,
173 UIActionIndexMN_M_Medium_S_Release,
174 UIActionIndexMN_M_Medium_T_Details,
175 UIActionIndexMN_M_Medium_T_Search,
176 UIActionIndexMN_M_Medium_S_Refresh,
177 UIActionIndexMN_M_Medium_S_Clear,
178
179 /* Network Manager actions: */
180 UIActionIndexMN_M_NetworkWindow,
181 UIActionIndexMN_M_Network,
182 UIActionIndexMN_M_Network_S_Create,
183 UIActionIndexMN_M_Network_S_Remove,
184 UIActionIndexMN_M_Network_T_Details,
185 UIActionIndexMN_M_Network_S_Refresh,
186
187 /* Cloud Profile Manager actions: */
188 UIActionIndexMN_M_CloudWindow,
189 UIActionIndexMN_M_Cloud,
190 UIActionIndexMN_M_Cloud_S_Add,
191 UIActionIndexMN_M_Cloud_S_Import,
192 UIActionIndexMN_M_Cloud_S_Remove,
193 UIActionIndexMN_M_Cloud_T_Details,
194 UIActionIndexMN_M_Cloud_S_TryPage,
195 UIActionIndexMN_M_Cloud_S_Help,
196
197 /* Cloud Console Manager actions: */
198 UIActionIndexMN_M_CloudConsoleWindow,
199 UIActionIndexMN_M_CloudConsole,
200 UIActionIndexMN_M_CloudConsole_S_ApplicationAdd,
201 UIActionIndexMN_M_CloudConsole_S_ApplicationRemove,
202 UIActionIndexMN_M_CloudConsole_S_ProfileAdd,
203 UIActionIndexMN_M_CloudConsole_S_ProfileRemove,
204 UIActionIndexMN_M_CloudConsole_T_Details,
205
206 /* VM VM Activity Overview actions: */
207 UIActionIndexMN_M_VMActivityOverview,
208 UIActionIndexMN_M_VMActivityOverview_M_Columns,
209 UIActionIndexMN_M_VMActivityOverview_S_SwitchToMachineActivity,
210
211 /* Maximum index: */
212 UIActionIndexMN_Max
213};
214
215
216/** UIActionPool extension
217 * representing action-pool singleton for Manager UI. */
218class SHARED_LIBRARY_STUFF UIActionPoolManager : public UIActionPool
219{
220 Q_OBJECT;
221
222protected:
223
224 /** Constructs action-pool.
225 * @param fTemporary Brings whether this action-pool is temporary,
226 * used to (re-)initialize shortcuts-pool. */
227 UIActionPoolManager(bool fTemporary = false);
228
229 /** Prepares pool. */
230 virtual void preparePool() RT_OVERRIDE;
231 /** Prepares connections. */
232 virtual void prepareConnections() RT_OVERRIDE;
233
234 /** Updates menu. */
235 virtual void updateMenu(int iIndex) RT_OVERRIDE;
236 /** Updates menus. */
237 virtual void updateMenus() RT_OVERRIDE;
238
239 /** Defines whether shortcuts of menu actions with specified @a iIndex should be visible. */
240 virtual void setShortcutsVisible(int iIndex, bool fVisible) RT_OVERRIDE;
241 /** Returns extra-data ID to save keyboard shortcuts under. */
242 virtual QString shortcutsExtraDataID() const RT_OVERRIDE;
243 /** Updates shortcuts. */
244 virtual void updateShortcuts() RT_OVERRIDE;
245
246private slots:
247
248 /** Handles signal about settings expert mode change. */
249 void sltHandleSettingsExpertModeChange();
250
251private:
252
253 /** Updates 'File' menu. */
254 void updateMenuFile();
255 /** Updates 'File' / 'Tools' menu. */
256 void updateMenuFileTools();
257 /** Updates 'Welcome' menu. */
258 void updateMenuWelcome();
259 /** Updates 'Group' menu. */
260 void updateMenuGroup();
261 /** Updates 'Machine' menu. */
262 void updateMenuMachine();
263 /** Updates 'Group' / 'Move to Group' menu. */
264 void updateMenuGroupMoveToGroup();
265 /** Updates 'Machine' / 'Move to Group' menu. */
266 void updateMenuMachineMoveToGroup();
267 /** Updates 'Group' / 'Start or Show' menu. */
268 void updateMenuGroupStartOrShow();
269 /** Updates 'Machine' / 'Start or Show' menu. */
270 void updateMenuMachineStartOrShow();
271 /** Updates 'Group' / 'Console' menu. */
272 void updateMenuGroupConsole();
273 /** Updates 'Machine' / 'Console' menu. */
274 void updateMenuMachineConsole();
275 /** Updates 'Group' / 'Close' menu. */
276 void updateMenuGroupClose();
277 /** Updates 'Machine' / 'Close' menu. */
278 void updateMenuMachineClose();
279 /** Updates 'Group' / 'Tools' menu. */
280 void updateMenuGroupTools();
281 /** Updates 'Machine' / 'Tools' menu. */
282 void updateMenuMachineTools();
283
284 /** Updates 'Extension Pack' window menu. */
285 void updateMenuExtensionWindow();
286 /** Updates 'Extension Pack' menu. */
287 void updateMenuExtension();
288 /** Updates 'Extension Pack' @a pMenu. */
289 void updateMenuExtensionWrapper(UIMenu *pMenu);
290
291 /** Updates 'Medium' window menu. */
292 void updateMenuMediumWindow();
293 /** Updates 'Medium' menu. */
294 void updateMenuMedium();
295 /** Updates 'Medium' @a pMenu. */
296 void updateMenuMediumWrapper(UIMenu *pMenu);
297
298 /** Updates 'Network' window menu. */
299 void updateMenuNetworkWindow();
300 /** Updates 'Network' menu. */
301 void updateMenuNetwork();
302 /** Updates 'Network' @a pMenu. */
303 void updateMenuNetworkWrapper(UIMenu *pMenu);
304
305 /** Updates 'Cloud' window menu. */
306 void updateMenuCloudWindow();
307 /** Updates 'Cloud' menu. */
308 void updateMenuCloud();
309 /** Updates 'Cloud' @a pMenu. */
310 void updateMenuCloudWrapper(UIMenu *pMenu);
311
312 /** Updates 'Cloud Console' window menu. */
313 void updateMenuCloudConsoleWindow();
314 /** Updates 'Cloud Console' menu. */
315 void updateMenuCloudConsole();
316 /** Updates 'Cloud Console' @a pMenu. */
317 void updateMenuCloudConsoleWrapper(UIMenu *pMenu);
318
319 /** Updates 'VM VM Activity Overview' menu. */
320 void updateMenuVMActivityOverview();
321 /** Updates 'VM VM Activity Overview' @a pMenu. */
322 void updateMenuVMActivityOverviewWrapper(UIMenu *pMenu);
323
324 /** Updates 'Snapshot' menu. */
325 void updateMenuSnapshot();
326
327 /** Enables factory in base-class. */
328 friend class UIActionPool;
329};
330
331
332#endif /* !FEQT_INCLUDED_SRC_globals_UIActionPoolManager_h */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette