VirtualBox

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

Last change on this file since 82781 was 79258, checked in by vboxsync, 5 years ago

FE/Qt: bugref:9495: Add New Cloud VM wizard into File menu of VirtualBox Manager.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 8.7 KB
Line 
1/* $Id: UIActionPoolManager.h 79258 2019-06-20 15:21:37Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIActionPoolManager class declaration.
4 */
5
6/*
7 * Copyright (C) 2010-2019 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef FEQT_INCLUDED_SRC_globals_UIActionPoolManager_h
19#define FEQT_INCLUDED_SRC_globals_UIActionPoolManager_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24/* Qt includes: */
25#include <QList>
26
27/* GUI includes: */
28#include "UIActionPool.h"
29#include "UILibraryDefs.h"
30
31
32/** Runtime action-pool index enum.
33 * Naming convention is following:
34 * 1. Every menu index prepended with 'M',
35 * 2. Every simple-action index prepended with 'S',
36 * 3. Every toggle-action index presended with 'T',
37 * 4. Every polymorphic-action index presended with 'P',
38 * 5. Every sub-index contains full parent-index name. */
39enum UIActionIndexST
40{
41 /* 'File' menu actions: */
42 UIActionIndexST_M_File = UIActionIndex_Max + 1,
43 UIActionIndexST_M_File_S_ShowVirtualMediumManager,
44 UIActionIndexST_M_File_S_ShowHostNetworkManager,
45 UIActionIndexST_M_File_S_ShowCloudProfileManager,
46 UIActionIndexST_M_File_S_ImportAppliance,
47 UIActionIndexST_M_File_S_ExportAppliance,
48 UIActionIndexST_M_File_S_NewCloudVM,
49#ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
50 UIActionIndexST_M_File_S_ShowExtraDataManager,
51#endif
52 UIActionIndexST_M_File_S_Close,
53
54 /* 'Welcome' menu actions: */
55 UIActionIndexST_M_Welcome,
56 UIActionIndexST_M_Welcome_S_New,
57 UIActionIndexST_M_Welcome_S_Add,
58
59 /* 'Group' menu actions: */
60 UIActionIndexST_M_Group,
61 UIActionIndexST_M_Group_S_New,
62 UIActionIndexST_M_Group_S_Add,
63 UIActionIndexST_M_Group_S_Rename,
64 UIActionIndexST_M_Group_S_Remove,
65 UIActionIndexST_M_Group_M_StartOrShow,
66 UIActionIndexST_M_Group_M_StartOrShow_S_StartNormal,
67 UIActionIndexST_M_Group_M_StartOrShow_S_StartHeadless,
68 UIActionIndexST_M_Group_M_StartOrShow_S_StartDetachable,
69 UIActionIndexST_M_Group_T_Pause,
70 UIActionIndexST_M_Group_S_Reset,
71 UIActionIndexST_M_Group_M_Close,
72 UIActionIndexST_M_Group_M_Close_S_Detach,
73 UIActionIndexST_M_Group_M_Close_S_SaveState,
74 UIActionIndexST_M_Group_M_Close_S_Shutdown,
75 UIActionIndexST_M_Group_M_Close_S_PowerOff,
76 UIActionIndexST_M_Group_M_Tools,
77 UIActionIndexST_M_Group_M_Tools_T_Details,
78 UIActionIndexST_M_Group_M_Tools_T_Snapshots,
79 UIActionIndexST_M_Group_M_Tools_T_Logs,
80 UIActionIndexST_M_Group_S_Discard,
81 UIActionIndexST_M_Group_S_ShowLogDialog,
82 UIActionIndexST_M_Group_S_Refresh,
83 UIActionIndexST_M_Group_S_ShowInFileManager,
84 UIActionIndexST_M_Group_S_CreateShortcut,
85 UIActionIndexST_M_Group_S_Sort,
86
87 /* 'Machine' menu actions: */
88 UIActionIndexST_M_Machine,
89 UIActionIndexST_M_Machine_S_New,
90 UIActionIndexST_M_Machine_S_Add,
91 UIActionIndexST_M_Machine_S_Settings,
92 UIActionIndexST_M_Machine_S_Clone,
93 UIActionIndexST_M_Machine_S_Move,
94 UIActionIndexST_M_Machine_S_ExportToOCI,
95 UIActionIndexST_M_Machine_S_Remove,
96 UIActionIndexST_M_Machine_S_AddGroup,
97 UIActionIndexST_M_Machine_M_StartOrShow,
98 UIActionIndexST_M_Machine_M_StartOrShow_S_StartNormal,
99 UIActionIndexST_M_Machine_M_StartOrShow_S_StartHeadless,
100 UIActionIndexST_M_Machine_M_StartOrShow_S_StartDetachable,
101 UIActionIndexST_M_Machine_T_Pause,
102 UIActionIndexST_M_Machine_S_Reset,
103 UIActionIndexST_M_Machine_M_Close,
104 UIActionIndexST_M_Machine_M_Close_S_Detach,
105 UIActionIndexST_M_Machine_M_Close_S_SaveState,
106 UIActionIndexST_M_Machine_M_Close_S_Shutdown,
107 UIActionIndexST_M_Machine_M_Close_S_PowerOff,
108 UIActionIndexST_M_Machine_M_Tools,
109 UIActionIndexST_M_Machine_M_Tools_T_Details,
110 UIActionIndexST_M_Machine_M_Tools_T_Snapshots,
111 UIActionIndexST_M_Machine_M_Tools_T_Logs,
112 UIActionIndexST_M_Machine_S_Discard,
113 UIActionIndexST_M_Machine_S_ShowLogDialog,
114 UIActionIndexST_M_Machine_S_Refresh,
115 UIActionIndexST_M_Machine_S_ShowInFileManager,
116 UIActionIndexST_M_Machine_S_CreateShortcut,
117 UIActionIndexST_M_Machine_S_SortParent,
118 UIActionIndexST_M_Machine_S_Search,
119
120 /* Global Tools actions: */
121 UIActionIndexST_M_Tools_M_Global,
122 UIActionIndexST_M_Tools_M_Global_S_VirtualMediaManager,
123 UIActionIndexST_M_Tools_M_Global_S_HostNetworkManager,
124 UIActionIndexST_M_Tools_M_Global_S_CloudProfileManager,
125
126 /* Snapshot Pane actions: */
127 UIActionIndexST_M_Snapshot,
128 UIActionIndexST_M_Snapshot_S_Take,
129 UIActionIndexST_M_Snapshot_S_Delete,
130 UIActionIndexST_M_Snapshot_S_Restore,
131 UIActionIndexST_M_Snapshot_T_Properties,
132 UIActionIndexST_M_Snapshot_S_Clone,
133
134 /* Virtual Media Manager actions: */
135 UIActionIndexST_M_MediumWindow,
136 UIActionIndexST_M_Medium,
137 UIActionIndexST_M_Medium_S_Add,
138 UIActionIndexST_M_Medium_S_Create,
139 UIActionIndexST_M_Medium_S_Copy,
140 UIActionIndexST_M_Medium_S_Move,
141 UIActionIndexST_M_Medium_S_Remove,
142 UIActionIndexST_M_Medium_S_Release,
143 UIActionIndexST_M_Medium_T_Details,
144 UIActionIndexST_M_Medium_T_Search,
145 UIActionIndexST_M_Medium_S_Refresh,
146
147 /* Host Network Manager actions: */
148 UIActionIndexST_M_NetworkWindow,
149 UIActionIndexST_M_Network,
150 UIActionIndexST_M_Network_S_Create,
151 UIActionIndexST_M_Network_S_Remove,
152 UIActionIndexST_M_Network_T_Details,
153 UIActionIndexST_M_Network_S_Refresh,
154
155 /* Cloud Profile Manager actions: */
156 UIActionIndexST_M_CloudWindow,
157 UIActionIndexST_M_Cloud,
158 UIActionIndexST_M_Cloud_S_Add,
159 UIActionIndexST_M_Cloud_S_Import,
160 UIActionIndexST_M_Cloud_S_Remove,
161 UIActionIndexST_M_Cloud_T_Details,
162 UIActionIndexST_M_Cloud_S_TryPage,
163 UIActionIndexST_M_Cloud_S_Help,
164
165 /* Maximum index: */
166 UIActionIndexST_Max
167};
168
169
170/** UIActionPool extension
171 * representing action-pool singleton for Manager UI. */
172class SHARED_LIBRARY_STUFF UIActionPoolManager : public UIActionPool
173{
174 Q_OBJECT;
175
176protected:
177
178 /** Constructs action-pool.
179 * @param fTemporary Brings whether this action-pool is temporary,
180 * used to (re-)initialize shortcuts-pool. */
181 UIActionPoolManager(bool fTemporary = false);
182
183 /** Prepares pool. */
184 virtual void preparePool() /* override */;
185 /** Prepares connections. */
186 virtual void prepareConnections() /* override */;
187
188 /** Updates menu. */
189 virtual void updateMenu(int iIndex) /* override */;
190 /** Updates menus. */
191 virtual void updateMenus() /* override */;
192
193 /** Updates 'File' menu. */
194 void updateMenuFile();
195 /** Updates 'Welcome' menu. */
196 void updateMenuWelcome();
197 /** Updates 'Group' menu. */
198 void updateMenuGroup();
199 /** Updates 'Machine' menu. */
200 void updateMenuMachine();
201 /** Updates 'Group' / 'Start or Show' menu. */
202 void updateMenuGroupStartOrShow();
203 /** Updates 'Machine' / 'Start or Show' menu. */
204 void updateMenuMachineStartOrShow();
205 /** Updates 'Group' / 'Close' menu. */
206 void updateMenuGroupClose();
207 /** Updates 'Machine' / 'Close' menu. */
208 void updateMenuMachineClose();
209 /** Updates 'Group' / 'Tools' menu. */
210 void updateMenuGroupTools();
211 /** Updates 'Machine' / 'Tools' menu. */
212 void updateMenuMachineTools();
213
214 /** Updates 'Medium' window menu. */
215 void updateMenuMediumWindow();
216 /** Updates 'Medium' menu. */
217 void updateMenuMedium();
218 /** Updates 'Medium' @a pMenu. */
219 void updateMenuMediumWrapper(UIMenu *pMenu);
220
221 /** Updates 'Network' window menu. */
222 void updateMenuNetworkWindow();
223 /** Updates 'Network' menu. */
224 void updateMenuNetwork();
225 /** Updates 'Network' @a pMenu. */
226 void updateMenuNetworkWrapper(UIMenu *pMenu);
227
228 /** Updates 'Cloud' window menu. */
229 void updateMenuCloudWindow();
230 /** Updates 'Cloud' menu. */
231 void updateMenuCloud();
232 /** Updates 'Cloud' @a pMenu. */
233 void updateMenuCloudWrapper(UIMenu *pMenu);
234
235 /** Updates 'Snapshot' menu. */
236 void updateMenuSnapshot();
237
238 /** Updates shortcuts. */
239 virtual void updateShortcuts() /* override */;
240
241 /** Defines whether shortcuts of menu actions with specified @a iIndex should be visible. */
242 virtual void setShortcutsVisible(int iIndex, bool fVisible) /* override */;
243
244 /** Returns extra-data ID to save keyboard shortcuts under. */
245 virtual QString shortcutsExtraDataID() const /* override */;
246
247private:
248
249 /** Enables factory in base-class. */
250 friend class UIActionPool;
251};
252
253
254#endif /* !FEQT_INCLUDED_SRC_globals_UIActionPoolManager_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use