VirtualBox

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

Last change on this file was 102575, checked in by vboxsync, 5 months ago

FE/Qt: VBox Manager: Remove Show Log Viewer dialog action; Only pane opened embedded way should be allowed.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 11.9 KB
Line 
1/* $Id: UIActionPoolManager.h 102575 2023-12-11 16:48:25Z 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_Refresh,
99 UIActionIndexMN_M_Group_S_ShowInFileManager,
100 UIActionIndexMN_M_Group_S_CreateShortcut,
101 UIActionIndexMN_M_Group_S_Sort,
102 UIActionIndexMN_M_Group_T_Search,
103
104 /* 'Machine' menu actions: */
105 UIActionIndexMN_M_Machine,
106 UIActionIndexMN_M_Machine_S_New,
107 UIActionIndexMN_M_Machine_S_Add,
108 UIActionIndexMN_M_Machine_S_Settings,
109 UIActionIndexMN_M_Machine_S_Clone,
110 UIActionIndexMN_M_Machine_S_Move,
111 UIActionIndexMN_M_Machine_S_ExportToOCI,
112 UIActionIndexMN_M_Machine_S_Remove,
113 UIActionIndexMN_M_Machine_M_MoveToGroup,
114 UIActionIndexMN_M_Machine_M_MoveToGroup_S_New,
115 UIActionIndexMN_M_Machine_M_StartOrShow,
116 UIActionIndexMN_M_Machine_M_StartOrShow_S_StartNormal,
117 UIActionIndexMN_M_Machine_M_StartOrShow_S_StartHeadless,
118 UIActionIndexMN_M_Machine_M_StartOrShow_S_StartDetachable,
119 UIActionIndexMN_M_Machine_T_Pause,
120 UIActionIndexMN_M_Machine_S_Reset,
121 UIActionIndexMN_M_Machine_S_Detach,
122 UIActionIndexMN_M_Machine_M_Console,
123 UIActionIndexMN_M_Machine_M_Console_S_CreateConnection,
124 UIActionIndexMN_M_Machine_M_Console_S_DeleteConnection,
125 UIActionIndexMN_M_Machine_M_Console_S_CopyCommandSerialUnix,
126 UIActionIndexMN_M_Machine_M_Console_S_CopyCommandSerialWindows,
127 UIActionIndexMN_M_Machine_M_Console_S_CopyCommandVNCUnix,
128 UIActionIndexMN_M_Machine_M_Console_S_CopyCommandVNCWindows,
129 UIActionIndexMN_M_Machine_M_Console_S_ConfigureApplications,
130 UIActionIndexMN_M_Machine_M_Console_S_ShowLog,
131 UIActionIndexMN_M_Machine_M_Stop,
132 UIActionIndexMN_M_Machine_M_Stop_S_SaveState,
133 UIActionIndexMN_M_Machine_M_Stop_S_Terminate,
134 UIActionIndexMN_M_Machine_M_Stop_S_Shutdown,
135 UIActionIndexMN_M_Machine_M_Stop_S_PowerOff,
136 UIActionIndexMN_M_Machine_M_Tools,
137 UIActionIndexMN_M_Machine_M_Tools_T_Details,
138 UIActionIndexMN_M_Machine_M_Tools_T_Snapshots,
139 UIActionIndexMN_M_Machine_M_Tools_T_Logs,
140 UIActionIndexMN_M_Machine_M_Tools_T_Activity,
141 UIActionIndexMN_M_Machine_M_Tools_T_FileManager,
142 UIActionIndexMN_M_Machine_S_Discard,
143 UIActionIndexMN_M_Machine_S_Refresh,
144 UIActionIndexMN_M_Machine_S_ShowInFileManager,
145 UIActionIndexMN_M_Machine_S_CreateShortcut,
146 UIActionIndexMN_M_Machine_S_SortParent,
147 UIActionIndexMN_M_Machine_T_Search,
148
149 /* Snapshot Pane actions: */
150 UIActionIndexMN_M_Snapshot,
151 UIActionIndexMN_M_Snapshot_S_Take,
152 UIActionIndexMN_M_Snapshot_S_Delete,
153 UIActionIndexMN_M_Snapshot_S_Restore,
154 UIActionIndexMN_M_Snapshot_T_Properties,
155 UIActionIndexMN_M_Snapshot_S_Clone,
156
157 /* Extension Pack Manager actions: */
158 UIActionIndexMN_M_ExtensionWindow,
159 UIActionIndexMN_M_Extension,
160 UIActionIndexMN_M_Extension_S_Install,
161 UIActionIndexMN_M_Extension_S_Uninstall,
162
163 /* Virtual Media Manager actions: */
164 UIActionIndexMN_M_MediumWindow,
165 UIActionIndexMN_M_Medium,
166 UIActionIndexMN_M_Medium_S_Add,
167 UIActionIndexMN_M_Medium_S_Create,
168 UIActionIndexMN_M_Medium_S_Copy,
169 UIActionIndexMN_M_Medium_S_Move,
170 UIActionIndexMN_M_Medium_S_Remove,
171 UIActionIndexMN_M_Medium_S_Release,
172 UIActionIndexMN_M_Medium_T_Details,
173 UIActionIndexMN_M_Medium_T_Search,
174 UIActionIndexMN_M_Medium_S_Refresh,
175 UIActionIndexMN_M_Medium_S_Clear,
176
177 /* Network Manager actions: */
178 UIActionIndexMN_M_NetworkWindow,
179 UIActionIndexMN_M_Network,
180 UIActionIndexMN_M_Network_S_Create,
181 UIActionIndexMN_M_Network_S_Remove,
182 UIActionIndexMN_M_Network_T_Details,
183 UIActionIndexMN_M_Network_S_Refresh,
184
185 /* Cloud Profile Manager actions: */
186 UIActionIndexMN_M_CloudWindow,
187 UIActionIndexMN_M_Cloud,
188 UIActionIndexMN_M_Cloud_S_Add,
189 UIActionIndexMN_M_Cloud_S_Import,
190 UIActionIndexMN_M_Cloud_S_Remove,
191 UIActionIndexMN_M_Cloud_T_Details,
192 UIActionIndexMN_M_Cloud_S_TryPage,
193 UIActionIndexMN_M_Cloud_S_Help,
194
195 /* Cloud Console Manager actions: */
196 UIActionIndexMN_M_CloudConsoleWindow,
197 UIActionIndexMN_M_CloudConsole,
198 UIActionIndexMN_M_CloudConsole_S_ApplicationAdd,
199 UIActionIndexMN_M_CloudConsole_S_ApplicationRemove,
200 UIActionIndexMN_M_CloudConsole_S_ProfileAdd,
201 UIActionIndexMN_M_CloudConsole_S_ProfileRemove,
202 UIActionIndexMN_M_CloudConsole_T_Details,
203
204 /* VM VM Activity Overview actions: */
205 UIActionIndexMN_M_VMActivityOverview,
206 UIActionIndexMN_M_VMActivityOverview_M_Columns,
207 UIActionIndexMN_M_VMActivityOverview_S_SwitchToMachineActivity,
208
209 /* Maximum index: */
210 UIActionIndexMN_Max
211};
212
213
214/** UIActionPool extension
215 * representing action-pool singleton for Manager UI. */
216class SHARED_LIBRARY_STUFF UIActionPoolManager : public UIActionPool
217{
218 Q_OBJECT;
219
220protected:
221
222 /** Constructs action-pool.
223 * @param fTemporary Brings whether this action-pool is temporary,
224 * used to (re-)initialize shortcuts-pool. */
225 UIActionPoolManager(bool fTemporary = false);
226
227 /** Prepares pool. */
228 virtual void preparePool() RT_OVERRIDE;
229 /** Prepares connections. */
230 virtual void prepareConnections() RT_OVERRIDE;
231
232 /** Updates menu. */
233 virtual void updateMenu(int iIndex) RT_OVERRIDE;
234 /** Updates menus. */
235 virtual void updateMenus() RT_OVERRIDE;
236
237 /** Defines whether shortcuts of menu actions with specified @a iIndex should be visible. */
238 virtual void setShortcutsVisible(int iIndex, bool fVisible) RT_OVERRIDE;
239 /** Returns extra-data ID to save keyboard shortcuts under. */
240 virtual QString shortcutsExtraDataID() const RT_OVERRIDE;
241 /** Updates shortcuts. */
242 virtual void updateShortcuts() RT_OVERRIDE;
243
244private slots:
245
246 /** Handles signal about settings expert mode change. */
247 void sltHandleSettingsExpertModeChange();
248
249private:
250
251 /** Updates 'File' menu. */
252 void updateMenuFile();
253 /** Updates 'File' / 'Tools' menu. */
254 void updateMenuFileTools();
255 /** Updates 'Welcome' menu. */
256 void updateMenuWelcome();
257 /** Updates 'Group' menu. */
258 void updateMenuGroup();
259 /** Updates 'Machine' menu. */
260 void updateMenuMachine();
261 /** Updates 'Group' / 'Move to Group' menu. */
262 void updateMenuGroupMoveToGroup();
263 /** Updates 'Machine' / 'Move to Group' menu. */
264 void updateMenuMachineMoveToGroup();
265 /** Updates 'Group' / 'Start or Show' menu. */
266 void updateMenuGroupStartOrShow();
267 /** Updates 'Machine' / 'Start or Show' menu. */
268 void updateMenuMachineStartOrShow();
269 /** Updates 'Group' / 'Console' menu. */
270 void updateMenuGroupConsole();
271 /** Updates 'Machine' / 'Console' menu. */
272 void updateMenuMachineConsole();
273 /** Updates 'Group' / 'Close' menu. */
274 void updateMenuGroupClose();
275 /** Updates 'Machine' / 'Close' menu. */
276 void updateMenuMachineClose();
277 /** Updates 'Group' / 'Tools' menu. */
278 void updateMenuGroupTools();
279 /** Updates 'Machine' / 'Tools' menu. */
280 void updateMenuMachineTools();
281
282 /** Updates 'Extension Pack' window menu. */
283 void updateMenuExtensionWindow();
284 /** Updates 'Extension Pack' menu. */
285 void updateMenuExtension();
286 /** Updates 'Extension Pack' @a pMenu. */
287 void updateMenuExtensionWrapper(UIMenu *pMenu);
288
289 /** Updates 'Medium' window menu. */
290 void updateMenuMediumWindow();
291 /** Updates 'Medium' menu. */
292 void updateMenuMedium();
293 /** Updates 'Medium' @a pMenu. */
294 void updateMenuMediumWrapper(UIMenu *pMenu);
295
296 /** Updates 'Network' window menu. */
297 void updateMenuNetworkWindow();
298 /** Updates 'Network' menu. */
299 void updateMenuNetwork();
300 /** Updates 'Network' @a pMenu. */
301 void updateMenuNetworkWrapper(UIMenu *pMenu);
302
303 /** Updates 'Cloud' window menu. */
304 void updateMenuCloudWindow();
305 /** Updates 'Cloud' menu. */
306 void updateMenuCloud();
307 /** Updates 'Cloud' @a pMenu. */
308 void updateMenuCloudWrapper(UIMenu *pMenu);
309
310 /** Updates 'Cloud Console' window menu. */
311 void updateMenuCloudConsoleWindow();
312 /** Updates 'Cloud Console' menu. */
313 void updateMenuCloudConsole();
314 /** Updates 'Cloud Console' @a pMenu. */
315 void updateMenuCloudConsoleWrapper(UIMenu *pMenu);
316
317 /** Updates 'VM VM Activity Overview' menu. */
318 void updateMenuVMActivityOverview();
319 /** Updates 'VM VM Activity Overview' @a pMenu. */
320 void updateMenuVMActivityOverviewWrapper(UIMenu *pMenu);
321
322 /** Updates 'Snapshot' menu. */
323 void updateMenuSnapshot();
324
325 /** Enables factory in base-class. */
326 friend class UIActionPool;
327};
328
329
330#endif /* !FEQT_INCLUDED_SRC_globals_UIActionPoolManager_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use