1 | /* $Id: UIActionPoolRuntime.cpp 104393 2024-04-22 13:02:56Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIActionPoolRuntime class implementation.
|
---|
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 | /* Qt includes: */
|
---|
29 | #include <QActionGroup>
|
---|
30 | #include <QApplication>
|
---|
31 |
|
---|
32 | /* GUI includes: */
|
---|
33 | #include "UICommon.h"
|
---|
34 | #include "UIActionPoolRuntime.h"
|
---|
35 | #include "UIConverter.h"
|
---|
36 | #include "UIDesktopWidgetWatchdog.h"
|
---|
37 | #include "UIExtraDataManager.h"
|
---|
38 | #include "UIGlobalSession.h"
|
---|
39 | #include "UIIconPool.h"
|
---|
40 | #include "UIShortcutPool.h"
|
---|
41 |
|
---|
42 | /* COM includes: */
|
---|
43 | #include "CExtPack.h"
|
---|
44 | #include "CExtPackManager.h"
|
---|
45 |
|
---|
46 | /* External includes: */
|
---|
47 | #include <math.h>
|
---|
48 |
|
---|
49 |
|
---|
50 | /* Namespaces: */
|
---|
51 | using namespace UIExtraDataDefs;
|
---|
52 |
|
---|
53 |
|
---|
54 | /** Menu action extension, used as 'Machine' menu class. */
|
---|
55 | class UIActionMenuRuntimeMachine : public UIActionMenu
|
---|
56 | {
|
---|
57 | Q_OBJECT;
|
---|
58 |
|
---|
59 | public:
|
---|
60 |
|
---|
61 | /** Constructs action passing @a pParent to the base-class. */
|
---|
62 | UIActionMenuRuntimeMachine(UIActionPool *pParent)
|
---|
63 | : UIActionMenu(pParent)
|
---|
64 | {}
|
---|
65 |
|
---|
66 | protected:
|
---|
67 |
|
---|
68 | /** Returns action extra-data ID. */
|
---|
69 | virtual int extraDataID() const RT_OVERRIDE
|
---|
70 | {
|
---|
71 | return UIExtraDataMetaDefs::MenuType_Machine;
|
---|
72 | }
|
---|
73 | /** Returns action extra-data key. */
|
---|
74 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
75 | {
|
---|
76 | return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuType_Machine);
|
---|
77 | }
|
---|
78 | /** Returns whether action is allowed. */
|
---|
79 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
80 | {
|
---|
81 | return actionPool()->isAllowedInMenuBar(UIExtraDataMetaDefs::MenuType_Machine);
|
---|
82 | }
|
---|
83 |
|
---|
84 | /** Handles translation event. */
|
---|
85 | virtual void retranslateUi() RT_OVERRIDE
|
---|
86 | {
|
---|
87 | setName(QApplication::translate("UIActionPool", "&Machine"));
|
---|
88 | }
|
---|
89 | };
|
---|
90 |
|
---|
91 | /** Simple action extension, used as 'Show Settings' action class. */
|
---|
92 | class UIActionSimpleRuntimeShowSettings : public UIActionSimple
|
---|
93 | {
|
---|
94 | Q_OBJECT;
|
---|
95 |
|
---|
96 | public:
|
---|
97 |
|
---|
98 | /** Constructs action passing @a pParent to the base-class. */
|
---|
99 | UIActionSimpleRuntimeShowSettings(UIActionPool *pParent)
|
---|
100 | : UIActionSimple(pParent, ":/vm_settings_16px.png", ":/vm_settings_disabled_16px.png", true)
|
---|
101 | {}
|
---|
102 |
|
---|
103 | protected:
|
---|
104 |
|
---|
105 | /** Returns action extra-data ID. */
|
---|
106 | virtual int extraDataID() const RT_OVERRIDE
|
---|
107 | {
|
---|
108 | return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SettingsDialog;
|
---|
109 | }
|
---|
110 | /** Returns action extra-data key. */
|
---|
111 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
112 | {
|
---|
113 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SettingsDialog);
|
---|
114 | }
|
---|
115 | /** Returns whether action is allowed. */
|
---|
116 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
117 | {
|
---|
118 | return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SettingsDialog);
|
---|
119 | }
|
---|
120 |
|
---|
121 | /** Returns shortcut extra-data ID. */
|
---|
122 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
123 | {
|
---|
124 | return QString("SettingsDialog");
|
---|
125 | }
|
---|
126 |
|
---|
127 | /** Returns default shortcut. */
|
---|
128 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
129 | {
|
---|
130 | return QKeySequence("S");
|
---|
131 | }
|
---|
132 |
|
---|
133 | /** Handles translation event. */
|
---|
134 | virtual void retranslateUi() RT_OVERRIDE
|
---|
135 | {
|
---|
136 | setName(QApplication::translate("UIActionPool", "&Settings..."));
|
---|
137 | setStatusTip(QApplication::translate("UIActionPool", "Display the virtual machine settings window"));
|
---|
138 | }
|
---|
139 | };
|
---|
140 |
|
---|
141 | /** Simple action extension, used as 'Perform Take Snapshot' action class. */
|
---|
142 | class UIActionSimpleRuntimePerformTakeSnapshot : public UIActionSimple
|
---|
143 | {
|
---|
144 | Q_OBJECT;
|
---|
145 |
|
---|
146 | public:
|
---|
147 |
|
---|
148 | /** Constructs action passing @a pParent to the base-class. */
|
---|
149 | UIActionSimpleRuntimePerformTakeSnapshot(UIActionPool *pParent)
|
---|
150 | : UIActionSimple(pParent, ":/snapshot_take_16px.png", ":/snapshot_take_disabled_16px.png", true)
|
---|
151 | {}
|
---|
152 |
|
---|
153 | protected:
|
---|
154 |
|
---|
155 | /** Returns action extra-data ID. */
|
---|
156 | virtual int extraDataID() const RT_OVERRIDE
|
---|
157 | {
|
---|
158 | return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_TakeSnapshot;
|
---|
159 | }
|
---|
160 | /** Returns action extra-data key. */
|
---|
161 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
162 | {
|
---|
163 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_TakeSnapshot);
|
---|
164 | }
|
---|
165 | /** Returns whether action is allowed. */
|
---|
166 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
167 | {
|
---|
168 | return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_TakeSnapshot);
|
---|
169 | }
|
---|
170 |
|
---|
171 | /** Returns shortcut extra-data ID. */
|
---|
172 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
173 | {
|
---|
174 | return QString("TakeSnapshot");
|
---|
175 | }
|
---|
176 |
|
---|
177 | /** Returns default shortcut. */
|
---|
178 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
179 | {
|
---|
180 | return QKeySequence("T");
|
---|
181 | }
|
---|
182 |
|
---|
183 | /** Handles translation event. */
|
---|
184 | virtual void retranslateUi() RT_OVERRIDE
|
---|
185 | {
|
---|
186 | setName(QApplication::translate("UIActionPool", "Take Sn&apshot..."));
|
---|
187 | setStatusTip(QApplication::translate("UIActionPool", "Take a snapshot of the virtual machine"));
|
---|
188 | }
|
---|
189 | };
|
---|
190 |
|
---|
191 | /** Simple action extension, used as 'Show Information Dialog' action class. */
|
---|
192 | class UIActionSimpleRuntimeShowInformationDialog : public UIActionSimple
|
---|
193 | {
|
---|
194 | Q_OBJECT;
|
---|
195 |
|
---|
196 | public:
|
---|
197 |
|
---|
198 | /** Constructs action passing @a pParent to the base-class. */
|
---|
199 | UIActionSimpleRuntimeShowInformationDialog(UIActionPool *pParent)
|
---|
200 | : UIActionSimple(pParent, ":/session_info_16px.png", ":/session_info_disabled_16px.png", true)
|
---|
201 | {}
|
---|
202 |
|
---|
203 | protected:
|
---|
204 |
|
---|
205 | /** Returns action extra-data ID. */
|
---|
206 | virtual int extraDataID() const RT_OVERRIDE
|
---|
207 | {
|
---|
208 | return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_InformationDialog;
|
---|
209 | }
|
---|
210 | /** Returns action extra-data key. */
|
---|
211 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
212 | {
|
---|
213 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_InformationDialog);
|
---|
214 | }
|
---|
215 | /** Returns whether action is allowed. */
|
---|
216 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
217 | {
|
---|
218 | return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_InformationDialog);
|
---|
219 | }
|
---|
220 |
|
---|
221 | /** Returns shortcut extra-data ID. */
|
---|
222 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
223 | {
|
---|
224 | return QString("InformationDialog");
|
---|
225 | }
|
---|
226 |
|
---|
227 | /** Returns default shortcut. */
|
---|
228 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
229 | {
|
---|
230 | return QKeySequence("N");
|
---|
231 | }
|
---|
232 |
|
---|
233 | /** Handles translation event. */
|
---|
234 | virtual void retranslateUi() RT_OVERRIDE
|
---|
235 | {
|
---|
236 | setName(QApplication::translate("UIActionPool", "Session I&nformation..."));
|
---|
237 | setStatusTip(QApplication::translate("UIActionPool", "Display the virtual machine session information window"));
|
---|
238 | }
|
---|
239 | };
|
---|
240 |
|
---|
241 | /** Simple action extension, used as 'Show File Manager Dialog' action class. */
|
---|
242 | class UIActionSimpleRuntimeShowFileManagerDialog : public UIActionSimple
|
---|
243 | {
|
---|
244 | Q_OBJECT;
|
---|
245 |
|
---|
246 | public:
|
---|
247 |
|
---|
248 | /** Constructs action passing @a pParent to the base-class. */
|
---|
249 | UIActionSimpleRuntimeShowFileManagerDialog(UIActionPool *pParent)
|
---|
250 | : UIActionSimple(pParent, ":/file_manager_16px.png", ":/file_manager_disabled_16px.png", true)
|
---|
251 | {}
|
---|
252 |
|
---|
253 | protected:
|
---|
254 |
|
---|
255 | /** Returns action extra-data ID. */
|
---|
256 | virtual int extraDataID() const RT_OVERRIDE
|
---|
257 | {
|
---|
258 | return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_FileManagerDialog;
|
---|
259 | }
|
---|
260 | /** Returns action extra-data key. */
|
---|
261 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
262 | {
|
---|
263 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_FileManagerDialog);
|
---|
264 | }
|
---|
265 | /** Returns whether action is allowed. */
|
---|
266 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
267 | {
|
---|
268 | return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_FileManagerDialog);
|
---|
269 | }
|
---|
270 |
|
---|
271 | /** Returns shortcut extra-data ID. */
|
---|
272 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
273 | {
|
---|
274 | return QString("FileManagerDialog");
|
---|
275 | }
|
---|
276 |
|
---|
277 | /** Returns default shortcut. */
|
---|
278 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
279 | {
|
---|
280 | return QKeySequence();
|
---|
281 | }
|
---|
282 |
|
---|
283 | /** Handles translation event. */
|
---|
284 | virtual void retranslateUi() RT_OVERRIDE
|
---|
285 | {
|
---|
286 | setName(QApplication::translate("UIActionPool", "File Manager..."));
|
---|
287 | setStatusTip(QApplication::translate("UIActionPool", "Display the virtual machine file manager window"));
|
---|
288 | }
|
---|
289 | };
|
---|
290 |
|
---|
291 | /** Toggle action extension, used as 'Pause' action class. */
|
---|
292 | class UIActionToggleRuntimePause : public UIActionToggle
|
---|
293 | {
|
---|
294 | Q_OBJECT;
|
---|
295 |
|
---|
296 | public:
|
---|
297 |
|
---|
298 | /** Constructs action passing @a pParent to the base-class. */
|
---|
299 | UIActionToggleRuntimePause(UIActionPool *pParent)
|
---|
300 | : UIActionToggle(pParent,
|
---|
301 | ":/vm_pause_on_16px.png", ":/vm_pause_16px.png",
|
---|
302 | ":/vm_pause_on_disabled_16px.png", ":/vm_pause_disabled_16px.png",
|
---|
303 | true)
|
---|
304 | {}
|
---|
305 |
|
---|
306 | protected:
|
---|
307 |
|
---|
308 | /** Returns action extra-data ID. */
|
---|
309 | virtual int extraDataID() const RT_OVERRIDE
|
---|
310 | {
|
---|
311 | return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Pause;
|
---|
312 | }
|
---|
313 | /** Returns action extra-data key. */
|
---|
314 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
315 | {
|
---|
316 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Pause);
|
---|
317 | }
|
---|
318 | /** Returns whether action is allowed. */
|
---|
319 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
320 | {
|
---|
321 | return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Pause);
|
---|
322 | }
|
---|
323 |
|
---|
324 | /** Returns shortcut extra-data ID. */
|
---|
325 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
326 | {
|
---|
327 | return QString("Pause");
|
---|
328 | }
|
---|
329 |
|
---|
330 | /** Returns default shortcut. */
|
---|
331 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
332 | {
|
---|
333 | return QKeySequence("P");
|
---|
334 | }
|
---|
335 |
|
---|
336 | /** Handles translation event. */
|
---|
337 | virtual void retranslateUi() RT_OVERRIDE
|
---|
338 | {
|
---|
339 | setName(QApplication::translate("UIActionPool", "&Pause"));
|
---|
340 | setStatusTip(QApplication::translate("UIActionPool", "Suspend the execution of the virtual machine"));
|
---|
341 | }
|
---|
342 | };
|
---|
343 |
|
---|
344 | /** Simple action extension, used as 'Perform Reset' action class. */
|
---|
345 | class UIActionSimpleRuntimePerformReset : public UIActionSimple
|
---|
346 | {
|
---|
347 | Q_OBJECT;
|
---|
348 |
|
---|
349 | public:
|
---|
350 |
|
---|
351 | /** Constructs action passing @a pParent to the base-class. */
|
---|
352 | UIActionSimpleRuntimePerformReset(UIActionPool *pParent)
|
---|
353 | : UIActionSimple(pParent, ":/vm_reset_16px.png", ":/vm_reset_disabled_16px.png", true)
|
---|
354 | {}
|
---|
355 |
|
---|
356 | protected:
|
---|
357 |
|
---|
358 | /** Returns action extra-data ID. */
|
---|
359 | virtual int extraDataID() const RT_OVERRIDE
|
---|
360 | {
|
---|
361 | return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Reset;
|
---|
362 | }
|
---|
363 | /** Returns action extra-data key. */
|
---|
364 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
365 | {
|
---|
366 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Reset);
|
---|
367 | }
|
---|
368 | /** Returns whether action is allowed. */
|
---|
369 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
370 | {
|
---|
371 | return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Reset);
|
---|
372 | }
|
---|
373 |
|
---|
374 | /** Returns shortcut extra-data ID. */
|
---|
375 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
376 | {
|
---|
377 | return QString("Reset");
|
---|
378 | }
|
---|
379 |
|
---|
380 | /** Returns default shortcut. */
|
---|
381 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
382 | {
|
---|
383 | return QKeySequence("R");
|
---|
384 | }
|
---|
385 |
|
---|
386 | /** Handles translation event. */
|
---|
387 | virtual void retranslateUi() RT_OVERRIDE
|
---|
388 | {
|
---|
389 | setName(QApplication::translate("UIActionPool", "&Reset"));
|
---|
390 | setStatusTip(QApplication::translate("UIActionPool", "Reset the virtual machine"));
|
---|
391 | }
|
---|
392 | };
|
---|
393 |
|
---|
394 | /** Simple action extension, used as 'Perform Detach' action class. */
|
---|
395 | class UIActionSimpleRuntimePerformDetach : public UIActionSimple
|
---|
396 | {
|
---|
397 | Q_OBJECT;
|
---|
398 |
|
---|
399 | public:
|
---|
400 |
|
---|
401 | /** Constructs action passing @a pParent to the base-class. */
|
---|
402 | UIActionSimpleRuntimePerformDetach(UIActionPool *pParent)
|
---|
403 | : UIActionSimple(pParent, ":/vm_create_shortcut_16px.png", ":/vm_create_shortcut_disabled_16px.png", true)
|
---|
404 | {}
|
---|
405 |
|
---|
406 | protected:
|
---|
407 |
|
---|
408 | /** Returns action extra-data ID. */
|
---|
409 | virtual int extraDataID() const RT_OVERRIDE
|
---|
410 | {
|
---|
411 | return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Detach;
|
---|
412 | }
|
---|
413 | /** Returns action extra-data key. */
|
---|
414 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
415 | {
|
---|
416 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Detach);
|
---|
417 | }
|
---|
418 | /** Returns whether action is allowed. */
|
---|
419 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
420 | {
|
---|
421 | return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Detach);
|
---|
422 | }
|
---|
423 |
|
---|
424 | /** Returns shortcut extra-data ID. */
|
---|
425 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
426 | {
|
---|
427 | return QString("DetachUI");
|
---|
428 | }
|
---|
429 |
|
---|
430 | /** Handles translation event. */
|
---|
431 | virtual void retranslateUi() RT_OVERRIDE
|
---|
432 | {
|
---|
433 | setName(QApplication::translate("UIActionPool", "&Detach GUI"));
|
---|
434 | setStatusTip(QApplication::translate("UIActionPool", "Detach the GUI from headless VM"));
|
---|
435 | }
|
---|
436 | };
|
---|
437 |
|
---|
438 | /** Simple action extension, used as 'Perform Save State' action class. */
|
---|
439 | class UIActionSimpleRuntimePerformSaveState : public UIActionSimple
|
---|
440 | {
|
---|
441 | Q_OBJECT;
|
---|
442 |
|
---|
443 | public:
|
---|
444 |
|
---|
445 | /** Constructs action passing @a pParent to the base-class. */
|
---|
446 | UIActionSimpleRuntimePerformSaveState(UIActionPool *pParent)
|
---|
447 | : UIActionSimple(pParent, ":/vm_save_state_16px.png", ":/vm_save_state_disabled_16px.png", true)
|
---|
448 | {}
|
---|
449 |
|
---|
450 | protected:
|
---|
451 |
|
---|
452 | /** Returns action extra-data ID. */
|
---|
453 | virtual int extraDataID() const RT_OVERRIDE
|
---|
454 | {
|
---|
455 | return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SaveState;
|
---|
456 | }
|
---|
457 | /** Returns action extra-data key. */
|
---|
458 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
459 | {
|
---|
460 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SaveState);
|
---|
461 | }
|
---|
462 | /** Returns whether action is allowed. */
|
---|
463 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
464 | {
|
---|
465 | return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SaveState);
|
---|
466 | }
|
---|
467 |
|
---|
468 | /** Returns shortcut extra-data ID. */
|
---|
469 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
470 | {
|
---|
471 | return QString("SaveState");
|
---|
472 | }
|
---|
473 |
|
---|
474 | /** Handles translation event. */
|
---|
475 | virtual void retranslateUi() RT_OVERRIDE
|
---|
476 | {
|
---|
477 | setName(QApplication::translate("UIActionPool", "&Save State"));
|
---|
478 | setStatusTip(QApplication::translate("UIActionPool", "Save the state of the virtual machine"));
|
---|
479 | }
|
---|
480 | };
|
---|
481 |
|
---|
482 | /** Simple action extension, used as 'Perform Shutdown' action class. */
|
---|
483 | class UIActionSimpleRuntimePerformShutdown : public UIActionSimple
|
---|
484 | {
|
---|
485 | Q_OBJECT;
|
---|
486 |
|
---|
487 | public:
|
---|
488 |
|
---|
489 | /** Constructs action passing @a pParent to the base-class. */
|
---|
490 | UIActionSimpleRuntimePerformShutdown(UIActionPool *pParent)
|
---|
491 | : UIActionSimple(pParent, ":/vm_shutdown_16px.png", ":/vm_shutdown_disabled_16px.png", true)
|
---|
492 | {}
|
---|
493 |
|
---|
494 | protected:
|
---|
495 |
|
---|
496 | /** Returns action extra-data ID. */
|
---|
497 | virtual int extraDataID() const RT_OVERRIDE
|
---|
498 | {
|
---|
499 | return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Shutdown;
|
---|
500 | }
|
---|
501 | /** Returns action extra-data key. */
|
---|
502 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
503 | {
|
---|
504 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Shutdown);
|
---|
505 | }
|
---|
506 | /** Returns whether action is allowed. */
|
---|
507 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
508 | {
|
---|
509 | return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Shutdown);
|
---|
510 | }
|
---|
511 |
|
---|
512 | /** Returns shortcut extra-data ID. */
|
---|
513 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
514 | {
|
---|
515 | return QString("Shutdown");
|
---|
516 | }
|
---|
517 |
|
---|
518 | /** Returns default shortcut. */
|
---|
519 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
520 | {
|
---|
521 | #ifdef VBOX_WS_MAC
|
---|
522 | return QKeySequence("U");
|
---|
523 | #else
|
---|
524 | return QKeySequence("H");
|
---|
525 | #endif
|
---|
526 | }
|
---|
527 |
|
---|
528 | /** Handles translation event. */
|
---|
529 | virtual void retranslateUi() RT_OVERRIDE
|
---|
530 | {
|
---|
531 | setName(QApplication::translate("UIActionPool", "ACPI Sh&utdown"));
|
---|
532 | setStatusTip(QApplication::translate("UIActionPool", "Send the ACPI Shutdown signal to the virtual machine"));
|
---|
533 | }
|
---|
534 | };
|
---|
535 |
|
---|
536 | /** Simple action extension, used as 'Perform PowerOff' action class. */
|
---|
537 | class UIActionSimpleRuntimePerformPowerOff : public UIActionSimple
|
---|
538 | {
|
---|
539 | Q_OBJECT;
|
---|
540 |
|
---|
541 | public:
|
---|
542 |
|
---|
543 | /** Constructs action passing @a pParent to the base-class. */
|
---|
544 | UIActionSimpleRuntimePerformPowerOff(UIActionPool *pParent)
|
---|
545 | : UIActionSimple(pParent, ":/vm_poweroff_16px.png", ":/vm_poweroff_disabled_16px.png", true)
|
---|
546 | {}
|
---|
547 |
|
---|
548 | protected:
|
---|
549 |
|
---|
550 | /** Returns action extra-data ID. */
|
---|
551 | virtual int extraDataID() const RT_OVERRIDE
|
---|
552 | {
|
---|
553 | return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_PowerOff;
|
---|
554 | }
|
---|
555 | /** Returns action extra-data key. */
|
---|
556 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
557 | {
|
---|
558 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_PowerOff);
|
---|
559 | }
|
---|
560 | /** Returns whether action is allowed. */
|
---|
561 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
562 | {
|
---|
563 | return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_PowerOff);
|
---|
564 | }
|
---|
565 |
|
---|
566 | /** Returns shortcut extra-data ID. */
|
---|
567 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
568 | {
|
---|
569 | return QString("PowerOff");
|
---|
570 | }
|
---|
571 |
|
---|
572 | /** Handles translation event. */
|
---|
573 | virtual void retranslateUi() RT_OVERRIDE
|
---|
574 | {
|
---|
575 | setName(QApplication::translate("UIActionPool", "Po&wer Off"));
|
---|
576 | setStatusTip(QApplication::translate("UIActionPool", "Power off the virtual machine"));
|
---|
577 | }
|
---|
578 | };
|
---|
579 |
|
---|
580 | /** Simple action extension, used as 'Show Logs' action class. */
|
---|
581 | class UIActionSimpleRuntimeShowLogs : public UIActionSimple
|
---|
582 | {
|
---|
583 | Q_OBJECT;
|
---|
584 |
|
---|
585 | public:
|
---|
586 |
|
---|
587 | /** Constructs action passing @a pParent to the base-class. */
|
---|
588 | UIActionSimpleRuntimeShowLogs(UIActionPool *pParent)
|
---|
589 | : UIActionSimple(pParent, ":/vm_show_logs_16px.png", ":/vm_show_logs_disabled_16px.png", true)
|
---|
590 | {}
|
---|
591 |
|
---|
592 | protected:
|
---|
593 |
|
---|
594 | /** Returns action extra-data ID. */
|
---|
595 | virtual int extraDataID() const RT_OVERRIDE
|
---|
596 | {
|
---|
597 | return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_LogDialog;
|
---|
598 | }
|
---|
599 | /** Returns action extra-data key. */
|
---|
600 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
601 | {
|
---|
602 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_LogDialog);
|
---|
603 | }
|
---|
604 | /** Returns whether action is allowed. */
|
---|
605 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
606 | {
|
---|
607 | return actionPool()->toRuntime()->isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType_LogDialog);
|
---|
608 | }
|
---|
609 |
|
---|
610 | /** Returns shortcut extra-data ID. */
|
---|
611 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
612 | {
|
---|
613 | return QString("LogWindow");
|
---|
614 | }
|
---|
615 |
|
---|
616 | /** Handles translation event. */
|
---|
617 | virtual void retranslateUi() RT_OVERRIDE
|
---|
618 | {
|
---|
619 | setName(QApplication::translate("UIActionPool", "Show &Log..."));
|
---|
620 | setStatusTip(QApplication::translate("UIActionPool", "Display the log viewer window"));
|
---|
621 | }
|
---|
622 | };
|
---|
623 |
|
---|
624 | /** Menu action extension, used as 'View' menu class. */
|
---|
625 | class UIActionMenuRuntimeView : public UIActionMenu
|
---|
626 | {
|
---|
627 | Q_OBJECT;
|
---|
628 |
|
---|
629 | public:
|
---|
630 |
|
---|
631 | /** Constructs action passing @a pParent to the base-class. */
|
---|
632 | UIActionMenuRuntimeView(UIActionPool *pParent)
|
---|
633 | : UIActionMenu(pParent)
|
---|
634 | {}
|
---|
635 |
|
---|
636 | protected:
|
---|
637 |
|
---|
638 | /** Returns action extra-data ID. */
|
---|
639 | virtual int extraDataID() const RT_OVERRIDE
|
---|
640 | {
|
---|
641 | return UIExtraDataMetaDefs::MenuType_View;
|
---|
642 | }
|
---|
643 | /** Returns action extra-data key. */
|
---|
644 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
645 | {
|
---|
646 | return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuType_View);
|
---|
647 | }
|
---|
648 | /** Returns whether action is allowed. */
|
---|
649 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
650 | {
|
---|
651 | return actionPool()->isAllowedInMenuBar(UIExtraDataMetaDefs::MenuType_View);
|
---|
652 | }
|
---|
653 |
|
---|
654 | /** Handles translation event. */
|
---|
655 | virtual void retranslateUi() RT_OVERRIDE
|
---|
656 | {
|
---|
657 | setName(QApplication::translate("UIActionPool", "&View"));
|
---|
658 | }
|
---|
659 | };
|
---|
660 |
|
---|
661 | /** Menu action extension, used as 'View Popup' menu class. */
|
---|
662 | class UIActionMenuRuntimeViewPopup : public UIActionMenu
|
---|
663 | {
|
---|
664 | Q_OBJECT;
|
---|
665 |
|
---|
666 | public:
|
---|
667 |
|
---|
668 | /** Constructs action passing @a pParent to the base-class. */
|
---|
669 | UIActionMenuRuntimeViewPopup(UIActionPool *pParent)
|
---|
670 | : UIActionMenu(pParent)
|
---|
671 | {}
|
---|
672 |
|
---|
673 | protected:
|
---|
674 |
|
---|
675 | /** Returns action extra-data ID. */
|
---|
676 | virtual int extraDataID() const RT_OVERRIDE
|
---|
677 | {
|
---|
678 | return UIExtraDataMetaDefs::MenuType_View;
|
---|
679 | }
|
---|
680 | /** Returns action extra-data key. */
|
---|
681 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
682 | {
|
---|
683 | return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuType_View);
|
---|
684 | }
|
---|
685 | /** Returns whether action is allowed. */
|
---|
686 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
687 | {
|
---|
688 | return actionPool()->isAllowedInMenuBar(UIExtraDataMetaDefs::MenuType_View);
|
---|
689 | }
|
---|
690 |
|
---|
691 | /** Handles translation event. */
|
---|
692 | virtual void retranslateUi() RT_OVERRIDE {}
|
---|
693 | };
|
---|
694 |
|
---|
695 | /** Toggle action extension, used as 'Full-screen Mode' action class. */
|
---|
696 | class UIActionToggleRuntimeFullscreenMode : public UIActionToggle
|
---|
697 | {
|
---|
698 | Q_OBJECT;
|
---|
699 |
|
---|
700 | public:
|
---|
701 |
|
---|
702 | /** Constructs action passing @a pParent to the base-class. */
|
---|
703 | UIActionToggleRuntimeFullscreenMode(UIActionPool *pParent)
|
---|
704 | : UIActionToggle(pParent,
|
---|
705 | ":/fullscreen_on_16px.png", ":/fullscreen_16px.png",
|
---|
706 | ":/fullscreen_on_disabled_16px.png", ":/fullscreen_disabled_16px.png",
|
---|
707 | true)
|
---|
708 | {}
|
---|
709 |
|
---|
710 | protected:
|
---|
711 |
|
---|
712 | /** Returns action extra-data ID. */
|
---|
713 | virtual int extraDataID() const RT_OVERRIDE
|
---|
714 | {
|
---|
715 | return UIExtraDataMetaDefs::RuntimeMenuViewActionType_Fullscreen;
|
---|
716 | }
|
---|
717 | /** Returns action extra-data key. */
|
---|
718 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
719 | {
|
---|
720 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Fullscreen);
|
---|
721 | }
|
---|
722 | /** Returns whether action is allowed. */
|
---|
723 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
724 | {
|
---|
725 | return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Fullscreen);
|
---|
726 | }
|
---|
727 |
|
---|
728 | /** Returns shortcut extra-data ID. */
|
---|
729 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
730 | {
|
---|
731 | return QString("FullscreenMode");
|
---|
732 | }
|
---|
733 |
|
---|
734 | /** Returns default shortcut. */
|
---|
735 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
736 | {
|
---|
737 | return QKeySequence("F");
|
---|
738 | }
|
---|
739 |
|
---|
740 | /** Handles translation event. */
|
---|
741 | virtual void retranslateUi() RT_OVERRIDE
|
---|
742 | {
|
---|
743 | setName(QApplication::translate("UIActionPool", "&Full-screen Mode"));
|
---|
744 | setStatusTip(QApplication::translate("UIActionPool", "Switch between normal and full-screen mode"));
|
---|
745 | }
|
---|
746 | };
|
---|
747 |
|
---|
748 | /** Toggle action extension, used as 'Seamless Mode' action class. */
|
---|
749 | class UIActionToggleRuntimeSeamlessMode : public UIActionToggle
|
---|
750 | {
|
---|
751 | Q_OBJECT;
|
---|
752 |
|
---|
753 | public:
|
---|
754 |
|
---|
755 | /** Constructs action passing @a pParent to the base-class. */
|
---|
756 | UIActionToggleRuntimeSeamlessMode(UIActionPool *pParent)
|
---|
757 | : UIActionToggle(pParent,
|
---|
758 | ":/seamless_on_16px.png", ":/seamless_16px.png",
|
---|
759 | ":/seamless_on_disabled_16px.png", ":/seamless_disabled_16px.png",
|
---|
760 | true)
|
---|
761 | {}
|
---|
762 |
|
---|
763 | protected:
|
---|
764 |
|
---|
765 | /** Returns action extra-data ID. */
|
---|
766 | virtual int extraDataID() const RT_OVERRIDE
|
---|
767 | {
|
---|
768 | return UIExtraDataMetaDefs::RuntimeMenuViewActionType_Seamless;
|
---|
769 | }
|
---|
770 | /** Returns action extra-data key. */
|
---|
771 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
772 | {
|
---|
773 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Seamless);
|
---|
774 | }
|
---|
775 | /** Returns whether action is allowed. */
|
---|
776 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
777 | {
|
---|
778 | return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Seamless);
|
---|
779 | }
|
---|
780 |
|
---|
781 | /** Returns shortcut extra-data ID. */
|
---|
782 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
783 | {
|
---|
784 | return QString("SeamlessMode");
|
---|
785 | }
|
---|
786 |
|
---|
787 | /** Returns default shortcut. */
|
---|
788 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
789 | {
|
---|
790 | return QKeySequence("L");
|
---|
791 | }
|
---|
792 |
|
---|
793 | /** Handles translation event. */
|
---|
794 | virtual void retranslateUi() RT_OVERRIDE
|
---|
795 | {
|
---|
796 | setName(QApplication::translate("UIActionPool", "Seam&less Mode"));
|
---|
797 | setStatusTip(QApplication::translate("UIActionPool", "Switch between normal and seamless desktop integration mode"));
|
---|
798 | }
|
---|
799 | };
|
---|
800 |
|
---|
801 | /** Toggle action extension, used as 'Scaled Mode' action class. */
|
---|
802 | class UIActionToggleRuntimeScaledMode : public UIActionToggle
|
---|
803 | {
|
---|
804 | Q_OBJECT;
|
---|
805 |
|
---|
806 | public:
|
---|
807 |
|
---|
808 | /** Constructs action passing @a pParent to the base-class. */
|
---|
809 | UIActionToggleRuntimeScaledMode(UIActionPool *pParent)
|
---|
810 | : UIActionToggle(pParent,
|
---|
811 | ":/scale_on_16px.png", ":/scale_16px.png",
|
---|
812 | ":/scale_on_disabled_16px.png", ":/scale_disabled_16px.png",
|
---|
813 | true)
|
---|
814 | {}
|
---|
815 |
|
---|
816 | protected:
|
---|
817 |
|
---|
818 | /** Returns action extra-data ID. */
|
---|
819 | virtual int extraDataID() const RT_OVERRIDE
|
---|
820 | {
|
---|
821 | return UIExtraDataMetaDefs::RuntimeMenuViewActionType_Scale;
|
---|
822 | }
|
---|
823 | /** Returns action extra-data key. */
|
---|
824 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
825 | {
|
---|
826 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Scale);
|
---|
827 | }
|
---|
828 | /** Returns whether action is allowed. */
|
---|
829 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
830 | {
|
---|
831 | return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Scale);
|
---|
832 | }
|
---|
833 |
|
---|
834 | /** Returns shortcut extra-data ID. */
|
---|
835 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
836 | {
|
---|
837 | return QString("ScaleMode");
|
---|
838 | }
|
---|
839 |
|
---|
840 | /** Returns default shortcut. */
|
---|
841 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
842 | {
|
---|
843 | return QKeySequence("C");
|
---|
844 | }
|
---|
845 |
|
---|
846 | /** Handles translation event. */
|
---|
847 | virtual void retranslateUi() RT_OVERRIDE
|
---|
848 | {
|
---|
849 | setName(QApplication::translate("UIActionPool", "S&caled Mode"));
|
---|
850 | setStatusTip(QApplication::translate("UIActionPool", "Switch between normal and scaled mode"));
|
---|
851 | }
|
---|
852 | };
|
---|
853 |
|
---|
854 | #ifndef VBOX_WS_MAC
|
---|
855 | /** Simple action extension, used as 'Perform Minimize Window' action class. */
|
---|
856 | class UIActionSimpleRuntimePerformMinimizeWindow : public UIActionSimple
|
---|
857 | {
|
---|
858 | Q_OBJECT;
|
---|
859 |
|
---|
860 | public:
|
---|
861 |
|
---|
862 | /** Constructs action passing @a pParent to the base-class. */
|
---|
863 | UIActionSimpleRuntimePerformMinimizeWindow(UIActionPool *pParent)
|
---|
864 | : UIActionSimple(pParent, ":/minimize_16px.png", ":/minimize_16px.png", true)
|
---|
865 | {}
|
---|
866 |
|
---|
867 | protected:
|
---|
868 |
|
---|
869 | /** Returns action extra-data ID. */
|
---|
870 | virtual int extraDataID() const RT_OVERRIDE
|
---|
871 | {
|
---|
872 | return UIExtraDataMetaDefs::RuntimeMenuViewActionType_MinimizeWindow;
|
---|
873 | }
|
---|
874 | /** Returns action extra-data key. */
|
---|
875 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
876 | {
|
---|
877 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_MinimizeWindow);
|
---|
878 | }
|
---|
879 | /** Returns whether action is allowed. */
|
---|
880 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
881 | {
|
---|
882 | return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_MinimizeWindow);
|
---|
883 | }
|
---|
884 |
|
---|
885 | /** Returns shortcut extra-data ID. */
|
---|
886 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
887 | {
|
---|
888 | return QString("WindowMinimize");
|
---|
889 | }
|
---|
890 |
|
---|
891 | /** Returns default shortcut. */
|
---|
892 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
893 | {
|
---|
894 | return QKeySequence("M");
|
---|
895 | }
|
---|
896 |
|
---|
897 | /** Handles translation event. */
|
---|
898 | virtual void retranslateUi() RT_OVERRIDE
|
---|
899 | {
|
---|
900 | setName(QApplication::translate("UIActionPool", "&Minimize Window"));
|
---|
901 | setStatusTip(QApplication::translate("UIActionPool", "Minimize active window"));
|
---|
902 | }
|
---|
903 | };
|
---|
904 | #endif /* !VBOX_WS_MAC */
|
---|
905 |
|
---|
906 | /** Simple action extension, used as 'Perform Window Adjust' action class. */
|
---|
907 | class UIActionSimpleRuntimePerformWindowAdjust : public UIActionSimple
|
---|
908 | {
|
---|
909 | Q_OBJECT;
|
---|
910 |
|
---|
911 | public:
|
---|
912 |
|
---|
913 | /** Constructs action passing @a pParent to the base-class. */
|
---|
914 | UIActionSimpleRuntimePerformWindowAdjust(UIActionPool *pParent)
|
---|
915 | : UIActionSimple(pParent, ":/adjust_win_size_16px.png", ":/adjust_win_size_disabled_16px.png", true)
|
---|
916 | {}
|
---|
917 |
|
---|
918 | protected:
|
---|
919 |
|
---|
920 | /** Returns action extra-data ID. */
|
---|
921 | virtual int extraDataID() const RT_OVERRIDE
|
---|
922 | {
|
---|
923 | return UIExtraDataMetaDefs::RuntimeMenuViewActionType_AdjustWindow;
|
---|
924 | }
|
---|
925 | /** Returns action extra-data key. */
|
---|
926 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
927 | {
|
---|
928 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_AdjustWindow);
|
---|
929 | }
|
---|
930 | /** Returns whether action is allowed. */
|
---|
931 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
932 | {
|
---|
933 | return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_AdjustWindow);
|
---|
934 | }
|
---|
935 |
|
---|
936 | /** Returns shortcut extra-data ID. */
|
---|
937 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
938 | {
|
---|
939 | return QString("WindowAdjust");
|
---|
940 | }
|
---|
941 |
|
---|
942 | /** Returns default shortcut. */
|
---|
943 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
944 | {
|
---|
945 | return QKeySequence("A");
|
---|
946 | }
|
---|
947 |
|
---|
948 | /** Handles translation event. */
|
---|
949 | virtual void retranslateUi() RT_OVERRIDE
|
---|
950 | {
|
---|
951 | setName(QApplication::translate("UIActionPool", "&Adjust Window Size"));
|
---|
952 | setStatusTip(QApplication::translate("UIActionPool", "Adjust window size and position to best fit the guest display"));
|
---|
953 | }
|
---|
954 | };
|
---|
955 |
|
---|
956 | /** Toggle action extension, used as 'Guest Autoresize' action class. */
|
---|
957 | class UIActionToggleRuntimeGuestAutoresize : public UIActionToggle
|
---|
958 | {
|
---|
959 | Q_OBJECT;
|
---|
960 |
|
---|
961 | public:
|
---|
962 |
|
---|
963 | /** Constructs action passing @a pParent to the base-class. */
|
---|
964 | UIActionToggleRuntimeGuestAutoresize(UIActionPool *pParent)
|
---|
965 | : UIActionToggle(pParent,
|
---|
966 | ":/auto_resize_on_on_16px.png", ":/auto_resize_on_16px.png",
|
---|
967 | ":/auto_resize_on_on_disabled_16px.png", ":/auto_resize_on_disabled_16px.png",
|
---|
968 | true)
|
---|
969 | {}
|
---|
970 |
|
---|
971 | protected:
|
---|
972 |
|
---|
973 | /** Returns action extra-data ID. */
|
---|
974 | virtual int extraDataID() const RT_OVERRIDE
|
---|
975 | {
|
---|
976 | return UIExtraDataMetaDefs::RuntimeMenuViewActionType_GuestAutoresize;
|
---|
977 | }
|
---|
978 | /** Returns action extra-data key. */
|
---|
979 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
980 | {
|
---|
981 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_GuestAutoresize);
|
---|
982 | }
|
---|
983 | /** Returns whether action is allowed. */
|
---|
984 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
985 | {
|
---|
986 | return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_GuestAutoresize);
|
---|
987 | }
|
---|
988 |
|
---|
989 | /** Returns shortcut extra-data ID. */
|
---|
990 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
991 | {
|
---|
992 | return QString("GuestAutoresize");
|
---|
993 | }
|
---|
994 |
|
---|
995 | /** Handles translation event. */
|
---|
996 | virtual void retranslateUi() RT_OVERRIDE
|
---|
997 | {
|
---|
998 | setName(QApplication::translate("UIActionPool", "Auto-resize &Guest Display"));
|
---|
999 | setStatusTip(QApplication::translate("UIActionPool", "Automatically resize the guest display when the window is resized"));
|
---|
1000 | }
|
---|
1001 | };
|
---|
1002 |
|
---|
1003 | /** Simple action extension, used as 'Perform Take Screenshot' action class. */
|
---|
1004 | class UIActionSimpleRuntimePerformTakeScreenshot : public UIActionSimple
|
---|
1005 | {
|
---|
1006 | Q_OBJECT;
|
---|
1007 |
|
---|
1008 | public:
|
---|
1009 |
|
---|
1010 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1011 | UIActionSimpleRuntimePerformTakeScreenshot(UIActionPool *pParent)
|
---|
1012 | : UIActionSimple(pParent, ":/screenshot_take_16px.png", ":/screenshot_take_disabled_16px.png", true)
|
---|
1013 | {}
|
---|
1014 |
|
---|
1015 | protected:
|
---|
1016 |
|
---|
1017 | /** Returns action extra-data ID. */
|
---|
1018 | virtual int extraDataID() const RT_OVERRIDE
|
---|
1019 | {
|
---|
1020 | return UIExtraDataMetaDefs::RuntimeMenuViewActionType_TakeScreenshot;
|
---|
1021 | }
|
---|
1022 | /** Returns action extra-data key. */
|
---|
1023 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
1024 | {
|
---|
1025 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_TakeScreenshot);
|
---|
1026 | }
|
---|
1027 | /** Returns whether action is allowed. */
|
---|
1028 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
1029 | {
|
---|
1030 | return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_TakeScreenshot);
|
---|
1031 | }
|
---|
1032 |
|
---|
1033 | /** Returns shortcut extra-data ID. */
|
---|
1034 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1035 | {
|
---|
1036 | return QString("TakeScreenshot");
|
---|
1037 | }
|
---|
1038 |
|
---|
1039 | /** Returns default shortcut. */
|
---|
1040 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
1041 | {
|
---|
1042 | return QKeySequence("E");
|
---|
1043 | }
|
---|
1044 |
|
---|
1045 | /** Handles translation event. */
|
---|
1046 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1047 | {
|
---|
1048 | setName(QApplication::translate("UIActionPool", "Take Screensh&ot..."));
|
---|
1049 | setStatusTip(QApplication::translate("UIActionPool", "Take guest display screenshot"));
|
---|
1050 | }
|
---|
1051 | };
|
---|
1052 |
|
---|
1053 | /** Menu action extension, used as 'View' menu class. */
|
---|
1054 | class UIActionMenuRuntimeRecording : public UIActionMenu
|
---|
1055 | {
|
---|
1056 | Q_OBJECT;
|
---|
1057 |
|
---|
1058 | public:
|
---|
1059 |
|
---|
1060 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1061 | UIActionMenuRuntimeRecording(UIActionPool *pParent)
|
---|
1062 | : UIActionMenu(pParent)
|
---|
1063 | {}
|
---|
1064 |
|
---|
1065 | protected:
|
---|
1066 |
|
---|
1067 | /** Returns action extra-data ID. */
|
---|
1068 | virtual int extraDataID() const RT_OVERRIDE
|
---|
1069 | {
|
---|
1070 | return UIExtraDataMetaDefs::RuntimeMenuViewActionType_Recording;
|
---|
1071 | }
|
---|
1072 | /** Returns action extra-data key. */
|
---|
1073 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
1074 | {
|
---|
1075 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Recording);
|
---|
1076 | }
|
---|
1077 | /** Returns whether action is allowed. */
|
---|
1078 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
1079 | {
|
---|
1080 | return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Recording);
|
---|
1081 | }
|
---|
1082 |
|
---|
1083 | /** Handles translation event. */
|
---|
1084 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1085 | {
|
---|
1086 | setName(QApplication::translate("UIActionPool", "&Recording"));
|
---|
1087 | }
|
---|
1088 | };
|
---|
1089 |
|
---|
1090 | /** Simple action extension, used as 'Show Recording Settings' action class. */
|
---|
1091 | class UIActionSimpleRuntimeShowRecordingSettings : public UIActionSimple
|
---|
1092 | {
|
---|
1093 | Q_OBJECT;
|
---|
1094 |
|
---|
1095 | public:
|
---|
1096 |
|
---|
1097 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1098 | UIActionSimpleRuntimeShowRecordingSettings(UIActionPool *pParent)
|
---|
1099 | : UIActionSimple(pParent, ":/video_capture_settings_16px.png", ":/video_capture_settings_16px.png", true)
|
---|
1100 | {}
|
---|
1101 |
|
---|
1102 | protected:
|
---|
1103 |
|
---|
1104 | /** Returns action extra-data ID. */
|
---|
1105 | virtual int extraDataID() const RT_OVERRIDE
|
---|
1106 | {
|
---|
1107 | return UIExtraDataMetaDefs::RuntimeMenuViewActionType_RecordingSettings;
|
---|
1108 | }
|
---|
1109 | /** Returns action extra-data key. */
|
---|
1110 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
1111 | {
|
---|
1112 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_RecordingSettings);
|
---|
1113 | }
|
---|
1114 | /** Returns whether action is allowed. */
|
---|
1115 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
1116 | {
|
---|
1117 | return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_RecordingSettings);
|
---|
1118 | }
|
---|
1119 |
|
---|
1120 | /** Returns shortcut extra-data ID. */
|
---|
1121 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1122 | {
|
---|
1123 | return QString("RecordingSettingsDialog");
|
---|
1124 | }
|
---|
1125 |
|
---|
1126 | /** Handles translation event. */
|
---|
1127 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1128 | {
|
---|
1129 | setName(QApplication::translate("UIActionPool", "&Recording Settings..."));
|
---|
1130 | setStatusTip(QApplication::translate("UIActionPool", "Display virtual machine settings window to configure video/audio recording"));
|
---|
1131 | }
|
---|
1132 | };
|
---|
1133 |
|
---|
1134 | /** Toggle action extension, used as 'Recording' action class. */
|
---|
1135 | class UIActionToggleRuntimeRecording : public UIActionToggle
|
---|
1136 | {
|
---|
1137 | Q_OBJECT;
|
---|
1138 |
|
---|
1139 | public:
|
---|
1140 |
|
---|
1141 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1142 | UIActionToggleRuntimeRecording(UIActionPool *pParent)
|
---|
1143 | : UIActionToggle(pParent,
|
---|
1144 | ":/video_capture_on_16px.png", ":/video_capture_16px.png",
|
---|
1145 | ":/video_capture_on_disabled_16px.png", ":/video_capture_disabled_16px.png",
|
---|
1146 | true)
|
---|
1147 | {}
|
---|
1148 |
|
---|
1149 | protected:
|
---|
1150 |
|
---|
1151 | /** Returns action extra-data ID. */
|
---|
1152 | virtual int extraDataID() const RT_OVERRIDE
|
---|
1153 | {
|
---|
1154 | return UIExtraDataMetaDefs::RuntimeMenuViewActionType_StartRecording;
|
---|
1155 | }
|
---|
1156 | /** Returns action extra-data key. */
|
---|
1157 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
1158 | {
|
---|
1159 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_StartRecording);
|
---|
1160 | }
|
---|
1161 | /** Returns whether action is allowed. */
|
---|
1162 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
1163 | {
|
---|
1164 | return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_StartRecording);
|
---|
1165 | }
|
---|
1166 |
|
---|
1167 | /** Returns shortcut extra-data ID. */
|
---|
1168 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1169 | {
|
---|
1170 | return QString("Recording");
|
---|
1171 | }
|
---|
1172 |
|
---|
1173 | /** Handles translation event. */
|
---|
1174 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1175 | {
|
---|
1176 | setName(QApplication::translate("UIActionPool", "&Recording"));
|
---|
1177 | setStatusTip(QApplication::translate("UIActionPool", "Enable guest video/audio recording"));
|
---|
1178 | }
|
---|
1179 | };
|
---|
1180 |
|
---|
1181 | /** Toggle action extension, used as 'VRDE Server' action class. */
|
---|
1182 | class UIActionToggleRuntimeVRDEServer : public UIActionToggle
|
---|
1183 | {
|
---|
1184 | Q_OBJECT;
|
---|
1185 |
|
---|
1186 | public:
|
---|
1187 |
|
---|
1188 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1189 | UIActionToggleRuntimeVRDEServer(UIActionPool *pParent)
|
---|
1190 | : UIActionToggle(pParent,
|
---|
1191 | ":/vrdp_on_16px.png", ":/vrdp_16px.png",
|
---|
1192 | ":/vrdp_on_disabled_16px.png", ":/vrdp_disabled_16px.png",
|
---|
1193 | true)
|
---|
1194 | {}
|
---|
1195 |
|
---|
1196 | protected:
|
---|
1197 |
|
---|
1198 | /** Returns action extra-data ID. */
|
---|
1199 | virtual int extraDataID() const RT_OVERRIDE
|
---|
1200 | {
|
---|
1201 | return UIExtraDataMetaDefs::RuntimeMenuViewActionType_VRDEServer;
|
---|
1202 | }
|
---|
1203 | /** Returns action extra-data key. */
|
---|
1204 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
1205 | {
|
---|
1206 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_VRDEServer);
|
---|
1207 | }
|
---|
1208 | /** Returns whether action is allowed. */
|
---|
1209 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
1210 | {
|
---|
1211 | return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_VRDEServer);
|
---|
1212 | }
|
---|
1213 |
|
---|
1214 | /** Returns shortcut extra-data ID. */
|
---|
1215 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1216 | {
|
---|
1217 | return QString("VRDPServer");
|
---|
1218 | }
|
---|
1219 |
|
---|
1220 | /** Handles translation event. */
|
---|
1221 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1222 | {
|
---|
1223 | setName(QApplication::translate("UIActionPool", "R&emote Display"));
|
---|
1224 | setStatusTip(QApplication::translate("UIActionPool", "Allow remote desktop (RDP) connections to this machine"));
|
---|
1225 | }
|
---|
1226 | };
|
---|
1227 |
|
---|
1228 | /** Menu action extension, used as 'MenuBar' menu class. */
|
---|
1229 | class UIActionMenuRuntimeMenuBar : public UIActionMenu
|
---|
1230 | {
|
---|
1231 | Q_OBJECT;
|
---|
1232 |
|
---|
1233 | public:
|
---|
1234 |
|
---|
1235 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1236 | UIActionMenuRuntimeMenuBar(UIActionPool *pParent)
|
---|
1237 | : UIActionMenu(pParent, ":/menubar_16px.png", ":/menubar_disabled_16px.png")
|
---|
1238 | {}
|
---|
1239 |
|
---|
1240 | protected:
|
---|
1241 |
|
---|
1242 | /** Returns action extra-data ID. */
|
---|
1243 | virtual int extraDataID() const RT_OVERRIDE
|
---|
1244 | {
|
---|
1245 | return UIExtraDataMetaDefs::RuntimeMenuViewActionType_MenuBar;
|
---|
1246 | }
|
---|
1247 | /** Returns action extra-data key. */
|
---|
1248 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
1249 | {
|
---|
1250 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_MenuBar);
|
---|
1251 | }
|
---|
1252 | /** Returns whether action is allowed. */
|
---|
1253 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
1254 | {
|
---|
1255 | return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_MenuBar);
|
---|
1256 | }
|
---|
1257 |
|
---|
1258 | /** Handles translation event. */
|
---|
1259 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1260 | {
|
---|
1261 | setName(QApplication::translate("UIActionPool", "&Menu Bar"));
|
---|
1262 | }
|
---|
1263 | };
|
---|
1264 |
|
---|
1265 | /** Simple action extension, used as 'Show MenuBar Settings Window' action class. */
|
---|
1266 | class UIActionSimpleRuntimeShowMenuBarSettings : public UIActionSimple
|
---|
1267 | {
|
---|
1268 | Q_OBJECT;
|
---|
1269 |
|
---|
1270 | public:
|
---|
1271 |
|
---|
1272 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1273 | UIActionSimpleRuntimeShowMenuBarSettings(UIActionPool *pParent)
|
---|
1274 | : UIActionSimple(pParent, ":/menubar_settings_16px.png", ":/menubar_settings_disabled_16px.png", true)
|
---|
1275 | {}
|
---|
1276 |
|
---|
1277 | protected:
|
---|
1278 |
|
---|
1279 | /** Returns action extra-data ID. */
|
---|
1280 | virtual int extraDataID() const RT_OVERRIDE
|
---|
1281 | {
|
---|
1282 | return UIExtraDataMetaDefs::RuntimeMenuViewActionType_MenuBarSettings;
|
---|
1283 | }
|
---|
1284 | /** Returns action extra-data key. */
|
---|
1285 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
1286 | {
|
---|
1287 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_MenuBarSettings);
|
---|
1288 | }
|
---|
1289 | /** Returns whether action is allowed. */
|
---|
1290 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
1291 | {
|
---|
1292 | return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_MenuBarSettings);
|
---|
1293 | }
|
---|
1294 |
|
---|
1295 | /** Returns shortcut extra-data ID. */
|
---|
1296 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1297 | {
|
---|
1298 | return QString("MenuBarSettings");
|
---|
1299 | }
|
---|
1300 |
|
---|
1301 | /** Handles translation event. */
|
---|
1302 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1303 | {
|
---|
1304 | setName(QApplication::translate("UIActionPool", "&Menu Bar Settings..."));
|
---|
1305 | setStatusTip(QApplication::translate("UIActionPool", "Display window to configure menu-bar"));
|
---|
1306 | }
|
---|
1307 | };
|
---|
1308 |
|
---|
1309 | #ifndef VBOX_WS_MAC
|
---|
1310 | /** Toggle action extension, used as 'MenuBar' action class. */
|
---|
1311 | class UIActionToggleRuntimeMenuBar : public UIActionToggle
|
---|
1312 | {
|
---|
1313 | Q_OBJECT;
|
---|
1314 |
|
---|
1315 | public:
|
---|
1316 |
|
---|
1317 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1318 | UIActionToggleRuntimeMenuBar(UIActionPool *pParent)
|
---|
1319 | : UIActionToggle(pParent,
|
---|
1320 | ":/menubar_on_16px.png", ":/menubar_16px.png",
|
---|
1321 | ":/menubar_on_disabled_16px.png", ":/menubar_disabled_16px.png",
|
---|
1322 | true)
|
---|
1323 | {}
|
---|
1324 |
|
---|
1325 | protected:
|
---|
1326 |
|
---|
1327 | /** Returns action extra-data ID. */
|
---|
1328 | virtual int extraDataID() const RT_OVERRIDE
|
---|
1329 | {
|
---|
1330 | return UIExtraDataMetaDefs::RuntimeMenuViewActionType_ToggleMenuBar;
|
---|
1331 | }
|
---|
1332 | /** Returns action extra-data key. */
|
---|
1333 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
1334 | {
|
---|
1335 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_ToggleMenuBar);
|
---|
1336 | }
|
---|
1337 | /** Returns whether action is allowed. */
|
---|
1338 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
1339 | {
|
---|
1340 | return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_ToggleMenuBar);
|
---|
1341 | }
|
---|
1342 |
|
---|
1343 | /** Returns shortcut extra-data ID. */
|
---|
1344 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1345 | {
|
---|
1346 | return QString("ToggleMenuBar");
|
---|
1347 | }
|
---|
1348 |
|
---|
1349 | /** Handles translation event. */
|
---|
1350 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1351 | {
|
---|
1352 | setName(QApplication::translate("UIActionPool", "Show Menu &Bar"));
|
---|
1353 | setStatusTip(QApplication::translate("UIActionPool", "Enable menu-bar"));
|
---|
1354 | }
|
---|
1355 | };
|
---|
1356 | #endif /* !VBOX_WS_MAC */
|
---|
1357 |
|
---|
1358 | /** Menu action extension, used as 'StatusBar' menu class. */
|
---|
1359 | class UIActionMenuRuntimeStatusBar : public UIActionMenu
|
---|
1360 | {
|
---|
1361 | Q_OBJECT;
|
---|
1362 |
|
---|
1363 | public:
|
---|
1364 |
|
---|
1365 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1366 | UIActionMenuRuntimeStatusBar(UIActionPool *pParent)
|
---|
1367 | : UIActionMenu(pParent, ":/statusbar_16px.png", ":/statusbar_disabled_16px.png")
|
---|
1368 | {}
|
---|
1369 |
|
---|
1370 | protected:
|
---|
1371 |
|
---|
1372 | /** Returns action extra-data ID. */
|
---|
1373 | virtual int extraDataID() const RT_OVERRIDE
|
---|
1374 | {
|
---|
1375 | return UIExtraDataMetaDefs::RuntimeMenuViewActionType_StatusBar;
|
---|
1376 | }
|
---|
1377 | /** Returns action extra-data key. */
|
---|
1378 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
1379 | {
|
---|
1380 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_StatusBar);
|
---|
1381 | }
|
---|
1382 | /** Returns whether action is allowed. */
|
---|
1383 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
1384 | {
|
---|
1385 | return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_StatusBar);
|
---|
1386 | }
|
---|
1387 |
|
---|
1388 | /** Handles translation event. */
|
---|
1389 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1390 | {
|
---|
1391 | setName(QApplication::translate("UIActionPool", "&Status Bar"));
|
---|
1392 | }
|
---|
1393 | };
|
---|
1394 |
|
---|
1395 | /** Simple action extension, used as 'Show StatusBar Settings Window' action class. */
|
---|
1396 | class UIActionSimpleRuntimeShowStatusBarSettings : public UIActionSimple
|
---|
1397 | {
|
---|
1398 | Q_OBJECT;
|
---|
1399 |
|
---|
1400 | public:
|
---|
1401 |
|
---|
1402 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1403 | UIActionSimpleRuntimeShowStatusBarSettings(UIActionPool *pParent)
|
---|
1404 | : UIActionSimple(pParent, ":/statusbar_settings_16px.png", ":/statusbar_settings_disabled_16px.png", true)
|
---|
1405 | {}
|
---|
1406 |
|
---|
1407 | protected:
|
---|
1408 |
|
---|
1409 | /** Returns action extra-data ID. */
|
---|
1410 | virtual int extraDataID() const RT_OVERRIDE
|
---|
1411 | {
|
---|
1412 | return UIExtraDataMetaDefs::RuntimeMenuViewActionType_StatusBarSettings;
|
---|
1413 | }
|
---|
1414 | /** Returns action extra-data key. */
|
---|
1415 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
1416 | {
|
---|
1417 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_StatusBarSettings);
|
---|
1418 | }
|
---|
1419 | /** Returns whether action is allowed. */
|
---|
1420 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
1421 | {
|
---|
1422 | return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_StatusBarSettings);
|
---|
1423 | }
|
---|
1424 |
|
---|
1425 | /** Returns shortcut extra-data ID. */
|
---|
1426 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1427 | {
|
---|
1428 | return QString("StatusBarSettings");
|
---|
1429 | }
|
---|
1430 |
|
---|
1431 | /** Handles translation event. */
|
---|
1432 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1433 | {
|
---|
1434 | setName(QApplication::translate("UIActionPool", "&Status Bar Settings..."));
|
---|
1435 | setStatusTip(QApplication::translate("UIActionPool", "Display window to configure status-bar"));
|
---|
1436 | }
|
---|
1437 | };
|
---|
1438 |
|
---|
1439 | /** Toggle action extension, used as 'StatusBar' action class. */
|
---|
1440 | class UIActionToggleRuntimeStatusBar : public UIActionToggle
|
---|
1441 | {
|
---|
1442 | Q_OBJECT;
|
---|
1443 |
|
---|
1444 | public:
|
---|
1445 |
|
---|
1446 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1447 | UIActionToggleRuntimeStatusBar(UIActionPool *pParent)
|
---|
1448 | : UIActionToggle(pParent,
|
---|
1449 | ":/statusbar_on_16px.png", ":/statusbar_16px.png",
|
---|
1450 | ":/statusbar_on_disabled_16px.png", ":/statusbar_disabled_16px.png",
|
---|
1451 | true)
|
---|
1452 | {}
|
---|
1453 |
|
---|
1454 | protected:
|
---|
1455 |
|
---|
1456 | /** Returns action extra-data ID. */
|
---|
1457 | virtual int extraDataID() const RT_OVERRIDE
|
---|
1458 | {
|
---|
1459 | return UIExtraDataMetaDefs::RuntimeMenuViewActionType_ToggleStatusBar;
|
---|
1460 | }
|
---|
1461 | /** Returns action extra-data key. */
|
---|
1462 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
1463 | {
|
---|
1464 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuViewActionType_ToggleStatusBar);
|
---|
1465 | }
|
---|
1466 | /** Returns whether action is allowed. */
|
---|
1467 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
1468 | {
|
---|
1469 | return actionPool()->toRuntime()->isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_ToggleStatusBar);
|
---|
1470 | }
|
---|
1471 |
|
---|
1472 | /** Returns shortcut extra-data ID. */
|
---|
1473 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1474 | {
|
---|
1475 | return QString("ToggleStatusBar");
|
---|
1476 | }
|
---|
1477 |
|
---|
1478 | /** Handles translation event. */
|
---|
1479 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1480 | {
|
---|
1481 | setName(QApplication::translate("UIActionPool", "Show Status &Bar"));
|
---|
1482 | setStatusTip(QApplication::translate("UIActionPool", "Enable status-bar"));
|
---|
1483 | }
|
---|
1484 | };
|
---|
1485 |
|
---|
1486 | /** Menu action extension, used as 'Input' menu class. */
|
---|
1487 | class UIActionMenuRuntimeInput : public UIActionMenu
|
---|
1488 | {
|
---|
1489 | Q_OBJECT;
|
---|
1490 |
|
---|
1491 | public:
|
---|
1492 |
|
---|
1493 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1494 | UIActionMenuRuntimeInput(UIActionPool *pParent)
|
---|
1495 | : UIActionMenu(pParent)
|
---|
1496 | {}
|
---|
1497 |
|
---|
1498 | protected:
|
---|
1499 |
|
---|
1500 | /** Returns action extra-data ID. */
|
---|
1501 | virtual int extraDataID() const RT_OVERRIDE
|
---|
1502 | {
|
---|
1503 | return UIExtraDataMetaDefs::MenuType_Input;
|
---|
1504 | }
|
---|
1505 | /** Returns action extra-data key. */
|
---|
1506 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
1507 | {
|
---|
1508 | return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuType_Input);
|
---|
1509 | }
|
---|
1510 | /** Returns whether action is allowed. */
|
---|
1511 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
1512 | {
|
---|
1513 | return actionPool()->isAllowedInMenuBar(UIExtraDataMetaDefs::MenuType_Input);
|
---|
1514 | }
|
---|
1515 |
|
---|
1516 | /** Handles translation event. */
|
---|
1517 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1518 | {
|
---|
1519 | setName(QApplication::translate("UIActionPool", "&Input"));
|
---|
1520 | }
|
---|
1521 | };
|
---|
1522 |
|
---|
1523 | /** Menu action extension, used as 'Keyboard' menu class. */
|
---|
1524 | class UIActionMenuRuntimeKeyboard : public UIActionMenu
|
---|
1525 | {
|
---|
1526 | Q_OBJECT;
|
---|
1527 |
|
---|
1528 | public:
|
---|
1529 |
|
---|
1530 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1531 | UIActionMenuRuntimeKeyboard(UIActionPool *pParent)
|
---|
1532 | : UIActionMenu(pParent, ":/keyboard_16px.png")
|
---|
1533 | {}
|
---|
1534 |
|
---|
1535 | protected:
|
---|
1536 |
|
---|
1537 | /** Returns action extra-data ID. */
|
---|
1538 | virtual int extraDataID() const RT_OVERRIDE
|
---|
1539 | {
|
---|
1540 | return UIExtraDataMetaDefs::RuntimeMenuInputActionType_Keyboard;
|
---|
1541 | }
|
---|
1542 | /** Returns action extra-data key. */
|
---|
1543 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
1544 | {
|
---|
1545 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuInputActionType_Keyboard);
|
---|
1546 | }
|
---|
1547 | /** Returns whether action is allowed. */
|
---|
1548 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
1549 | {
|
---|
1550 | return actionPool()->toRuntime()->isAllowedInMenuInput(UIExtraDataMetaDefs::RuntimeMenuInputActionType_Keyboard);
|
---|
1551 | }
|
---|
1552 |
|
---|
1553 | /** Handles translation event. */
|
---|
1554 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1555 | {
|
---|
1556 | setName(QApplication::translate("UIActionPool", "&Keyboard"));
|
---|
1557 | }
|
---|
1558 | };
|
---|
1559 |
|
---|
1560 | /** Simple action extension, used as 'Show Keyboard Settings' action class. */
|
---|
1561 | class UIActionSimpleRuntimeShowKeyboardSettings : public UIActionSimple
|
---|
1562 | {
|
---|
1563 | Q_OBJECT;
|
---|
1564 |
|
---|
1565 | public:
|
---|
1566 |
|
---|
1567 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1568 | UIActionSimpleRuntimeShowKeyboardSettings(UIActionPool *pParent)
|
---|
1569 | : UIActionSimple(pParent, ":/keyboard_settings_16px.png", ":/keyboard_settings_disabled_16px.png", true)
|
---|
1570 | {}
|
---|
1571 |
|
---|
1572 | protected:
|
---|
1573 |
|
---|
1574 | /** Returns action extra-data ID. */
|
---|
1575 | virtual int extraDataID() const RT_OVERRIDE
|
---|
1576 | {
|
---|
1577 | return UIExtraDataMetaDefs::RuntimeMenuInputActionType_KeyboardSettings;
|
---|
1578 | }
|
---|
1579 | /** Returns action extra-data key. */
|
---|
1580 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
1581 | {
|
---|
1582 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuInputActionType_KeyboardSettings);
|
---|
1583 | }
|
---|
1584 | /** Returns whether action is allowed. */
|
---|
1585 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
1586 | {
|
---|
1587 | return actionPool()->toRuntime()->isAllowedInMenuInput(UIExtraDataMetaDefs::RuntimeMenuInputActionType_KeyboardSettings);
|
---|
1588 | }
|
---|
1589 |
|
---|
1590 | /** Returns shortcut extra-data ID. */
|
---|
1591 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1592 | {
|
---|
1593 | return QString("KeyboardSettings");
|
---|
1594 | }
|
---|
1595 |
|
---|
1596 | /** Handles translation event. */
|
---|
1597 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1598 | {
|
---|
1599 | setName(QApplication::translate("UIActionPool", "&Keyboard Settings..."));
|
---|
1600 | setStatusTip(QApplication::translate("UIActionPool", "Display global preferences window to configure keyboard shortcuts"));
|
---|
1601 | }
|
---|
1602 | };
|
---|
1603 |
|
---|
1604 | /** Simple action extension, used as 'Show Soft Keyboard' action class. */
|
---|
1605 | class UIActionSimpleRuntimeShowSoftKeyboard : public UIActionSimple
|
---|
1606 | {
|
---|
1607 | Q_OBJECT;
|
---|
1608 |
|
---|
1609 | public:
|
---|
1610 |
|
---|
1611 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1612 | UIActionSimpleRuntimeShowSoftKeyboard(UIActionPool *pParent)
|
---|
1613 | : UIActionSimple(pParent, UIIconPool::iconSet(":/soft_keyboard_16px.png"), true)
|
---|
1614 | {}
|
---|
1615 |
|
---|
1616 | protected:
|
---|
1617 |
|
---|
1618 | /** Returns action extra-data ID. */
|
---|
1619 | virtual int extraDataID() const RT_OVERRIDE
|
---|
1620 | {
|
---|
1621 | return UIExtraDataMetaDefs::RuntimeMenuInputActionType_SoftKeyboard;
|
---|
1622 | }
|
---|
1623 | /** Returns action extra-data key. */
|
---|
1624 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
1625 | {
|
---|
1626 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuInputActionType_SoftKeyboard);
|
---|
1627 | }
|
---|
1628 | /** Returns whether action is allowed. */
|
---|
1629 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
1630 | {
|
---|
1631 | return actionPool()->toRuntime()->isAllowedInMenuInput(UIExtraDataMetaDefs::RuntimeMenuInputActionType_SoftKeyboard);
|
---|
1632 | }
|
---|
1633 |
|
---|
1634 | /** Returns shortcut extra-data ID. */
|
---|
1635 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1636 | {
|
---|
1637 | return QString("SoftKeyboard");
|
---|
1638 | }
|
---|
1639 |
|
---|
1640 | /** Handles translation event. */
|
---|
1641 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1642 | {
|
---|
1643 | setName(QApplication::translate("UIActionPool", "&Soft Keyboard..."));
|
---|
1644 | setStatusTip(QApplication::translate("UIActionPool", "Display soft keyboard"));
|
---|
1645 | }
|
---|
1646 | };
|
---|
1647 |
|
---|
1648 | /** Simple action extension, used as 'Perform Type CAD' action class. */
|
---|
1649 | class UIActionSimpleRuntimePerformTypeCAD : public UIActionSimple
|
---|
1650 | {
|
---|
1651 | Q_OBJECT;
|
---|
1652 |
|
---|
1653 | public:
|
---|
1654 |
|
---|
1655 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1656 | UIActionSimpleRuntimePerformTypeCAD(UIActionPool *pParent)
|
---|
1657 | : UIActionSimple(pParent, true)
|
---|
1658 | {}
|
---|
1659 |
|
---|
1660 | protected:
|
---|
1661 |
|
---|
1662 | /** Returns action extra-data ID. */
|
---|
1663 | virtual int extraDataID() const RT_OVERRIDE
|
---|
1664 | {
|
---|
1665 | return UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCAD;
|
---|
1666 | }
|
---|
1667 | /** Returns action extra-data key. */
|
---|
1668 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
1669 | {
|
---|
1670 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCAD);
|
---|
1671 | }
|
---|
1672 | /** Returns whether action is allowed. */
|
---|
1673 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
1674 | {
|
---|
1675 | return actionPool()->toRuntime()->isAllowedInMenuInput(UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCAD);
|
---|
1676 | }
|
---|
1677 |
|
---|
1678 | /** Returns shortcut extra-data ID. */
|
---|
1679 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1680 | {
|
---|
1681 | return QString("TypeCAD");
|
---|
1682 | }
|
---|
1683 |
|
---|
1684 | /** Returns default shortcut. */
|
---|
1685 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
1686 | {
|
---|
1687 | return QKeySequence("Del");
|
---|
1688 | }
|
---|
1689 |
|
---|
1690 | /** Handles translation event. */
|
---|
1691 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1692 | {
|
---|
1693 | setName(QApplication::translate("UIActionPool", "&Insert %1", "that means send the %1 key sequence to the virtual machine").arg("Ctrl-Alt-Del"));
|
---|
1694 | setStatusTip(QApplication::translate("UIActionPool", "Send the %1 sequence to the virtual machine").arg("Ctrl-Alt-Del"));
|
---|
1695 | }
|
---|
1696 | };
|
---|
1697 |
|
---|
1698 | #ifdef VBOX_WS_NIX
|
---|
1699 | /** X11: Simple action extension, used as 'Perform Type CABS' action class. */
|
---|
1700 | class UIActionSimpleRuntimePerformTypeCABS : public UIActionSimple
|
---|
1701 | {
|
---|
1702 | Q_OBJECT;
|
---|
1703 |
|
---|
1704 | public:
|
---|
1705 |
|
---|
1706 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1707 | UIActionSimpleRuntimePerformTypeCABS(UIActionPool *pParent)
|
---|
1708 | : UIActionSimple(pParent, true)
|
---|
1709 | {}
|
---|
1710 |
|
---|
1711 | protected:
|
---|
1712 |
|
---|
1713 | /** Returns action extra-data ID. */
|
---|
1714 | virtual int extraDataID() const RT_OVERRIDE
|
---|
1715 | {
|
---|
1716 | return UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCABS;
|
---|
1717 | }
|
---|
1718 | /** Returns action extra-data key. */
|
---|
1719 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
1720 | {
|
---|
1721 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCABS);
|
---|
1722 | }
|
---|
1723 | /** Returns whether action is allowed. */
|
---|
1724 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
1725 | {
|
---|
1726 | return actionPool()->toRuntime()->isAllowedInMenuInput(UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCABS);
|
---|
1727 | }
|
---|
1728 |
|
---|
1729 | /** Returns shortcut extra-data ID. */
|
---|
1730 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1731 | {
|
---|
1732 | return QString("TypeCABS");
|
---|
1733 | }
|
---|
1734 |
|
---|
1735 | /** Returns default shortcut. */
|
---|
1736 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
1737 | {
|
---|
1738 | return QKeySequence("Backspace");
|
---|
1739 | }
|
---|
1740 |
|
---|
1741 | /** Handles translation event. */
|
---|
1742 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1743 | {
|
---|
1744 | setName(QApplication::translate("UIActionPool", "&Insert %1", "that means send the %1 key sequence to the virtual machine").arg("Ctrl-Alt-Backspace"));
|
---|
1745 | setStatusTip(QApplication::translate("UIActionPool", "Send the %1 sequence to the virtual machine").arg("Ctrl-Alt-Backspace"));
|
---|
1746 | }
|
---|
1747 | };
|
---|
1748 | #endif /* VBOX_WS_NIX */
|
---|
1749 |
|
---|
1750 | /** Simple action extension, used as 'Perform Type Ctrl Break' action class. */
|
---|
1751 | class UIActionSimpleRuntimePerformTypeCtrlBreak : public UIActionSimple
|
---|
1752 | {
|
---|
1753 | Q_OBJECT;
|
---|
1754 |
|
---|
1755 | public:
|
---|
1756 |
|
---|
1757 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1758 | UIActionSimpleRuntimePerformTypeCtrlBreak(UIActionPool *pParent)
|
---|
1759 | : UIActionSimple(pParent, true)
|
---|
1760 | {}
|
---|
1761 |
|
---|
1762 | protected:
|
---|
1763 |
|
---|
1764 | /** Returns action extra-data ID. */
|
---|
1765 | virtual int extraDataID() const RT_OVERRIDE
|
---|
1766 | {
|
---|
1767 | return UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCtrlBreak;
|
---|
1768 | }
|
---|
1769 | /** Returns action extra-data key. */
|
---|
1770 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
1771 | {
|
---|
1772 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCtrlBreak);
|
---|
1773 | }
|
---|
1774 | /** Returns whether action is allowed. */
|
---|
1775 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
1776 | {
|
---|
1777 | return actionPool()->toRuntime()->isAllowedInMenuInput(UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCtrlBreak);
|
---|
1778 | }
|
---|
1779 |
|
---|
1780 | /** Returns shortcut extra-data ID. */
|
---|
1781 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1782 | {
|
---|
1783 | return QString("TypeCtrlBreak");
|
---|
1784 | }
|
---|
1785 |
|
---|
1786 | /** Handles translation event. */
|
---|
1787 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1788 | {
|
---|
1789 | setName(QApplication::translate("UIActionPool", "&Insert %1", "that means send the %1 key sequence to the virtual machine").arg("Ctrl-Break"));
|
---|
1790 | setStatusTip(QApplication::translate("UIActionPool", "Send the %1 sequence to the virtual machine").arg("Ctrl-Break"));
|
---|
1791 | }
|
---|
1792 | };
|
---|
1793 |
|
---|
1794 | /** Simple action extension, used as 'Perform Type Insert' action class. */
|
---|
1795 | class UIActionSimpleRuntimePerformTypeInsert : public UIActionSimple
|
---|
1796 | {
|
---|
1797 | Q_OBJECT;
|
---|
1798 |
|
---|
1799 | public:
|
---|
1800 |
|
---|
1801 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1802 | UIActionSimpleRuntimePerformTypeInsert(UIActionPool *pParent)
|
---|
1803 | : UIActionSimple(pParent, true)
|
---|
1804 | {}
|
---|
1805 |
|
---|
1806 | protected:
|
---|
1807 |
|
---|
1808 | /** Returns action extra-data ID. */
|
---|
1809 | virtual int extraDataID() const RT_OVERRIDE
|
---|
1810 | {
|
---|
1811 | return UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeInsert;
|
---|
1812 | }
|
---|
1813 | /** Returns action extra-data key. */
|
---|
1814 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
1815 | {
|
---|
1816 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeInsert);
|
---|
1817 | }
|
---|
1818 | /** Returns whether action is allowed. */
|
---|
1819 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
1820 | {
|
---|
1821 | return actionPool()->toRuntime()->isAllowedInMenuInput(UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeInsert);
|
---|
1822 | }
|
---|
1823 |
|
---|
1824 | /** Returns shortcut extra-data ID. */
|
---|
1825 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1826 | {
|
---|
1827 | return QString("TypeInsert");
|
---|
1828 | }
|
---|
1829 |
|
---|
1830 | /** Handles translation event. */
|
---|
1831 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1832 | {
|
---|
1833 | setName(QApplication::translate("UIActionPool", "&Insert %1", "that means send the %1 key sequence to the virtual machine").arg("Insert"));
|
---|
1834 | setStatusTip(QApplication::translate("UIActionPool", "Send the %1 sequence to the virtual machine").arg("Insert"));
|
---|
1835 | }
|
---|
1836 | };
|
---|
1837 |
|
---|
1838 | /** Simple action extension, used as 'Perform Type PrintScreen' action class. */
|
---|
1839 | class UIActionSimpleRuntimePerformTypePrintScreen : public UIActionSimple
|
---|
1840 | {
|
---|
1841 | Q_OBJECT;
|
---|
1842 |
|
---|
1843 | public:
|
---|
1844 |
|
---|
1845 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1846 | UIActionSimpleRuntimePerformTypePrintScreen(UIActionPool *pParent)
|
---|
1847 | : UIActionSimple(pParent, true)
|
---|
1848 | {}
|
---|
1849 |
|
---|
1850 | protected:
|
---|
1851 |
|
---|
1852 | /** Returns action extra-data ID. */
|
---|
1853 | virtual int extraDataID() const RT_OVERRIDE
|
---|
1854 | {
|
---|
1855 | return UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypePrintScreen;
|
---|
1856 | }
|
---|
1857 | /** Returns action extra-data key. */
|
---|
1858 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
1859 | {
|
---|
1860 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypePrintScreen);
|
---|
1861 | }
|
---|
1862 | /** Returns whether action is allowed. */
|
---|
1863 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
1864 | {
|
---|
1865 | return actionPool()->toRuntime()->isAllowedInMenuInput(UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypePrintScreen);
|
---|
1866 | }
|
---|
1867 |
|
---|
1868 | /** Returns shortcut extra-data ID. */
|
---|
1869 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1870 | {
|
---|
1871 | return QString("TypePrintScreen");
|
---|
1872 | }
|
---|
1873 |
|
---|
1874 | /** Handles translation event. */
|
---|
1875 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1876 | {
|
---|
1877 | setName(QApplication::translate("UIActionPool", "&Insert %1", "that means send the %1 key sequence to the virtual machine").arg("Print Screen"));
|
---|
1878 | setStatusTip(QApplication::translate("UIActionPool", "Send the %1 sequence to the virtual machine").arg("Print Screen"));
|
---|
1879 | }
|
---|
1880 | };
|
---|
1881 |
|
---|
1882 | /** Simple action extension, used as 'Perform Type Alt PrintScreen' action class. */
|
---|
1883 | class UIActionSimpleRuntimePerformTypeAltPrintScreen : public UIActionSimple
|
---|
1884 | {
|
---|
1885 | Q_OBJECT;
|
---|
1886 |
|
---|
1887 | public:
|
---|
1888 |
|
---|
1889 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1890 | UIActionSimpleRuntimePerformTypeAltPrintScreen(UIActionPool *pParent)
|
---|
1891 | : UIActionSimple(pParent, true)
|
---|
1892 | {}
|
---|
1893 |
|
---|
1894 | protected:
|
---|
1895 |
|
---|
1896 | /** Returns action extra-data ID. */
|
---|
1897 | virtual int extraDataID() const RT_OVERRIDE
|
---|
1898 | {
|
---|
1899 | return UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeAltPrintScreen;
|
---|
1900 | }
|
---|
1901 | /** Returns action extra-data key. */
|
---|
1902 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
1903 | {
|
---|
1904 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeAltPrintScreen);
|
---|
1905 | }
|
---|
1906 | /** Returns whether action is allowed. */
|
---|
1907 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
1908 | {
|
---|
1909 | return actionPool()->toRuntime()->isAllowedInMenuInput(UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeAltPrintScreen);
|
---|
1910 | }
|
---|
1911 |
|
---|
1912 | /** Returns shortcut extra-data ID. */
|
---|
1913 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1914 | {
|
---|
1915 | return QString("TypeAltPrintScreen");
|
---|
1916 | }
|
---|
1917 |
|
---|
1918 | /** Handles translation event. */
|
---|
1919 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1920 | {
|
---|
1921 | setName(QApplication::translate("UIActionPool", "&Insert %1", "that means send the %1 key sequence to the virtual machine").arg("Alt Print Screen"));
|
---|
1922 | setStatusTip(QApplication::translate("UIActionPool", "Send the %1 sequence to the virtual machine").arg("Alt Print Screen"));
|
---|
1923 | }
|
---|
1924 | };
|
---|
1925 |
|
---|
1926 | /** Toggle action extension, used as 'Perform Host Key Combo Press/Release' action class. */
|
---|
1927 | class UIActionToggleRuntimePerformTypeHostKeyCombo : public UIActionToggle
|
---|
1928 | {
|
---|
1929 | Q_OBJECT;
|
---|
1930 |
|
---|
1931 | public:
|
---|
1932 |
|
---|
1933 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1934 | UIActionToggleRuntimePerformTypeHostKeyCombo(UIActionPool *pParent)
|
---|
1935 | : UIActionToggle(pParent, true)
|
---|
1936 | {}
|
---|
1937 |
|
---|
1938 | protected:
|
---|
1939 |
|
---|
1940 | /** Returns action extra-data ID. */
|
---|
1941 | virtual int extraDataID() const RT_OVERRIDE
|
---|
1942 | {
|
---|
1943 | return UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeHostKeyCombo;
|
---|
1944 | }
|
---|
1945 | /** Returns action extra-data key. */
|
---|
1946 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
1947 | {
|
---|
1948 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeHostKeyCombo);
|
---|
1949 | }
|
---|
1950 | /** Returns whether action is allowed. */
|
---|
1951 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
1952 | {
|
---|
1953 | return actionPool()->toRuntime()->isAllowedInMenuInput(UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeHostKeyCombo);
|
---|
1954 | }
|
---|
1955 |
|
---|
1956 | /** Returns shortcut extra-data ID. */
|
---|
1957 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1958 | {
|
---|
1959 | return QString("TypeHostKeyCombo");
|
---|
1960 | }
|
---|
1961 |
|
---|
1962 | /** Returns default shortcut. */
|
---|
1963 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
1964 | {
|
---|
1965 | #ifdef VBOX_WS_MAC
|
---|
1966 | return QKeySequence("Insert");
|
---|
1967 | #else
|
---|
1968 | return QKeySequence("Insert");
|
---|
1969 | #endif
|
---|
1970 | }
|
---|
1971 |
|
---|
1972 | /** Handles translation event. */
|
---|
1973 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1974 | {
|
---|
1975 | setName(QApplication::translate("UIActionPool", "&Insert %1", "that means send the %1 key sequence to the virtual machine").arg("Host Key Combo"));
|
---|
1976 | setStatusTip(QApplication::translate("UIActionPool", "Send the %1 sequence to the virtual machine").arg("Host Key Combo"));
|
---|
1977 | }
|
---|
1978 | };
|
---|
1979 |
|
---|
1980 | /** Menu action extension, used as 'Mouse' menu class. */
|
---|
1981 | class UIActionMenuRuntimeMouse : public UIActionMenu
|
---|
1982 | {
|
---|
1983 | Q_OBJECT;
|
---|
1984 |
|
---|
1985 | public:
|
---|
1986 |
|
---|
1987 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1988 | UIActionMenuRuntimeMouse(UIActionPool *pParent)
|
---|
1989 | : UIActionMenu(pParent)
|
---|
1990 | {}
|
---|
1991 |
|
---|
1992 | protected:
|
---|
1993 |
|
---|
1994 | /** Returns action extra-data ID. */
|
---|
1995 | virtual int extraDataID() const RT_OVERRIDE
|
---|
1996 | {
|
---|
1997 | return UIExtraDataMetaDefs::RuntimeMenuInputActionType_Mouse;
|
---|
1998 | }
|
---|
1999 | /** Returns action extra-data key. */
|
---|
2000 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
2001 | {
|
---|
2002 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuInputActionType_Mouse);
|
---|
2003 | }
|
---|
2004 | /** Returns whether action is allowed. */
|
---|
2005 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
2006 | {
|
---|
2007 | return actionPool()->toRuntime()->isAllowedInMenuInput(UIExtraDataMetaDefs::RuntimeMenuInputActionType_Mouse);
|
---|
2008 | }
|
---|
2009 |
|
---|
2010 | /** Handles translation event. */
|
---|
2011 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2012 | {
|
---|
2013 | setName(QApplication::translate("UIActionPool", "&Mouse"));
|
---|
2014 | }
|
---|
2015 | };
|
---|
2016 |
|
---|
2017 | /** Toggle action extension, used as 'Mouse Integration' action class. */
|
---|
2018 | class UIActionToggleRuntimeMouseIntegration : public UIActionToggle
|
---|
2019 | {
|
---|
2020 | Q_OBJECT;
|
---|
2021 |
|
---|
2022 | public:
|
---|
2023 |
|
---|
2024 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2025 | UIActionToggleRuntimeMouseIntegration(UIActionPool *pParent)
|
---|
2026 | : UIActionToggle(pParent,
|
---|
2027 | ":/mouse_can_seamless_on_16px.png", ":/mouse_can_seamless_16px.png",
|
---|
2028 | ":/mouse_can_seamless_on_disabled_16px.png", ":/mouse_can_seamless_disabled_16px.png",
|
---|
2029 | true)
|
---|
2030 | {}
|
---|
2031 |
|
---|
2032 | protected:
|
---|
2033 |
|
---|
2034 | /** Returns action extra-data ID. */
|
---|
2035 | virtual int extraDataID() const RT_OVERRIDE
|
---|
2036 | {
|
---|
2037 | return UIExtraDataMetaDefs::RuntimeMenuInputActionType_MouseIntegration;
|
---|
2038 | }
|
---|
2039 | /** Returns action extra-data key. */
|
---|
2040 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
2041 | {
|
---|
2042 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuInputActionType_MouseIntegration);
|
---|
2043 | }
|
---|
2044 | /** Returns whether action is allowed. */
|
---|
2045 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
2046 | {
|
---|
2047 | return actionPool()->toRuntime()->isAllowedInMenuInput(UIExtraDataMetaDefs::RuntimeMenuInputActionType_MouseIntegration);
|
---|
2048 | }
|
---|
2049 |
|
---|
2050 | /** Returns shortcut extra-data ID. */
|
---|
2051 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2052 | {
|
---|
2053 | return QString("MouseIntegration");
|
---|
2054 | }
|
---|
2055 |
|
---|
2056 | /** Handles translation event. */
|
---|
2057 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2058 | {
|
---|
2059 | setName(QApplication::translate("UIActionPool", "&Mouse Integration"));
|
---|
2060 | setStatusTip(QApplication::translate("UIActionPool", "Enable host mouse pointer integration"));
|
---|
2061 | }
|
---|
2062 | };
|
---|
2063 |
|
---|
2064 |
|
---|
2065 | /** Menu action extension, used as 'Devices' menu class. */
|
---|
2066 | class UIActionMenuRuntimeDevices : public UIActionMenu
|
---|
2067 | {
|
---|
2068 | Q_OBJECT;
|
---|
2069 |
|
---|
2070 | public:
|
---|
2071 |
|
---|
2072 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2073 | UIActionMenuRuntimeDevices(UIActionPool *pParent)
|
---|
2074 | : UIActionMenu(pParent)
|
---|
2075 | {}
|
---|
2076 |
|
---|
2077 | protected:
|
---|
2078 |
|
---|
2079 | /** Returns action extra-data ID. */
|
---|
2080 | virtual int extraDataID() const RT_OVERRIDE
|
---|
2081 | {
|
---|
2082 | return UIExtraDataMetaDefs::MenuType_Devices;
|
---|
2083 | }
|
---|
2084 | /** Returns action extra-data key. */
|
---|
2085 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
2086 | {
|
---|
2087 | return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuType_Devices);
|
---|
2088 | }
|
---|
2089 | /** Returns whether action is allowed. */
|
---|
2090 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
2091 | {
|
---|
2092 | return actionPool()->isAllowedInMenuBar(UIExtraDataMetaDefs::MenuType_Devices);
|
---|
2093 | }
|
---|
2094 |
|
---|
2095 | /** Handles translation event. */
|
---|
2096 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2097 | {
|
---|
2098 | setName(QApplication::translate("UIActionPool", "&Devices"));
|
---|
2099 | }
|
---|
2100 | };
|
---|
2101 |
|
---|
2102 | /** Menu action extension, used as 'Hard Drives' menu class. */
|
---|
2103 | class UIActionMenuRuntimeHardDrives : public UIActionMenu
|
---|
2104 | {
|
---|
2105 | Q_OBJECT;
|
---|
2106 |
|
---|
2107 | public:
|
---|
2108 |
|
---|
2109 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2110 | UIActionMenuRuntimeHardDrives(UIActionPool *pParent)
|
---|
2111 | : UIActionMenu(pParent, ":/hd_16px.png", ":/hd_disabled_16px.png")
|
---|
2112 | {
|
---|
2113 | setShowToolTip(true);
|
---|
2114 | }
|
---|
2115 |
|
---|
2116 | protected:
|
---|
2117 |
|
---|
2118 | /** Returns action extra-data ID. */
|
---|
2119 | virtual int extraDataID() const RT_OVERRIDE
|
---|
2120 | {
|
---|
2121 | return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_HardDrives;
|
---|
2122 | }
|
---|
2123 | /** Returns action extra-data key. */
|
---|
2124 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
2125 | {
|
---|
2126 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_HardDrives);
|
---|
2127 | }
|
---|
2128 | /** Returns whether action is allowed. */
|
---|
2129 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
2130 | {
|
---|
2131 | return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_HardDrives);
|
---|
2132 | }
|
---|
2133 |
|
---|
2134 | /** Handles translation event. */
|
---|
2135 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2136 | {
|
---|
2137 | setName(QApplication::translate("UIActionPool", "&Hard Disks"));
|
---|
2138 | }
|
---|
2139 | };
|
---|
2140 |
|
---|
2141 | /** Simple action extension, used as 'Show Hard Drives Settings' action class. */
|
---|
2142 | class UIActionSimpleRuntimeShowHardDrivesSettings : public UIActionSimple
|
---|
2143 | {
|
---|
2144 | Q_OBJECT;
|
---|
2145 |
|
---|
2146 | public:
|
---|
2147 |
|
---|
2148 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2149 | UIActionSimpleRuntimeShowHardDrivesSettings(UIActionPool *pParent)
|
---|
2150 | : UIActionSimple(pParent, ":/hd_settings_16px.png", ":/hd_settings_disabled_16px.png", true)
|
---|
2151 | {}
|
---|
2152 |
|
---|
2153 | protected:
|
---|
2154 |
|
---|
2155 | /** Returns action extra-data ID. */
|
---|
2156 | virtual int extraDataID() const RT_OVERRIDE
|
---|
2157 | {
|
---|
2158 | return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_HardDrivesSettings;
|
---|
2159 | }
|
---|
2160 | /** Returns action extra-data key. */
|
---|
2161 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
2162 | {
|
---|
2163 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_HardDrivesSettings);
|
---|
2164 | }
|
---|
2165 | /** Returns whether action is allowed. */
|
---|
2166 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
2167 | {
|
---|
2168 | return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_HardDrivesSettings);
|
---|
2169 | }
|
---|
2170 |
|
---|
2171 | /** Returns shortcut extra-data ID. */
|
---|
2172 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2173 | {
|
---|
2174 | return QString("HardDriveSettingsDialog");
|
---|
2175 | }
|
---|
2176 |
|
---|
2177 | /** Handles translation event. */
|
---|
2178 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2179 | {
|
---|
2180 | setName(QApplication::translate("UIActionPool", "&Hard Disk Settings..."));
|
---|
2181 | setStatusTip(QApplication::translate("UIActionPool", "Display virtual machine settings window to configure hard disks"));
|
---|
2182 | }
|
---|
2183 | };
|
---|
2184 |
|
---|
2185 | /** Menu action extension, used as 'Optical Drives' menu class. */
|
---|
2186 | class UIActionMenuRuntimeOpticalDevices : public UIActionMenu
|
---|
2187 | {
|
---|
2188 | Q_OBJECT;
|
---|
2189 |
|
---|
2190 | public:
|
---|
2191 |
|
---|
2192 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2193 | UIActionMenuRuntimeOpticalDevices(UIActionPool *pParent)
|
---|
2194 | : UIActionMenu(pParent, ":/cd_16px.png", ":/cd_disabled_16px.png")
|
---|
2195 | {
|
---|
2196 | setShowToolTip(true);
|
---|
2197 | }
|
---|
2198 |
|
---|
2199 | protected:
|
---|
2200 |
|
---|
2201 | /** Returns action extra-data ID. */
|
---|
2202 | virtual int extraDataID() const RT_OVERRIDE
|
---|
2203 | {
|
---|
2204 | return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_OpticalDevices;
|
---|
2205 | }
|
---|
2206 | /** Returns action extra-data key. */
|
---|
2207 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
2208 | {
|
---|
2209 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_OpticalDevices);
|
---|
2210 | }
|
---|
2211 | /** Returns whether action is allowed. */
|
---|
2212 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
2213 | {
|
---|
2214 | return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_OpticalDevices);
|
---|
2215 | }
|
---|
2216 |
|
---|
2217 | /** Handles translation event. */
|
---|
2218 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2219 | {
|
---|
2220 | setName(QApplication::translate("UIActionPool", "&Optical Drives"));
|
---|
2221 | }
|
---|
2222 | };
|
---|
2223 |
|
---|
2224 | /** Menu action extension, used as 'Floppy Drives' menu class. */
|
---|
2225 | class UIActionMenuRuntimeFloppyDevices : public UIActionMenu
|
---|
2226 | {
|
---|
2227 | Q_OBJECT;
|
---|
2228 |
|
---|
2229 | public:
|
---|
2230 |
|
---|
2231 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2232 | UIActionMenuRuntimeFloppyDevices(UIActionPool *pParent)
|
---|
2233 | : UIActionMenu(pParent, ":/fd_16px.png", ":/fd_disabled_16px.png")
|
---|
2234 | {
|
---|
2235 | setShowToolTip(true);
|
---|
2236 | }
|
---|
2237 |
|
---|
2238 | protected:
|
---|
2239 |
|
---|
2240 | /** Returns action extra-data ID. */
|
---|
2241 | virtual int extraDataID() const RT_OVERRIDE
|
---|
2242 | {
|
---|
2243 | return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_FloppyDevices;
|
---|
2244 | }
|
---|
2245 | /** Returns action extra-data key. */
|
---|
2246 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
2247 | {
|
---|
2248 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_FloppyDevices);
|
---|
2249 | }
|
---|
2250 | /** Returns whether action is allowed. */
|
---|
2251 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
2252 | {
|
---|
2253 | return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_FloppyDevices);
|
---|
2254 | }
|
---|
2255 |
|
---|
2256 | /** Handles translation event. */
|
---|
2257 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2258 | {
|
---|
2259 | setName(QApplication::translate("UIActionPool", "&Floppy Drives"));
|
---|
2260 | }
|
---|
2261 | };
|
---|
2262 |
|
---|
2263 | /** Menu action extension, used as 'Audio' menu class. */
|
---|
2264 | class UIActionMenuRuntimeAudio : public UIActionMenu
|
---|
2265 | {
|
---|
2266 | Q_OBJECT;
|
---|
2267 |
|
---|
2268 | public:
|
---|
2269 |
|
---|
2270 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2271 | UIActionMenuRuntimeAudio(UIActionPool *pParent)
|
---|
2272 | : UIActionMenu(pParent, ":/audio_16px.png", ":/audio_all_off_16px.png")
|
---|
2273 | {}
|
---|
2274 |
|
---|
2275 | protected:
|
---|
2276 |
|
---|
2277 | /** Returns action extra-data ID. */
|
---|
2278 | virtual int extraDataID() const RT_OVERRIDE
|
---|
2279 | {
|
---|
2280 | return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Audio;
|
---|
2281 | }
|
---|
2282 | /** Returns action extra-data key. */
|
---|
2283 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
2284 | {
|
---|
2285 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Audio);
|
---|
2286 | }
|
---|
2287 | /** Returns whether action is allowed. */
|
---|
2288 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
2289 | {
|
---|
2290 | return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Audio);
|
---|
2291 | }
|
---|
2292 |
|
---|
2293 | /** Handles translation event. */
|
---|
2294 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2295 | {
|
---|
2296 | setName(QApplication::translate("UIActionPool", "&Audio"));
|
---|
2297 | }
|
---|
2298 | };
|
---|
2299 |
|
---|
2300 | /** Toggle action extension, used as 'Audio Output' action class. */
|
---|
2301 | class UIActionToggleRuntimeAudioOutput : public UIActionToggle
|
---|
2302 | {
|
---|
2303 | Q_OBJECT;
|
---|
2304 |
|
---|
2305 | public:
|
---|
2306 |
|
---|
2307 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2308 | UIActionToggleRuntimeAudioOutput(UIActionPool *pParent)
|
---|
2309 | : UIActionToggle(pParent,
|
---|
2310 | ":/audio_output_on_16px.png", ":/audio_output_16px.png",
|
---|
2311 | ":/audio_output_on_16px.png", ":/audio_output_16px.png",
|
---|
2312 | true)
|
---|
2313 | {}
|
---|
2314 |
|
---|
2315 | protected:
|
---|
2316 |
|
---|
2317 | /** Returns action extra-data ID. */
|
---|
2318 | virtual int extraDataID() const RT_OVERRIDE
|
---|
2319 | {
|
---|
2320 | return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_AudioOutput;
|
---|
2321 | }
|
---|
2322 | /** Returns action extra-data key. */
|
---|
2323 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
2324 | {
|
---|
2325 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_AudioOutput);
|
---|
2326 | }
|
---|
2327 | /** Returns whether action is allowed. */
|
---|
2328 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
2329 | {
|
---|
2330 | return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_AudioOutput);
|
---|
2331 | }
|
---|
2332 |
|
---|
2333 | /** Returns shortcut extra-data ID. */
|
---|
2334 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2335 | {
|
---|
2336 | return QString("ToggleAudioOutput");
|
---|
2337 | }
|
---|
2338 |
|
---|
2339 | /** Handles translation event. */
|
---|
2340 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2341 | {
|
---|
2342 | setName(QApplication::translate("UIActionPool", "Audio Output"));
|
---|
2343 | setStatusTip(QApplication::translate("UIActionPool", "Enable audio output"));
|
---|
2344 | }
|
---|
2345 | };
|
---|
2346 |
|
---|
2347 | /** Toggle action extension, used as 'Audio Input' action class. */
|
---|
2348 | class UIActionToggleRuntimeAudioInput : public UIActionToggle
|
---|
2349 | {
|
---|
2350 | Q_OBJECT;
|
---|
2351 |
|
---|
2352 | public:
|
---|
2353 |
|
---|
2354 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2355 | UIActionToggleRuntimeAudioInput(UIActionPool *pParent)
|
---|
2356 | : UIActionToggle(pParent,
|
---|
2357 | ":/audio_input_on_16px.png", ":/audio_input_16px.png",
|
---|
2358 | ":/audio_input_on_16px.png", ":/audio_input_16px.png",
|
---|
2359 | true)
|
---|
2360 | {}
|
---|
2361 |
|
---|
2362 | protected:
|
---|
2363 |
|
---|
2364 | /** Returns action extra-data ID. */
|
---|
2365 | virtual int extraDataID() const RT_OVERRIDE
|
---|
2366 | {
|
---|
2367 | return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_AudioInput;
|
---|
2368 | }
|
---|
2369 | /** Returns action extra-data key. */
|
---|
2370 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
2371 | {
|
---|
2372 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_AudioInput);
|
---|
2373 | }
|
---|
2374 | /** Returns whether action is allowed. */
|
---|
2375 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
2376 | {
|
---|
2377 | return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_AudioInput);
|
---|
2378 | }
|
---|
2379 |
|
---|
2380 | /** Returns shortcut extra-data ID. */
|
---|
2381 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2382 | {
|
---|
2383 | return QString("ToggleAudioInput");
|
---|
2384 | }
|
---|
2385 |
|
---|
2386 | /** Handles translation event. */
|
---|
2387 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2388 | {
|
---|
2389 | setName(QApplication::translate("UIActionPool", "Audio Input"));
|
---|
2390 | setStatusTip(QApplication::translate("UIActionPool", "Enable audio input"));
|
---|
2391 | }
|
---|
2392 | };
|
---|
2393 |
|
---|
2394 | /** Menu action extension, used as 'Network Adapters' menu class. */
|
---|
2395 | class UIActionMenuRuntimeNetworkAdapters : public UIActionMenu
|
---|
2396 | {
|
---|
2397 | Q_OBJECT;
|
---|
2398 |
|
---|
2399 | public:
|
---|
2400 |
|
---|
2401 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2402 | UIActionMenuRuntimeNetworkAdapters(UIActionPool *pParent)
|
---|
2403 | : UIActionMenu(pParent, ":/nw_16px.png", ":/nw_disabled_16px.png")
|
---|
2404 | {}
|
---|
2405 |
|
---|
2406 | protected:
|
---|
2407 |
|
---|
2408 | /** Returns action extra-data ID. */
|
---|
2409 | virtual int extraDataID() const RT_OVERRIDE
|
---|
2410 | {
|
---|
2411 | return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Network;
|
---|
2412 | }
|
---|
2413 | /** Returns action extra-data key. */
|
---|
2414 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
2415 | {
|
---|
2416 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Network);
|
---|
2417 | }
|
---|
2418 | /** Returns whether action is allowed. */
|
---|
2419 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
2420 | {
|
---|
2421 | return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Network);
|
---|
2422 | }
|
---|
2423 |
|
---|
2424 | /** Handles translation event. */
|
---|
2425 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2426 | {
|
---|
2427 | setName(QApplication::translate("UIActionPool", "&Network"));
|
---|
2428 | }
|
---|
2429 | };
|
---|
2430 |
|
---|
2431 | /** Simple action extension, used as 'Show Network Settings' action class. */
|
---|
2432 | class UIActionSimpleRuntimeShowNetworkSettings : public UIActionSimple
|
---|
2433 | {
|
---|
2434 | Q_OBJECT;
|
---|
2435 |
|
---|
2436 | public:
|
---|
2437 |
|
---|
2438 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2439 | UIActionSimpleRuntimeShowNetworkSettings(UIActionPool *pParent)
|
---|
2440 | : UIActionSimple(pParent, ":/nw_settings_16px.png", ":/nw_settings_disabled_16px.png", true)
|
---|
2441 | {}
|
---|
2442 |
|
---|
2443 | protected:
|
---|
2444 |
|
---|
2445 | /** Returns action extra-data ID. */
|
---|
2446 | virtual int extraDataID() const RT_OVERRIDE
|
---|
2447 | {
|
---|
2448 | return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_NetworkSettings;
|
---|
2449 | }
|
---|
2450 | /** Returns action extra-data key. */
|
---|
2451 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
2452 | {
|
---|
2453 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_NetworkSettings);
|
---|
2454 | }
|
---|
2455 | /** Returns whether action is allowed. */
|
---|
2456 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
2457 | {
|
---|
2458 | return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_NetworkSettings);
|
---|
2459 | }
|
---|
2460 |
|
---|
2461 | /** Returns shortcut extra-data ID. */
|
---|
2462 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2463 | {
|
---|
2464 | return QString("NetworkSettingsDialog");
|
---|
2465 | }
|
---|
2466 |
|
---|
2467 | /** Handles translation event. */
|
---|
2468 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2469 | {
|
---|
2470 | setName(QApplication::translate("UIActionPool", "&Network Settings..."));
|
---|
2471 | setStatusTip(QApplication::translate("UIActionPool", "Display virtual machine settings window to configure network adapters"));
|
---|
2472 | }
|
---|
2473 | };
|
---|
2474 |
|
---|
2475 | /** Menu action extension, used as 'USB Devices' menu class. */
|
---|
2476 | class UIActionMenuRuntimeUSBDevices : public UIActionMenu
|
---|
2477 | {
|
---|
2478 | Q_OBJECT;
|
---|
2479 |
|
---|
2480 | public:
|
---|
2481 |
|
---|
2482 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2483 | UIActionMenuRuntimeUSBDevices(UIActionPool *pParent)
|
---|
2484 | : UIActionMenu(pParent, ":/usb_16px.png", ":/usb_disabled_16px.png")
|
---|
2485 | {
|
---|
2486 | setShowToolTip(true);
|
---|
2487 | }
|
---|
2488 |
|
---|
2489 | protected:
|
---|
2490 |
|
---|
2491 | /** Returns action extra-data ID. */
|
---|
2492 | virtual int extraDataID() const RT_OVERRIDE
|
---|
2493 | {
|
---|
2494 | return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_USBDevices;
|
---|
2495 | }
|
---|
2496 | /** Returns action extra-data key. */
|
---|
2497 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
2498 | {
|
---|
2499 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_USBDevices);
|
---|
2500 | }
|
---|
2501 | /** Returns whether action is allowed. */
|
---|
2502 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
2503 | {
|
---|
2504 | return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_USBDevices);
|
---|
2505 | }
|
---|
2506 |
|
---|
2507 | /** Handles translation event. */
|
---|
2508 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2509 | {
|
---|
2510 | setName(QApplication::translate("UIActionPool", "&USB"));
|
---|
2511 | }
|
---|
2512 | };
|
---|
2513 |
|
---|
2514 | /** Simple action extension, used as 'Show USB Devices Settings' action class. */
|
---|
2515 | class UIActionSimpleRuntimeShowUSBDevicesSettings : public UIActionSimple
|
---|
2516 | {
|
---|
2517 | Q_OBJECT;
|
---|
2518 |
|
---|
2519 | public:
|
---|
2520 |
|
---|
2521 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2522 | UIActionSimpleRuntimeShowUSBDevicesSettings(UIActionPool *pParent)
|
---|
2523 | : UIActionSimple(pParent, ":/usb_settings_16px.png", ":/usb_settings_disabled_16px.png", true)
|
---|
2524 | {}
|
---|
2525 |
|
---|
2526 | protected:
|
---|
2527 |
|
---|
2528 | /** Returns action extra-data ID. */
|
---|
2529 | virtual int extraDataID() const RT_OVERRIDE
|
---|
2530 | {
|
---|
2531 | return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_USBDevicesSettings;
|
---|
2532 | }
|
---|
2533 | /** Returns action extra-data key. */
|
---|
2534 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
2535 | {
|
---|
2536 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_USBDevicesSettings);
|
---|
2537 | }
|
---|
2538 | /** Returns whether action is allowed. */
|
---|
2539 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
2540 | {
|
---|
2541 | return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_USBDevicesSettings);
|
---|
2542 | }
|
---|
2543 |
|
---|
2544 | /** Returns shortcut extra-data ID. */
|
---|
2545 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2546 | {
|
---|
2547 | return QString("USBDevicesSettingsDialog");
|
---|
2548 | }
|
---|
2549 |
|
---|
2550 | /** Handles translation event. */
|
---|
2551 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2552 | {
|
---|
2553 | setName(QApplication::translate("UIActionPool", "&USB Settings..."));
|
---|
2554 | setStatusTip(QApplication::translate("UIActionPool", "Display virtual machine settings window to configure USB devices"));
|
---|
2555 | }
|
---|
2556 | };
|
---|
2557 |
|
---|
2558 | /** Menu action extension, used as 'Web Cams' menu class. */
|
---|
2559 | class UIActionMenuRuntimeWebCams : public UIActionMenu
|
---|
2560 | {
|
---|
2561 | Q_OBJECT;
|
---|
2562 |
|
---|
2563 | public:
|
---|
2564 |
|
---|
2565 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2566 | UIActionMenuRuntimeWebCams(UIActionPool *pParent)
|
---|
2567 | : UIActionMenu(pParent, ":/web_camera_16px.png", ":/web_camera_disabled_16px.png")
|
---|
2568 | {
|
---|
2569 | setShowToolTip(true);
|
---|
2570 | }
|
---|
2571 |
|
---|
2572 | protected:
|
---|
2573 |
|
---|
2574 | /** Returns action extra-data ID. */
|
---|
2575 | virtual int extraDataID() const RT_OVERRIDE
|
---|
2576 | {
|
---|
2577 | return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_WebCams;
|
---|
2578 | }
|
---|
2579 | /** Returns action extra-data key. */
|
---|
2580 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
2581 | {
|
---|
2582 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_WebCams);
|
---|
2583 | }
|
---|
2584 | /** Returns whether action is allowed. */
|
---|
2585 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
2586 | {
|
---|
2587 | return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_WebCams);
|
---|
2588 | }
|
---|
2589 |
|
---|
2590 | /** Handles translation event. */
|
---|
2591 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2592 | {
|
---|
2593 | setName(QApplication::translate("UIActionPool", "&Webcams"));
|
---|
2594 | }
|
---|
2595 | };
|
---|
2596 |
|
---|
2597 | /** Menu action extension, used as 'Shared Clipboard' menu class. */
|
---|
2598 | class UIActionMenuRuntimeSharedClipboard : public UIActionMenu
|
---|
2599 | {
|
---|
2600 | Q_OBJECT;
|
---|
2601 |
|
---|
2602 | public:
|
---|
2603 |
|
---|
2604 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2605 | UIActionMenuRuntimeSharedClipboard(UIActionPool *pParent)
|
---|
2606 | : UIActionMenu(pParent, ":/shared_clipboard_16px.png", ":/shared_clipboard_disabled_16px.png")
|
---|
2607 | {}
|
---|
2608 |
|
---|
2609 | protected:
|
---|
2610 |
|
---|
2611 | /** Returns action extra-data ID. */
|
---|
2612 | virtual int extraDataID() const RT_OVERRIDE
|
---|
2613 | {
|
---|
2614 | return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedClipboard;
|
---|
2615 | }
|
---|
2616 | /** Returns action extra-data key. */
|
---|
2617 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
2618 | {
|
---|
2619 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedClipboard);
|
---|
2620 | }
|
---|
2621 | /** Returns whether action is allowed. */
|
---|
2622 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
2623 | {
|
---|
2624 | return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedClipboard);
|
---|
2625 | }
|
---|
2626 |
|
---|
2627 | /** Handles translation event. */
|
---|
2628 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2629 | {
|
---|
2630 | setName(QApplication::translate("UIActionPool", "Shared &Clipboard"));
|
---|
2631 | }
|
---|
2632 | };
|
---|
2633 |
|
---|
2634 | /** Menu action extension, used as 'Drag & Drop' menu class. */
|
---|
2635 | class UIActionMenuRuntimeDragAndDrop : public UIActionMenu
|
---|
2636 | {
|
---|
2637 | Q_OBJECT;
|
---|
2638 |
|
---|
2639 | public:
|
---|
2640 |
|
---|
2641 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2642 | UIActionMenuRuntimeDragAndDrop(UIActionPool *pParent)
|
---|
2643 | : UIActionMenu(pParent, ":/drag_drop_16px.png", ":/drag_drop_disabled_16px.png")
|
---|
2644 | {}
|
---|
2645 |
|
---|
2646 | protected:
|
---|
2647 |
|
---|
2648 | /** Returns action extra-data ID. */
|
---|
2649 | virtual int extraDataID() const RT_OVERRIDE
|
---|
2650 | {
|
---|
2651 | return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_DragAndDrop;
|
---|
2652 | }
|
---|
2653 | /** Returns action extra-data key. */
|
---|
2654 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
2655 | {
|
---|
2656 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_DragAndDrop);
|
---|
2657 | }
|
---|
2658 | /** Returns whether action is allowed. */
|
---|
2659 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
2660 | {
|
---|
2661 | return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_DragAndDrop);
|
---|
2662 | }
|
---|
2663 |
|
---|
2664 | /** Handles translation event. */
|
---|
2665 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2666 | {
|
---|
2667 | setName(QApplication::translate("UIActionPool", "&Drag and Drop"));
|
---|
2668 | }
|
---|
2669 | };
|
---|
2670 |
|
---|
2671 | /** Menu action extension, used as 'Shared Folders' menu class. */
|
---|
2672 | class UIActionMenuRuntimeSharedFolders : public UIActionMenu
|
---|
2673 | {
|
---|
2674 | Q_OBJECT;
|
---|
2675 |
|
---|
2676 | public:
|
---|
2677 |
|
---|
2678 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2679 | UIActionMenuRuntimeSharedFolders(UIActionPool *pParent)
|
---|
2680 | : UIActionMenu(pParent, ":/sf_16px.png", ":/sf_disabled_16px.png")
|
---|
2681 | {}
|
---|
2682 |
|
---|
2683 | protected:
|
---|
2684 |
|
---|
2685 | /** Returns action extra-data ID. */
|
---|
2686 | virtual int extraDataID() const RT_OVERRIDE
|
---|
2687 | {
|
---|
2688 | return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedFolders;
|
---|
2689 | }
|
---|
2690 | /** Returns action extra-data key. */
|
---|
2691 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
2692 | {
|
---|
2693 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedFolders);
|
---|
2694 | }
|
---|
2695 | /** Returns whether action is allowed. */
|
---|
2696 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
2697 | {
|
---|
2698 | return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedFolders);
|
---|
2699 | }
|
---|
2700 |
|
---|
2701 | /** Handles translation event. */
|
---|
2702 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2703 | {
|
---|
2704 | setName(QApplication::translate("UIActionPool", "&Shared Folders"));
|
---|
2705 | }
|
---|
2706 | };
|
---|
2707 |
|
---|
2708 | /** Simple action extension, used as 'Show Shared Folders Settings' action class. */
|
---|
2709 | class UIActionSimpleRuntimeShowSharedFoldersSettings : public UIActionSimple
|
---|
2710 | {
|
---|
2711 | Q_OBJECT;
|
---|
2712 |
|
---|
2713 | public:
|
---|
2714 |
|
---|
2715 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2716 | UIActionSimpleRuntimeShowSharedFoldersSettings(UIActionPool *pParent)
|
---|
2717 | : UIActionSimple(pParent, ":/sf_settings_16px.png", ":/sf_settings_disabled_16px.png", true)
|
---|
2718 | {}
|
---|
2719 |
|
---|
2720 | protected:
|
---|
2721 |
|
---|
2722 | /** Returns action extra-data ID. */
|
---|
2723 | virtual int extraDataID() const RT_OVERRIDE
|
---|
2724 | {
|
---|
2725 | return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedFoldersSettings;
|
---|
2726 | }
|
---|
2727 | /** Returns action extra-data key. */
|
---|
2728 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
2729 | {
|
---|
2730 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedFoldersSettings);
|
---|
2731 | }
|
---|
2732 | /** Returns whether action is allowed. */
|
---|
2733 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
2734 | {
|
---|
2735 | return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedFoldersSettings);
|
---|
2736 | }
|
---|
2737 |
|
---|
2738 | /** Returns shortcut extra-data ID. */
|
---|
2739 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2740 | {
|
---|
2741 | return QString("SharedFoldersSettingsDialog");
|
---|
2742 | }
|
---|
2743 |
|
---|
2744 | /** Handles translation event. */
|
---|
2745 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2746 | {
|
---|
2747 | setName(QApplication::translate("UIActionPool", "&Shared Folders Settings..."));
|
---|
2748 | setStatusTip(QApplication::translate("UIActionPool", "Display virtual machine settings window to configure shared folders"));
|
---|
2749 | }
|
---|
2750 | };
|
---|
2751 |
|
---|
2752 | /** Simple action extension, used as 'Perform Insert Guest Additions Disk' action class. */
|
---|
2753 | class UIActionSimpleRuntimePerformInsertGuestAdditionsDisk : public UIActionSimple
|
---|
2754 | {
|
---|
2755 | Q_OBJECT;
|
---|
2756 |
|
---|
2757 | public:
|
---|
2758 |
|
---|
2759 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2760 | UIActionSimpleRuntimePerformInsertGuestAdditionsDisk(UIActionPool *pParent)
|
---|
2761 | : UIActionSimple(pParent, ":/guesttools_16px.png", ":/guesttools_disabled_16px.png", true)
|
---|
2762 | {}
|
---|
2763 |
|
---|
2764 | protected:
|
---|
2765 |
|
---|
2766 | /** Returns action extra-data ID. */
|
---|
2767 | virtual int extraDataID() const RT_OVERRIDE
|
---|
2768 | {
|
---|
2769 | return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_InsertGuestAdditionsDisk;
|
---|
2770 | }
|
---|
2771 | /** Returns action extra-data key. */
|
---|
2772 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
2773 | {
|
---|
2774 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_InsertGuestAdditionsDisk);
|
---|
2775 | }
|
---|
2776 | /** Returns whether action is allowed. */
|
---|
2777 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
2778 | {
|
---|
2779 | return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_InsertGuestAdditionsDisk);
|
---|
2780 | }
|
---|
2781 |
|
---|
2782 | /** Returns shortcut extra-data ID. */
|
---|
2783 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2784 | {
|
---|
2785 | return QString("InsertGuestAdditionsDisk");
|
---|
2786 | }
|
---|
2787 |
|
---|
2788 | /** Handles translation event. */
|
---|
2789 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2790 | {
|
---|
2791 | setName(QApplication::translate("UIActionPool", "&Insert Guest Additions CD image..."));
|
---|
2792 | setStatusTip(QApplication::translate("UIActionPool", "Insert the Guest Additions disk file into the virtual optical drive"));
|
---|
2793 | }
|
---|
2794 | };
|
---|
2795 |
|
---|
2796 | /** Simple action extension, used as 'Perform Upgrade Guest Additions' action class. */
|
---|
2797 | class UIActionSimpleRuntimePerformUpgradeGuestAdditions : public UIActionSimple
|
---|
2798 | {
|
---|
2799 | Q_OBJECT;
|
---|
2800 |
|
---|
2801 | public:
|
---|
2802 |
|
---|
2803 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2804 | UIActionSimpleRuntimePerformUpgradeGuestAdditions(UIActionPool *pParent)
|
---|
2805 | : UIActionSimple(pParent, ":/guesttools_update_16px.png", ":/guesttools_update_disabled_16px.png", true)
|
---|
2806 | {}
|
---|
2807 |
|
---|
2808 | protected:
|
---|
2809 |
|
---|
2810 | /** Returns action extra-data ID. */
|
---|
2811 | virtual int extraDataID() const RT_OVERRIDE
|
---|
2812 | {
|
---|
2813 | return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_UpgradeGuestAdditions;
|
---|
2814 | }
|
---|
2815 | /** Returns action extra-data key. */
|
---|
2816 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
2817 | {
|
---|
2818 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_UpgradeGuestAdditions);
|
---|
2819 | }
|
---|
2820 | /** Returns whether action is allowed. */
|
---|
2821 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
2822 | {
|
---|
2823 | return actionPool()->toRuntime()->isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_UpgradeGuestAdditions);
|
---|
2824 | }
|
---|
2825 |
|
---|
2826 | /** Returns shortcut extra-data ID. */
|
---|
2827 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2828 | {
|
---|
2829 | return QString("UpgradeGuestAdditions");
|
---|
2830 | }
|
---|
2831 |
|
---|
2832 | /** Handles translation event. */
|
---|
2833 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2834 | {
|
---|
2835 | setName(QApplication::translate("UIActionPool", "&Upgrade Guest Additions..."));
|
---|
2836 | setStatusTip(QApplication::translate("UIActionPool", "Upgrade Guest Additions"));
|
---|
2837 | }
|
---|
2838 | };
|
---|
2839 |
|
---|
2840 | #ifdef VBOX_WITH_DEBUGGER_GUI
|
---|
2841 | /** Menu action extension, used as 'Debug' menu class. */
|
---|
2842 | class UIActionMenuRuntimeDebug : public UIActionMenu
|
---|
2843 | {
|
---|
2844 | Q_OBJECT;
|
---|
2845 |
|
---|
2846 | public:
|
---|
2847 |
|
---|
2848 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2849 | UIActionMenuRuntimeDebug(UIActionPool *pParent)
|
---|
2850 | : UIActionMenu(pParent)
|
---|
2851 | {}
|
---|
2852 |
|
---|
2853 | protected:
|
---|
2854 |
|
---|
2855 | /** Returns action extra-data ID. */
|
---|
2856 | virtual int extraDataID() const RT_OVERRIDE
|
---|
2857 | {
|
---|
2858 | return UIExtraDataMetaDefs::MenuType_Debug;
|
---|
2859 | }
|
---|
2860 | /** Returns action extra-data key. */
|
---|
2861 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
2862 | {
|
---|
2863 | return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuType_Debug);
|
---|
2864 | }
|
---|
2865 | /** Returns whether action is allowed. */
|
---|
2866 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
2867 | {
|
---|
2868 | return actionPool()->isAllowedInMenuBar(UIExtraDataMetaDefs::MenuType_Debug);
|
---|
2869 | }
|
---|
2870 |
|
---|
2871 | /** Handles translation event. */
|
---|
2872 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2873 | {
|
---|
2874 | setName(QApplication::translate("UIActionPool", "De&bug"));
|
---|
2875 | }
|
---|
2876 | };
|
---|
2877 |
|
---|
2878 | /** Simple action extension, used as 'Show Statistics' action class. */
|
---|
2879 | class UIActionSimpleRuntimeShowStatistics : public UIActionSimple
|
---|
2880 | {
|
---|
2881 | Q_OBJECT;
|
---|
2882 |
|
---|
2883 | public:
|
---|
2884 |
|
---|
2885 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2886 | UIActionSimpleRuntimeShowStatistics(UIActionPool *pParent)
|
---|
2887 | : UIActionSimple(pParent, true)
|
---|
2888 | {}
|
---|
2889 |
|
---|
2890 | protected:
|
---|
2891 |
|
---|
2892 | /** Returns action extra-data ID. */
|
---|
2893 | virtual int extraDataID() const RT_OVERRIDE
|
---|
2894 | {
|
---|
2895 | return UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_Statistics;
|
---|
2896 | }
|
---|
2897 | /** Returns action extra-data key. */
|
---|
2898 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
2899 | {
|
---|
2900 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_Statistics);
|
---|
2901 | }
|
---|
2902 | /** Returns whether action is allowed. */
|
---|
2903 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
2904 | {
|
---|
2905 | return actionPool()->toRuntime()->isAllowedInMenuDebug(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_Statistics);
|
---|
2906 | }
|
---|
2907 |
|
---|
2908 | /** Returns shortcut extra-data ID. */
|
---|
2909 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2910 | {
|
---|
2911 | return QString("StatisticWindow");
|
---|
2912 | }
|
---|
2913 |
|
---|
2914 | /** Handles translation event. */
|
---|
2915 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2916 | {
|
---|
2917 | setName(QApplication::translate("UIActionPool", "&Statistics...", "debug action"));
|
---|
2918 | }
|
---|
2919 | };
|
---|
2920 |
|
---|
2921 | /** Simple action extension, used as 'Show Command Line' action class. */
|
---|
2922 | class UIActionSimpleRuntimeShowCommandLine : public UIActionSimple
|
---|
2923 | {
|
---|
2924 | Q_OBJECT;
|
---|
2925 |
|
---|
2926 | public:
|
---|
2927 |
|
---|
2928 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2929 | UIActionSimpleRuntimeShowCommandLine(UIActionPool *pParent)
|
---|
2930 | : UIActionSimple(pParent, true)
|
---|
2931 | {}
|
---|
2932 |
|
---|
2933 | protected:
|
---|
2934 |
|
---|
2935 | /** Returns action extra-data ID. */
|
---|
2936 | virtual int extraDataID() const RT_OVERRIDE
|
---|
2937 | {
|
---|
2938 | return UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_CommandLine;
|
---|
2939 | }
|
---|
2940 | /** Returns action extra-data key. */
|
---|
2941 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
2942 | {
|
---|
2943 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_CommandLine);
|
---|
2944 | }
|
---|
2945 | /** Returns whether action is allowed. */
|
---|
2946 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
2947 | {
|
---|
2948 | return actionPool()->toRuntime()->isAllowedInMenuDebug(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_CommandLine);
|
---|
2949 | }
|
---|
2950 |
|
---|
2951 | /** Returns shortcut extra-data ID. */
|
---|
2952 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2953 | {
|
---|
2954 | return QString("CommandLineWindow");
|
---|
2955 | }
|
---|
2956 |
|
---|
2957 | /** Handles translation event. */
|
---|
2958 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2959 | {
|
---|
2960 | setName(QApplication::translate("UIActionPool", "&Command Line...", "debug action"));
|
---|
2961 | }
|
---|
2962 | };
|
---|
2963 |
|
---|
2964 | /** Toggle action extension, used as 'Logging' action class. */
|
---|
2965 | class UIActionToggleRuntimeLogging : public UIActionToggle
|
---|
2966 | {
|
---|
2967 | Q_OBJECT;
|
---|
2968 |
|
---|
2969 | public:
|
---|
2970 |
|
---|
2971 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2972 | UIActionToggleRuntimeLogging(UIActionPool *pParent)
|
---|
2973 | : UIActionToggle(pParent, true)
|
---|
2974 | {}
|
---|
2975 |
|
---|
2976 | protected:
|
---|
2977 |
|
---|
2978 | /** Returns action extra-data ID. */
|
---|
2979 | virtual int extraDataID() const RT_OVERRIDE
|
---|
2980 | {
|
---|
2981 | return UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_Logging;
|
---|
2982 | }
|
---|
2983 | /** Returns action extra-data key. */
|
---|
2984 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
2985 | {
|
---|
2986 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_Logging);
|
---|
2987 | }
|
---|
2988 | /** Returns whether action is allowed. */
|
---|
2989 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
2990 | {
|
---|
2991 | return actionPool()->toRuntime()->isAllowedInMenuDebug(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_Logging);
|
---|
2992 | }
|
---|
2993 |
|
---|
2994 | /** Returns shortcut extra-data ID. */
|
---|
2995 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2996 | {
|
---|
2997 | return QString("Logging");
|
---|
2998 | }
|
---|
2999 |
|
---|
3000 | /** Handles translation event. */
|
---|
3001 | virtual void retranslateUi() RT_OVERRIDE
|
---|
3002 | {
|
---|
3003 | setName(QApplication::translate("UIActionPool", "&Logging", "debug action"));
|
---|
3004 | }
|
---|
3005 | };
|
---|
3006 |
|
---|
3007 | /** Simple action extension, used as 'Guest Control Terminal' action class. */
|
---|
3008 | class UIActionSimpleRuntimeGuestControlConsole : public UIActionSimple
|
---|
3009 | {
|
---|
3010 | Q_OBJECT;
|
---|
3011 |
|
---|
3012 | public:
|
---|
3013 |
|
---|
3014 | /** Constructs action passing @a pParent to the base-class. */
|
---|
3015 | UIActionSimpleRuntimeGuestControlConsole(UIActionPool *pParent)
|
---|
3016 | : UIActionSimple(pParent, true)
|
---|
3017 | {}
|
---|
3018 |
|
---|
3019 | protected:
|
---|
3020 |
|
---|
3021 | /** Returns action extra-data ID. */
|
---|
3022 | virtual int extraDataID() const RT_OVERRIDE
|
---|
3023 | {
|
---|
3024 | return UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_GuestControlConsole;
|
---|
3025 | }
|
---|
3026 | /** Returns action extra-data key. */
|
---|
3027 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
3028 | {
|
---|
3029 | return gpConverter->toInternalString(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_GuestControlConsole);
|
---|
3030 | }
|
---|
3031 | /** Returns whether action is allowed. */
|
---|
3032 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
3033 | {
|
---|
3034 | return actionPool()->toRuntime()->isAllowedInMenuDebug(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_GuestControlConsole);
|
---|
3035 | }
|
---|
3036 |
|
---|
3037 | /** Returns shortcut extra-data ID. */
|
---|
3038 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
3039 | {
|
---|
3040 | return QString("GuestControlConsole");
|
---|
3041 | }
|
---|
3042 |
|
---|
3043 | /** Handles translation event. */
|
---|
3044 | virtual void retranslateUi() RT_OVERRIDE
|
---|
3045 | {
|
---|
3046 | setName(QApplication::translate("UIActionPool", "Guest Control Terminal...", "debug action"));
|
---|
3047 | }
|
---|
3048 | };
|
---|
3049 | #endif /* VBOX_WITH_DEBUGGER_GUI */
|
---|
3050 |
|
---|
3051 | #ifdef VBOX_WS_MAC
|
---|
3052 | /** macOS: Menu action extension, used as 'Dock' menu class. */
|
---|
3053 | class UIActionMenuDock : public UIActionMenu
|
---|
3054 | {
|
---|
3055 | Q_OBJECT;
|
---|
3056 |
|
---|
3057 | public:
|
---|
3058 |
|
---|
3059 | /** Constructs action passing @a pParent to the base-class. */
|
---|
3060 | UIActionMenuDock(UIActionPool *pParent)
|
---|
3061 | : UIActionMenu(pParent)
|
---|
3062 | {}
|
---|
3063 |
|
---|
3064 | protected:
|
---|
3065 |
|
---|
3066 | /** Handles translation event. */
|
---|
3067 | virtual void retranslateUi() RT_OVERRIDE {}
|
---|
3068 | };
|
---|
3069 |
|
---|
3070 | /** macOS: Menu action extension, used as 'Dock Settings' menu class. */
|
---|
3071 | class UIActionMenuDockSettings : public UIActionMenu
|
---|
3072 | {
|
---|
3073 | Q_OBJECT;
|
---|
3074 |
|
---|
3075 | public:
|
---|
3076 |
|
---|
3077 | /** Constructs action passing @a pParent to the base-class. */
|
---|
3078 | UIActionMenuDockSettings(UIActionPool *pParent)
|
---|
3079 | : UIActionMenu(pParent)
|
---|
3080 | {}
|
---|
3081 |
|
---|
3082 | protected:
|
---|
3083 |
|
---|
3084 | /** Handles translation event. */
|
---|
3085 | virtual void retranslateUi() RT_OVERRIDE
|
---|
3086 | {
|
---|
3087 | setName(QApplication::translate("UIActionPool", "Dock Icon"));
|
---|
3088 | }
|
---|
3089 | };
|
---|
3090 |
|
---|
3091 | /** macOS: Toggle action extension, used as 'Dock Preview Monitor' action class. */
|
---|
3092 | class UIActionToggleDockPreviewMonitor : public UIActionToggle
|
---|
3093 | {
|
---|
3094 | Q_OBJECT;
|
---|
3095 |
|
---|
3096 | public:
|
---|
3097 |
|
---|
3098 | /** Constructs action passing @a pParent to the base-class. */
|
---|
3099 | UIActionToggleDockPreviewMonitor(UIActionPool *pParent)
|
---|
3100 | : UIActionToggle(pParent)
|
---|
3101 | {}
|
---|
3102 |
|
---|
3103 | protected:
|
---|
3104 |
|
---|
3105 | /** Returns shortcut extra-data ID. */
|
---|
3106 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
3107 | {
|
---|
3108 | return QString("DockPreviewMonitor");
|
---|
3109 | }
|
---|
3110 |
|
---|
3111 | /** Handles translation event. */
|
---|
3112 | virtual void retranslateUi() RT_OVERRIDE
|
---|
3113 | {
|
---|
3114 | setName(QApplication::translate("UIActionPool", "Show Monitor Preview"));
|
---|
3115 | }
|
---|
3116 | };
|
---|
3117 |
|
---|
3118 | /** macOS: Toggle action extension, used as 'Dock Disable Monitor' action class. */
|
---|
3119 | class UIActionToggleDockDisableMonitor : public UIActionToggle
|
---|
3120 | {
|
---|
3121 | Q_OBJECT;
|
---|
3122 |
|
---|
3123 | public:
|
---|
3124 |
|
---|
3125 | /** Constructs action passing @a pParent to the base-class. */
|
---|
3126 | UIActionToggleDockDisableMonitor(UIActionPool *pParent)
|
---|
3127 | : UIActionToggle(pParent)
|
---|
3128 | {}
|
---|
3129 |
|
---|
3130 | protected:
|
---|
3131 |
|
---|
3132 | /** Returns shortcut extra-data ID. */
|
---|
3133 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
3134 | {
|
---|
3135 | return QString("DockDisableMonitor");
|
---|
3136 | }
|
---|
3137 |
|
---|
3138 | /** Handles translation event. */
|
---|
3139 | virtual void retranslateUi() RT_OVERRIDE
|
---|
3140 | {
|
---|
3141 | setName(QApplication::translate("UIActionPool", "Show Application Icon"));
|
---|
3142 | }
|
---|
3143 | };
|
---|
3144 |
|
---|
3145 | /** macOS: Toggle action extension, used as 'Dock Icon Disable Overlay' action class. */
|
---|
3146 | class UIActionToggleDockIconDisableOverlay : public UIActionToggle
|
---|
3147 | {
|
---|
3148 | Q_OBJECT;
|
---|
3149 |
|
---|
3150 | public:
|
---|
3151 |
|
---|
3152 | /** Constructs action passing @a pParent to the base-class. */
|
---|
3153 | UIActionToggleDockIconDisableOverlay(UIActionPool *pParent)
|
---|
3154 | : UIActionToggle(pParent)
|
---|
3155 | {}
|
---|
3156 |
|
---|
3157 | protected:
|
---|
3158 |
|
---|
3159 | /** Returns shortcut extra-data ID. */
|
---|
3160 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
3161 | {
|
---|
3162 | return QString("DockOverlayDisable");
|
---|
3163 | }
|
---|
3164 |
|
---|
3165 | /** Handles translation event. */
|
---|
3166 | virtual void retranslateUi() RT_OVERRIDE
|
---|
3167 | {
|
---|
3168 | setName(QApplication::translate("UIActionPool", "Disable Dock Icon Overlay"));
|
---|
3169 | }
|
---|
3170 | };
|
---|
3171 | #endif /* VBOX_WS_MAC */
|
---|
3172 |
|
---|
3173 |
|
---|
3174 | /*********************************************************************************************************************************
|
---|
3175 | * Class UIActionPoolRuntime implementation. *
|
---|
3176 | *********************************************************************************************************************************/
|
---|
3177 |
|
---|
3178 | UIActionPoolRuntime::UIActionPoolRuntime(bool fTemporary /* = false */)
|
---|
3179 | : UIActionPool(UIType_RuntimeUI, fTemporary)
|
---|
3180 | , m_cHostScreens(0)
|
---|
3181 | , m_cGuestScreens(0)
|
---|
3182 | , m_fGuestSupportsGraphics(false)
|
---|
3183 | {
|
---|
3184 | }
|
---|
3185 |
|
---|
3186 | void UIActionPoolRuntime::setHostScreenCount(int cCount)
|
---|
3187 | {
|
---|
3188 | m_cHostScreens = cCount;
|
---|
3189 | m_invalidations << UIActionIndexRT_M_View << UIActionIndexRT_M_ViewPopup;
|
---|
3190 | }
|
---|
3191 |
|
---|
3192 | void UIActionPoolRuntime::setGuestScreenCount(int cCount)
|
---|
3193 | {
|
---|
3194 | m_cGuestScreens = cCount;
|
---|
3195 | m_invalidations << UIActionIndexRT_M_View << UIActionIndexRT_M_ViewPopup;
|
---|
3196 | }
|
---|
3197 |
|
---|
3198 | void UIActionPoolRuntime::setGuestScreenSize(int iGuestScreen, const QSize &size)
|
---|
3199 | {
|
---|
3200 | m_mapGuestScreenSize[iGuestScreen] = size;
|
---|
3201 | m_invalidations << UIActionIndexRT_M_View << UIActionIndexRT_M_ViewPopup;
|
---|
3202 | }
|
---|
3203 |
|
---|
3204 | void UIActionPoolRuntime::setGuestScreenVisible(int iGuestScreen, bool fVisible)
|
---|
3205 | {
|
---|
3206 | m_mapGuestScreenIsVisible[iGuestScreen] = fVisible;
|
---|
3207 | m_invalidations << UIActionIndexRT_M_View << UIActionIndexRT_M_ViewPopup;
|
---|
3208 | }
|
---|
3209 |
|
---|
3210 | void UIActionPoolRuntime::setGuestSupportsGraphics(bool fSupports)
|
---|
3211 | {
|
---|
3212 | m_fGuestSupportsGraphics = fSupports;
|
---|
3213 | m_invalidations << UIActionIndexRT_M_View << UIActionIndexRT_M_ViewPopup;
|
---|
3214 | }
|
---|
3215 |
|
---|
3216 | void UIActionPoolRuntime::setHostScreenForGuestScreenMap(const QMap<int, int> &scheme)
|
---|
3217 | {
|
---|
3218 | m_mapHostScreenForGuestScreen = scheme;
|
---|
3219 | m_invalidations << UIActionIndexRT_M_View << UIActionIndexRT_M_ViewPopup;
|
---|
3220 | }
|
---|
3221 |
|
---|
3222 | QMap<int, int> UIActionPoolRuntime::hostScreenForGuestScreenMap() const
|
---|
3223 | {
|
---|
3224 | return m_mapHostScreenForGuestScreen;
|
---|
3225 | }
|
---|
3226 |
|
---|
3227 | bool UIActionPoolRuntime::isAllowedInMenuMachine(UIExtraDataMetaDefs::RuntimeMenuMachineActionType type) const
|
---|
3228 | {
|
---|
3229 | foreach (const UIExtraDataMetaDefs::RuntimeMenuMachineActionType &restriction, m_restrictedActionsMenuMachine.values())
|
---|
3230 | if (restriction & type)
|
---|
3231 | return false;
|
---|
3232 | return true;
|
---|
3233 | }
|
---|
3234 |
|
---|
3235 | void UIActionPoolRuntime::setRestrictionForMenuMachine(UIActionRestrictionLevel level,
|
---|
3236 | UIExtraDataMetaDefs::RuntimeMenuMachineActionType restriction)
|
---|
3237 | {
|
---|
3238 | m_restrictedActionsMenuMachine[level] = restriction;
|
---|
3239 | m_invalidations << UIActionIndexRT_M_Machine;
|
---|
3240 | }
|
---|
3241 |
|
---|
3242 | bool UIActionPoolRuntime::isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType type) const
|
---|
3243 | {
|
---|
3244 | foreach (const UIExtraDataMetaDefs::RuntimeMenuViewActionType &restriction, m_restrictedActionsMenuView.values())
|
---|
3245 | if (restriction & type)
|
---|
3246 | return false;
|
---|
3247 | return true;
|
---|
3248 | }
|
---|
3249 |
|
---|
3250 | void UIActionPoolRuntime::setRestrictionForMenuView(UIActionRestrictionLevel level,
|
---|
3251 | UIExtraDataMetaDefs::RuntimeMenuViewActionType restriction)
|
---|
3252 | {
|
---|
3253 | m_restrictedActionsMenuView[level] = restriction;
|
---|
3254 | m_invalidations << UIActionIndexRT_M_View << UIActionIndexRT_M_ViewPopup;
|
---|
3255 | }
|
---|
3256 |
|
---|
3257 | bool UIActionPoolRuntime::isAllowedInMenuInput(UIExtraDataMetaDefs::RuntimeMenuInputActionType type) const
|
---|
3258 | {
|
---|
3259 | foreach (const UIExtraDataMetaDefs::RuntimeMenuInputActionType &restriction, m_restrictedActionsMenuInput.values())
|
---|
3260 | if (restriction & type)
|
---|
3261 | return false;
|
---|
3262 | return true;
|
---|
3263 | }
|
---|
3264 |
|
---|
3265 | void UIActionPoolRuntime::setRestrictionForMenuInput(UIActionRestrictionLevel level,
|
---|
3266 | UIExtraDataMetaDefs::RuntimeMenuInputActionType restriction)
|
---|
3267 | {
|
---|
3268 | m_restrictedActionsMenuInput[level] = restriction;
|
---|
3269 | m_invalidations << UIActionIndexRT_M_Input;
|
---|
3270 | }
|
---|
3271 |
|
---|
3272 | bool UIActionPoolRuntime::isAllowedInMenuDevices(UIExtraDataMetaDefs::RuntimeMenuDevicesActionType type) const
|
---|
3273 | {
|
---|
3274 | foreach (const UIExtraDataMetaDefs::RuntimeMenuDevicesActionType &restriction, m_restrictedActionsMenuDevices.values())
|
---|
3275 | if (restriction & type)
|
---|
3276 | return false;
|
---|
3277 | return true;
|
---|
3278 | }
|
---|
3279 |
|
---|
3280 | void UIActionPoolRuntime::setRestrictionForMenuDevices(UIActionRestrictionLevel level,
|
---|
3281 | UIExtraDataMetaDefs::RuntimeMenuDevicesActionType restriction)
|
---|
3282 | {
|
---|
3283 | m_restrictedActionsMenuDevices[level] = restriction;
|
---|
3284 | m_invalidations << UIActionIndexRT_M_Devices;
|
---|
3285 | }
|
---|
3286 |
|
---|
3287 | #ifdef VBOX_WITH_DEBUGGER_GUI
|
---|
3288 | bool UIActionPoolRuntime::isAllowedInMenuDebug(UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType type) const
|
---|
3289 | {
|
---|
3290 | foreach (const UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType &restriction, m_restrictedActionsMenuDebug.values())
|
---|
3291 | if (restriction & type)
|
---|
3292 | return false;
|
---|
3293 | return true;
|
---|
3294 | }
|
---|
3295 |
|
---|
3296 | void UIActionPoolRuntime::setRestrictionForMenuDebugger(UIActionRestrictionLevel level,
|
---|
3297 | UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType restriction)
|
---|
3298 | {
|
---|
3299 | m_restrictedActionsMenuDebug[level] = restriction;
|
---|
3300 | m_invalidations << UIActionIndexRT_M_Debug;
|
---|
3301 | }
|
---|
3302 | #endif /* VBOX_WITH_DEBUGGER_GUI */
|
---|
3303 |
|
---|
3304 | void UIActionPoolRuntime::preparePool()
|
---|
3305 | {
|
---|
3306 | /* 'Machine' actions: */
|
---|
3307 | m_pool[UIActionIndexRT_M_Machine] = new UIActionMenuRuntimeMachine(this);
|
---|
3308 | m_pool[UIActionIndexRT_M_Machine_S_Settings] = new UIActionSimpleRuntimeShowSettings(this);
|
---|
3309 | m_pool[UIActionIndexRT_M_Machine_S_TakeSnapshot] = new UIActionSimpleRuntimePerformTakeSnapshot(this);
|
---|
3310 | m_pool[UIActionIndexRT_M_Machine_S_ShowInformation] = new UIActionSimpleRuntimeShowInformationDialog(this);
|
---|
3311 | m_pool[UIActionIndexRT_M_Machine_S_ShowFileManager] = new UIActionSimpleRuntimeShowFileManagerDialog(this);
|
---|
3312 | m_pool[UIActionIndexRT_M_Machine_T_Pause] = new UIActionToggleRuntimePause(this);
|
---|
3313 | m_pool[UIActionIndexRT_M_Machine_S_Reset] = new UIActionSimpleRuntimePerformReset(this);
|
---|
3314 | m_pool[UIActionIndexRT_M_Machine_S_Detach] = new UIActionSimpleRuntimePerformDetach(this);
|
---|
3315 | m_pool[UIActionIndexRT_M_Machine_S_SaveState] = new UIActionSimpleRuntimePerformSaveState(this);
|
---|
3316 | m_pool[UIActionIndexRT_M_Machine_S_Shutdown] = new UIActionSimpleRuntimePerformShutdown(this);
|
---|
3317 | m_pool[UIActionIndexRT_M_Machine_S_PowerOff] = new UIActionSimpleRuntimePerformPowerOff(this);
|
---|
3318 | m_pool[UIActionIndexRT_M_Machine_S_ShowLogDialog] = new UIActionSimpleRuntimeShowLogs(this);
|
---|
3319 |
|
---|
3320 | /* 'View' actions: */
|
---|
3321 | m_pool[UIActionIndexRT_M_View] = new UIActionMenuRuntimeView(this);
|
---|
3322 | m_pool[UIActionIndexRT_M_ViewPopup] = new UIActionMenuRuntimeViewPopup(this);
|
---|
3323 | m_pool[UIActionIndexRT_M_View_T_Fullscreen] = new UIActionToggleRuntimeFullscreenMode(this);
|
---|
3324 | m_pool[UIActionIndexRT_M_View_T_Seamless] = new UIActionToggleRuntimeSeamlessMode(this);
|
---|
3325 | m_pool[UIActionIndexRT_M_View_T_Scale] = new UIActionToggleRuntimeScaledMode(this);
|
---|
3326 | #ifndef VBOX_WS_MAC
|
---|
3327 | m_pool[UIActionIndexRT_M_View_S_MinimizeWindow] = new UIActionSimpleRuntimePerformMinimizeWindow(this);
|
---|
3328 | #endif /* !VBOX_WS_MAC */
|
---|
3329 | m_pool[UIActionIndexRT_M_View_S_AdjustWindow] = new UIActionSimpleRuntimePerformWindowAdjust(this);
|
---|
3330 | m_pool[UIActionIndexRT_M_View_T_GuestAutoresize] = new UIActionToggleRuntimeGuestAutoresize(this);
|
---|
3331 | m_pool[UIActionIndexRT_M_View_S_TakeScreenshot] = new UIActionSimpleRuntimePerformTakeScreenshot(this);
|
---|
3332 | m_pool[UIActionIndexRT_M_View_M_Recording] = new UIActionMenuRuntimeRecording(this);
|
---|
3333 | m_pool[UIActionIndexRT_M_View_M_Recording_S_Settings] = new UIActionSimpleRuntimeShowRecordingSettings(this);
|
---|
3334 | m_pool[UIActionIndexRT_M_View_M_Recording_T_Start] = new UIActionToggleRuntimeRecording(this);
|
---|
3335 | m_pool[UIActionIndexRT_M_View_T_VRDEServer] = new UIActionToggleRuntimeVRDEServer(this);
|
---|
3336 | m_pool[UIActionIndexRT_M_View_M_MenuBar] = new UIActionMenuRuntimeMenuBar(this);
|
---|
3337 | m_pool[UIActionIndexRT_M_View_M_MenuBar_S_Settings] = new UIActionSimpleRuntimeShowMenuBarSettings(this);
|
---|
3338 | #ifndef VBOX_WS_MAC
|
---|
3339 | m_pool[UIActionIndexRT_M_View_M_MenuBar_T_Visibility] = new UIActionToggleRuntimeMenuBar(this);
|
---|
3340 | #endif /* !VBOX_WS_MAC */
|
---|
3341 | m_pool[UIActionIndexRT_M_View_M_StatusBar] = new UIActionMenuRuntimeStatusBar(this);
|
---|
3342 | m_pool[UIActionIndexRT_M_View_M_StatusBar_S_Settings] = new UIActionSimpleRuntimeShowStatusBarSettings(this);
|
---|
3343 | m_pool[UIActionIndexRT_M_View_M_StatusBar_T_Visibility] = new UIActionToggleRuntimeStatusBar(this);
|
---|
3344 |
|
---|
3345 | /* 'Input' actions: */
|
---|
3346 | m_pool[UIActionIndexRT_M_Input] = new UIActionMenuRuntimeInput(this);
|
---|
3347 | m_pool[UIActionIndexRT_M_Input_M_Keyboard] = new UIActionMenuRuntimeKeyboard(this);
|
---|
3348 | m_pool[UIActionIndexRT_M_Input_M_Keyboard_S_Settings] = new UIActionSimpleRuntimeShowKeyboardSettings(this);
|
---|
3349 | m_pool[UIActionIndexRT_M_Input_M_Keyboard_S_SoftKeyboard] = new UIActionSimpleRuntimeShowSoftKeyboard(this);
|
---|
3350 | m_pool[UIActionIndexRT_M_Input_M_Keyboard_S_TypeCAD] = new UIActionSimpleRuntimePerformTypeCAD(this);
|
---|
3351 | #ifdef VBOX_WS_NIX
|
---|
3352 | m_pool[UIActionIndexRT_M_Input_M_Keyboard_S_TypeCABS] = new UIActionSimpleRuntimePerformTypeCABS(this);
|
---|
3353 | #endif /* VBOX_WS_NIX */
|
---|
3354 | m_pool[UIActionIndexRT_M_Input_M_Keyboard_S_TypeCtrlBreak] = new UIActionSimpleRuntimePerformTypeCtrlBreak(this);
|
---|
3355 | m_pool[UIActionIndexRT_M_Input_M_Keyboard_S_TypeInsert] = new UIActionSimpleRuntimePerformTypeInsert(this);
|
---|
3356 | m_pool[UIActionIndexRT_M_Input_M_Keyboard_S_TypePrintScreen] = new UIActionSimpleRuntimePerformTypePrintScreen(this);
|
---|
3357 | m_pool[UIActionIndexRT_M_Input_M_Keyboard_S_TypeAltPrintScreen] = new UIActionSimpleRuntimePerformTypeAltPrintScreen(this);
|
---|
3358 | m_pool[UIActionIndexRT_M_Input_M_Keyboard_T_TypeHostKeyCombo] = new UIActionToggleRuntimePerformTypeHostKeyCombo(this);
|
---|
3359 | m_pool[UIActionIndexRT_M_Input_M_Mouse] = new UIActionMenuRuntimeMouse(this);
|
---|
3360 | m_pool[UIActionIndexRT_M_Input_M_Mouse_T_Integration] = new UIActionToggleRuntimeMouseIntegration(this);
|
---|
3361 |
|
---|
3362 | /* 'Devices' actions: */
|
---|
3363 | m_pool[UIActionIndexRT_M_Devices] = new UIActionMenuRuntimeDevices(this);
|
---|
3364 | m_pool[UIActionIndexRT_M_Devices_M_HardDrives] = new UIActionMenuRuntimeHardDrives(this);
|
---|
3365 | m_pool[UIActionIndexRT_M_Devices_M_HardDrives_S_Settings] = new UIActionSimpleRuntimeShowHardDrivesSettings(this);
|
---|
3366 | m_pool[UIActionIndexRT_M_Devices_M_OpticalDevices] = new UIActionMenuRuntimeOpticalDevices(this);
|
---|
3367 | m_pool[UIActionIndexRT_M_Devices_M_FloppyDevices] = new UIActionMenuRuntimeFloppyDevices(this);
|
---|
3368 | m_pool[UIActionIndexRT_M_Devices_M_Audio] = new UIActionMenuRuntimeAudio(this);
|
---|
3369 | m_pool[UIActionIndexRT_M_Devices_M_Audio_T_Output] = new UIActionToggleRuntimeAudioOutput(this);
|
---|
3370 | m_pool[UIActionIndexRT_M_Devices_M_Audio_T_Input] = new UIActionToggleRuntimeAudioInput(this);
|
---|
3371 | m_pool[UIActionIndexRT_M_Devices_M_Network] = new UIActionMenuRuntimeNetworkAdapters(this);
|
---|
3372 | m_pool[UIActionIndexRT_M_Devices_M_Network_S_Settings] = new UIActionSimpleRuntimeShowNetworkSettings(this);
|
---|
3373 | m_pool[UIActionIndexRT_M_Devices_M_USBDevices] = new UIActionMenuRuntimeUSBDevices(this);
|
---|
3374 | m_pool[UIActionIndexRT_M_Devices_M_USBDevices_S_Settings] = new UIActionSimpleRuntimeShowUSBDevicesSettings(this);
|
---|
3375 | m_pool[UIActionIndexRT_M_Devices_M_WebCams] = new UIActionMenuRuntimeWebCams(this);
|
---|
3376 | m_pool[UIActionIndexRT_M_Devices_M_SharedClipboard] = new UIActionMenuRuntimeSharedClipboard(this);
|
---|
3377 | m_pool[UIActionIndexRT_M_Devices_M_DragAndDrop] = new UIActionMenuRuntimeDragAndDrop(this);
|
---|
3378 | m_pool[UIActionIndexRT_M_Devices_M_SharedFolders] = new UIActionMenuRuntimeSharedFolders(this);
|
---|
3379 | m_pool[UIActionIndexRT_M_Devices_M_SharedFolders_S_Settings] = new UIActionSimpleRuntimeShowSharedFoldersSettings(this);
|
---|
3380 | m_pool[UIActionIndexRT_M_Devices_S_InsertGuestAdditionsDisk] = new UIActionSimpleRuntimePerformInsertGuestAdditionsDisk(this);
|
---|
3381 | m_pool[UIActionIndexRT_M_Devices_S_UpgradeGuestAdditions] = new UIActionSimpleRuntimePerformUpgradeGuestAdditions(this);
|
---|
3382 |
|
---|
3383 | #ifdef VBOX_WITH_DEBUGGER_GUI
|
---|
3384 | /* 'Debug' actions: */
|
---|
3385 | m_pool[UIActionIndexRT_M_Debug] = new UIActionMenuRuntimeDebug(this);
|
---|
3386 | m_pool[UIActionIndexRT_M_Debug_S_ShowStatistics] = new UIActionSimpleRuntimeShowStatistics(this);
|
---|
3387 | m_pool[UIActionIndexRT_M_Debug_S_ShowCommandLine] = new UIActionSimpleRuntimeShowCommandLine(this);
|
---|
3388 | m_pool[UIActionIndexRT_M_Debug_T_Logging] = new UIActionToggleRuntimeLogging(this);
|
---|
3389 | m_pool[UIActionIndexRT_M_Debug_S_GuestControlConsole] = new UIActionSimpleRuntimeGuestControlConsole(this);
|
---|
3390 | #endif /* VBOX_WITH_DEBUGGER_GUI */
|
---|
3391 |
|
---|
3392 | #ifdef VBOX_WS_MAC
|
---|
3393 | /* 'Dock' actions: */
|
---|
3394 | m_pool[UIActionIndexRT_M_Dock] = new UIActionMenuDock(this);
|
---|
3395 | m_pool[UIActionIndexRT_M_Dock_M_DockSettings] = new UIActionMenuDockSettings(this);
|
---|
3396 | m_pool[UIActionIndexRT_M_Dock_M_DockSettings_T_PreviewMonitor] = new UIActionToggleDockPreviewMonitor(this);
|
---|
3397 | m_pool[UIActionIndexRT_M_Dock_M_DockSettings_T_DisableMonitor] = new UIActionToggleDockDisableMonitor(this);
|
---|
3398 | m_pool[UIActionIndexRT_M_Dock_M_DockSettings_T_DisableOverlay] = new UIActionToggleDockIconDisableOverlay(this);
|
---|
3399 | #endif /* VBOX_WS_MAC */
|
---|
3400 |
|
---|
3401 | /* Prepare update-handlers for known menus: */
|
---|
3402 | m_menuUpdateHandlers[UIActionIndexRT_M_Machine].ptfr = &UIActionPoolRuntime::updateMenuMachine;
|
---|
3403 | m_menuUpdateHandlers[UIActionIndexRT_M_View].ptfr = &UIActionPoolRuntime::updateMenuView;
|
---|
3404 | m_menuUpdateHandlers[UIActionIndexRT_M_ViewPopup].ptfr = &UIActionPoolRuntime::updateMenuViewPopup;
|
---|
3405 | m_menuUpdateHandlers[UIActionIndexRT_M_View_M_Recording].ptfr = &UIActionPoolRuntime::updateMenuViewRecording;
|
---|
3406 | m_menuUpdateHandlers[UIActionIndexRT_M_View_M_MenuBar].ptfr = &UIActionPoolRuntime::updateMenuViewMenuBar;
|
---|
3407 | m_menuUpdateHandlers[UIActionIndexRT_M_View_M_StatusBar].ptfr = &UIActionPoolRuntime::updateMenuViewStatusBar;
|
---|
3408 | m_menuUpdateHandlers[UIActionIndexRT_M_Input].ptfr = &UIActionPoolRuntime::updateMenuInput;
|
---|
3409 | m_menuUpdateHandlers[UIActionIndexRT_M_Input_M_Keyboard].ptfr = &UIActionPoolRuntime::updateMenuInputKeyboard;
|
---|
3410 | m_menuUpdateHandlers[UIActionIndexRT_M_Input_M_Mouse].ptfr = &UIActionPoolRuntime::updateMenuInputMouse;
|
---|
3411 | m_menuUpdateHandlers[UIActionIndexRT_M_Devices].ptfr = &UIActionPoolRuntime::updateMenuDevices;
|
---|
3412 | m_menuUpdateHandlers[UIActionIndexRT_M_Devices_M_HardDrives].ptfr = &UIActionPoolRuntime::updateMenuDevicesHardDrives;
|
---|
3413 | m_menuUpdateHandlers[UIActionIndexRT_M_Devices_M_Audio].ptfr = &UIActionPoolRuntime::updateMenuDevicesAudio;
|
---|
3414 | m_menuUpdateHandlers[UIActionIndexRT_M_Devices_M_Network].ptfr = &UIActionPoolRuntime::updateMenuDevicesNetwork;
|
---|
3415 | m_menuUpdateHandlers[UIActionIndexRT_M_Devices_M_USBDevices].ptfr = &UIActionPoolRuntime::updateMenuDevicesUSBDevices;
|
---|
3416 | m_menuUpdateHandlers[UIActionIndexRT_M_Devices_M_SharedFolders].ptfr = &UIActionPoolRuntime::updateMenuDevicesSharedFolders;
|
---|
3417 | #ifdef VBOX_WITH_DEBUGGER_GUI
|
---|
3418 | m_menuUpdateHandlers[UIActionIndexRT_M_Debug].ptfr = &UIActionPoolRuntime::updateMenuDebug;
|
---|
3419 | #endif /* VBOX_WITH_DEBUGGER_GUI */
|
---|
3420 |
|
---|
3421 | /* Call to base-class: */
|
---|
3422 | UIActionPool::preparePool();
|
---|
3423 | }
|
---|
3424 |
|
---|
3425 | void UIActionPoolRuntime::prepareConnections()
|
---|
3426 | {
|
---|
3427 | /* Prepare connections: */
|
---|
3428 | connect(gShortcutPool, &UIShortcutPool::sigManagerShortcutsReloaded,
|
---|
3429 | this, &UIActionPoolRuntime::sltApplyShortcuts);
|
---|
3430 | connect(gShortcutPool, &UIShortcutPool::sigRuntimeShortcutsReloaded,
|
---|
3431 | this, &UIActionPoolRuntime::sltApplyShortcuts);
|
---|
3432 | connect(gEDataManager, &UIExtraDataManager::sigMenuBarConfigurationChange,
|
---|
3433 | this, &UIActionPoolRuntime::sltHandleConfigurationChange);
|
---|
3434 |
|
---|
3435 | /* Call to base-class: */
|
---|
3436 | UIActionPool::prepareConnections();
|
---|
3437 | }
|
---|
3438 |
|
---|
3439 | void UIActionPoolRuntime::updateConfiguration()
|
---|
3440 | {
|
---|
3441 | /* Get machine ID: */
|
---|
3442 | const QUuid uMachineID = uiCommon().managedVMUuid();
|
---|
3443 | if (uMachineID.isNull())
|
---|
3444 | return;
|
---|
3445 |
|
---|
3446 | /* Recache common action restrictions: */
|
---|
3447 | m_restrictedMenus[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuTypes(uMachineID);
|
---|
3448 | m_restrictedActionsMenuApplication[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuApplicationActionTypes(uMachineID);
|
---|
3449 | m_restrictedActionsMenuMachine[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuMachineActionTypes(uMachineID);
|
---|
3450 | m_restrictedActionsMenuView[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuViewActionTypes(uMachineID);
|
---|
3451 | m_restrictedActionsMenuInput[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuInputActionTypes(uMachineID);
|
---|
3452 | m_restrictedActionsMenuDevices[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuDevicesActionTypes(uMachineID);
|
---|
3453 | #ifdef VBOX_WITH_DEBUGGER_GUI
|
---|
3454 | m_restrictedActionsMenuDebug[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuDebuggerActionTypes(uMachineID);
|
---|
3455 | #endif /* VBOX_WITH_DEBUGGER_GUI */
|
---|
3456 | #ifdef VBOX_WS_MAC
|
---|
3457 | m_restrictedActionsMenuWindow[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuWindowActionTypes(uMachineID);
|
---|
3458 | #endif /* VBOX_WS_MAC */
|
---|
3459 | m_restrictedActionsMenuHelp[UIActionRestrictionLevel_Base] = gEDataManager->restrictedRuntimeMenuHelpActionTypes(uMachineID);
|
---|
3460 |
|
---|
3461 | /* Recache visual state action restrictions: */
|
---|
3462 | UIVisualStateType restrictedVisualStates = gEDataManager->restrictedVisualStates(uMachineID);
|
---|
3463 | {
|
---|
3464 | if (restrictedVisualStates & UIVisualStateType_Fullscreen)
|
---|
3465 | m_restrictedActionsMenuView[UIActionRestrictionLevel_Base] = (UIExtraDataMetaDefs::RuntimeMenuViewActionType)
|
---|
3466 | (m_restrictedActionsMenuView[UIActionRestrictionLevel_Base] | UIExtraDataMetaDefs::RuntimeMenuViewActionType_Fullscreen);
|
---|
3467 | if (restrictedVisualStates & UIVisualStateType_Seamless)
|
---|
3468 | m_restrictedActionsMenuView[UIActionRestrictionLevel_Base] = (UIExtraDataMetaDefs::RuntimeMenuViewActionType)
|
---|
3469 | (m_restrictedActionsMenuView[UIActionRestrictionLevel_Base] | UIExtraDataMetaDefs::RuntimeMenuViewActionType_Seamless);
|
---|
3470 | if (restrictedVisualStates & UIVisualStateType_Scale)
|
---|
3471 | m_restrictedActionsMenuView[UIActionRestrictionLevel_Base] = (UIExtraDataMetaDefs::RuntimeMenuViewActionType)
|
---|
3472 | (m_restrictedActionsMenuView[UIActionRestrictionLevel_Base] | UIExtraDataMetaDefs::RuntimeMenuViewActionType_Scale);
|
---|
3473 | }
|
---|
3474 |
|
---|
3475 | /* Recache reconfiguration action restrictions: */
|
---|
3476 | bool fReconfigurationAllowed = gEDataManager->machineReconfigurationEnabled(uMachineID);
|
---|
3477 | if (!fReconfigurationAllowed)
|
---|
3478 | {
|
---|
3479 | m_restrictedActionsMenuMachine[UIActionRestrictionLevel_Base] = (UIExtraDataMetaDefs::RuntimeMenuMachineActionType)
|
---|
3480 | (m_restrictedActionsMenuMachine[UIActionRestrictionLevel_Base] | UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SettingsDialog);
|
---|
3481 | m_restrictedActionsMenuView[UIActionRestrictionLevel_Base] = (UIExtraDataMetaDefs::RuntimeMenuViewActionType)
|
---|
3482 | (m_restrictedActionsMenuView[UIActionRestrictionLevel_Base] | UIExtraDataMetaDefs::RuntimeMenuViewActionType_RecordingSettings);
|
---|
3483 | m_restrictedActionsMenuInput[UIActionRestrictionLevel_Base] = (UIExtraDataMetaDefs::RuntimeMenuInputActionType)
|
---|
3484 | (m_restrictedActionsMenuInput[UIActionRestrictionLevel_Base] | UIExtraDataMetaDefs::RuntimeMenuInputActionType_KeyboardSettings);
|
---|
3485 | m_restrictedActionsMenuInput[UIActionRestrictionLevel_Base] = (UIExtraDataMetaDefs::RuntimeMenuInputActionType)
|
---|
3486 | (m_restrictedActionsMenuInput[UIActionRestrictionLevel_Base] | UIExtraDataMetaDefs::RuntimeMenuInputActionType_SoftKeyboard);
|
---|
3487 | m_restrictedActionsMenuDevices[UIActionRestrictionLevel_Base] = (UIExtraDataMetaDefs::RuntimeMenuDevicesActionType)
|
---|
3488 | (m_restrictedActionsMenuDevices[UIActionRestrictionLevel_Base] | UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_HardDrivesSettings);
|
---|
3489 | m_restrictedActionsMenuDevices[UIActionRestrictionLevel_Base] = (UIExtraDataMetaDefs::RuntimeMenuDevicesActionType)
|
---|
3490 | (m_restrictedActionsMenuDevices[UIActionRestrictionLevel_Base] | UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_NetworkSettings);
|
---|
3491 | m_restrictedActionsMenuDevices[UIActionRestrictionLevel_Base] = (UIExtraDataMetaDefs::RuntimeMenuDevicesActionType)
|
---|
3492 | (m_restrictedActionsMenuDevices[UIActionRestrictionLevel_Base] | UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_USBDevicesSettings);
|
---|
3493 | m_restrictedActionsMenuDevices[UIActionRestrictionLevel_Base] = (UIExtraDataMetaDefs::RuntimeMenuDevicesActionType)
|
---|
3494 | (m_restrictedActionsMenuDevices[UIActionRestrictionLevel_Base] | UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedFoldersSettings);
|
---|
3495 | }
|
---|
3496 |
|
---|
3497 | /* Recache snapshot related action restrictions: */
|
---|
3498 | bool fSnapshotOperationsAllowed = gEDataManager->machineSnapshotOperationsEnabled(uMachineID);
|
---|
3499 | if (!fSnapshotOperationsAllowed)
|
---|
3500 | {
|
---|
3501 | m_restrictedActionsMenuMachine[UIActionRestrictionLevel_Base] = (UIExtraDataMetaDefs::RuntimeMenuMachineActionType)
|
---|
3502 | (m_restrictedActionsMenuMachine[UIActionRestrictionLevel_Base] | UIExtraDataMetaDefs::RuntimeMenuMachineActionType_TakeSnapshot);
|
---|
3503 | }
|
---|
3504 |
|
---|
3505 | /* Recache extension-pack related action restrictions: */
|
---|
3506 | CExtPackManager extPackManager = gpGlobalSession->virtualBox().GetExtensionPackManager();
|
---|
3507 | if (extPackManager.isNull() || !extPackManager.IsExtPackUsable(GUI_ExtPackName))
|
---|
3508 | {
|
---|
3509 | m_restrictedActionsMenuView[UIActionRestrictionLevel_Base] = (UIExtraDataMetaDefs::RuntimeMenuViewActionType)
|
---|
3510 | (m_restrictedActionsMenuView[UIActionRestrictionLevel_Base] | UIExtraDataMetaDefs::RuntimeMenuViewActionType_VRDEServer);
|
---|
3511 | }
|
---|
3512 |
|
---|
3513 | /* Recache close related action restrictions: */
|
---|
3514 | MachineCloseAction restrictedCloseActions = gEDataManager->restrictedMachineCloseActions(uMachineID);
|
---|
3515 | bool fAllCloseActionsRestricted = (!uiCommon().isSeparateProcess() || (restrictedCloseActions & MachineCloseAction_Detach))
|
---|
3516 | && (restrictedCloseActions & MachineCloseAction_SaveState)
|
---|
3517 | && (restrictedCloseActions & MachineCloseAction_Shutdown)
|
---|
3518 | && (restrictedCloseActions & MachineCloseAction_PowerOff);
|
---|
3519 | if (fAllCloseActionsRestricted)
|
---|
3520 | {
|
---|
3521 | m_restrictedActionsMenuApplication[UIActionRestrictionLevel_Base] = (UIExtraDataMetaDefs::MenuApplicationActionType)
|
---|
3522 | (m_restrictedActionsMenuApplication[UIActionRestrictionLevel_Base] | UIExtraDataMetaDefs::MenuApplicationActionType_Close);
|
---|
3523 | }
|
---|
3524 |
|
---|
3525 | /* Call to base-class: */
|
---|
3526 | UIActionPool::updateConfiguration();
|
---|
3527 | }
|
---|
3528 |
|
---|
3529 | void UIActionPoolRuntime::updateMenu(int iIndex)
|
---|
3530 | {
|
---|
3531 | /* If index belongs to base-class => delegate to base-class: */
|
---|
3532 | if (iIndex < UIActionIndex_Max)
|
---|
3533 | UIActionPool::updateMenu(iIndex);
|
---|
3534 | /* Otherwise,
|
---|
3535 | * if menu with such index is invalidated
|
---|
3536 | * and there is update-handler => handle it here: */
|
---|
3537 | else if ( iIndex > UIActionIndex_Max
|
---|
3538 | && m_invalidations.contains(iIndex)
|
---|
3539 | && m_menuUpdateHandlers.contains(iIndex))
|
---|
3540 | (this->*(m_menuUpdateHandlers.value(iIndex).ptfr))();
|
---|
3541 | }
|
---|
3542 |
|
---|
3543 | void UIActionPoolRuntime::updateMenus()
|
---|
3544 | {
|
---|
3545 | /* Clear menu list: */
|
---|
3546 | m_mainMenus.clear();
|
---|
3547 |
|
---|
3548 | /* 'Application' menu: */
|
---|
3549 | addMenu(m_mainMenus, action(UIActionIndex_M_Application));
|
---|
3550 | updateMenuApplication();
|
---|
3551 |
|
---|
3552 | /* 'Machine' menu: */
|
---|
3553 | addMenu(m_mainMenus, action(UIActionIndexRT_M_Machine));
|
---|
3554 | updateMenuMachine();
|
---|
3555 |
|
---|
3556 | /* 'View' menu: */
|
---|
3557 | addMenu(m_mainMenus, action(UIActionIndexRT_M_View));
|
---|
3558 | updateMenuView();
|
---|
3559 | /* 'View' popup menu: */
|
---|
3560 | addMenu(m_mainMenus, action(UIActionIndexRT_M_ViewPopup), false);
|
---|
3561 | updateMenuViewPopup();
|
---|
3562 |
|
---|
3563 | /* 'Input' menu: */
|
---|
3564 | addMenu(m_mainMenus, action(UIActionIndexRT_M_Input));
|
---|
3565 | updateMenuInput();
|
---|
3566 |
|
---|
3567 | /* 'Devices' menu: */
|
---|
3568 | addMenu(m_mainMenus, action(UIActionIndexRT_M_Devices));
|
---|
3569 | updateMenuDevices();
|
---|
3570 |
|
---|
3571 | #ifdef VBOX_WITH_DEBUGGER_GUI
|
---|
3572 | /* 'Debug' menu: */
|
---|
3573 | addMenu(m_mainMenus, action(UIActionIndexRT_M_Debug), uiCommon().isDebuggerEnabled());
|
---|
3574 | updateMenuDebug();
|
---|
3575 | #endif
|
---|
3576 |
|
---|
3577 | #ifdef VBOX_WS_MAC
|
---|
3578 | /* 'Window' menu: */
|
---|
3579 | addMenu(m_mainMenus, action(UIActionIndex_M_Window));
|
---|
3580 | updateMenuWindow();
|
---|
3581 | #endif
|
---|
3582 |
|
---|
3583 | /* 'Help' menu: */
|
---|
3584 | addMenu(m_mainMenus, action(UIActionIndex_Menu_Help));
|
---|
3585 | updateMenuHelp();
|
---|
3586 |
|
---|
3587 | /* 'Log Viewer' menu: */
|
---|
3588 | updateMenuLogViewerWindow();
|
---|
3589 |
|
---|
3590 | /* 'File Manager' menu: */
|
---|
3591 | updateMenuFileManager();
|
---|
3592 | }
|
---|
3593 |
|
---|
3594 | QString UIActionPoolRuntime::shortcutsExtraDataID() const
|
---|
3595 | {
|
---|
3596 | return GUI_Input_MachineShortcuts;
|
---|
3597 | }
|
---|
3598 |
|
---|
3599 | void UIActionPoolRuntime::updateShortcuts()
|
---|
3600 | {
|
---|
3601 | /* Call to base-class: */
|
---|
3602 | UIActionPool::updateShortcuts();
|
---|
3603 | /* Create temporary Manager UI pool to do the same: */
|
---|
3604 | if (!isTemporary())
|
---|
3605 | UIActionPool::createTemporary(UIType_ManagerUI);
|
---|
3606 | }
|
---|
3607 |
|
---|
3608 | void UIActionPoolRuntime::sltHandleConfigurationChange(const QUuid &uMachineID)
|
---|
3609 | {
|
---|
3610 | /* Skip unrelated machine IDs: */
|
---|
3611 | if (uiCommon().managedVMUuid() != uMachineID)
|
---|
3612 | return;
|
---|
3613 |
|
---|
3614 | /* Update configuration: */
|
---|
3615 | updateConfiguration();
|
---|
3616 | }
|
---|
3617 |
|
---|
3618 | void UIActionPoolRuntime::sltPrepareMenuViewScreen()
|
---|
3619 | {
|
---|
3620 | /* Make sure sender is valid: */
|
---|
3621 | QMenu *pMenu = qobject_cast<QMenu*>(sender());
|
---|
3622 | AssertPtrReturnVoid(pMenu);
|
---|
3623 |
|
---|
3624 | /* Do we have to show resize, remap or rescale actions? */
|
---|
3625 | const bool fAllowToShowActionResize = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Resize);
|
---|
3626 | const bool fAllowToShowActionRemap = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Remap);
|
---|
3627 | const bool fAllowToShowActionRescale = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Rescale);
|
---|
3628 |
|
---|
3629 | /* Clear contents: */
|
---|
3630 | pMenu->clear();
|
---|
3631 |
|
---|
3632 | /* Separator: */
|
---|
3633 | bool fSeparator = false;
|
---|
3634 |
|
---|
3635 | /* Resize actions: */
|
---|
3636 | if (fAllowToShowActionResize)
|
---|
3637 | {
|
---|
3638 | updateMenuViewResize(pMenu);
|
---|
3639 | fSeparator = true;
|
---|
3640 | }
|
---|
3641 |
|
---|
3642 | /* Separator: */
|
---|
3643 | if (fSeparator)
|
---|
3644 | {
|
---|
3645 | pMenu->addSeparator();
|
---|
3646 | fSeparator = false;
|
---|
3647 | }
|
---|
3648 |
|
---|
3649 | /* Remap actions: */
|
---|
3650 | if (fAllowToShowActionRemap && (m_cHostScreens > 1 || m_cGuestScreens > 1))
|
---|
3651 | {
|
---|
3652 | updateMenuViewRemap(pMenu);
|
---|
3653 | fSeparator = true;
|
---|
3654 | }
|
---|
3655 |
|
---|
3656 | /* Separator: */
|
---|
3657 | if (fSeparator)
|
---|
3658 | {
|
---|
3659 | pMenu->addSeparator();
|
---|
3660 | fSeparator = false;
|
---|
3661 | }
|
---|
3662 |
|
---|
3663 | /* Rescale actions: */
|
---|
3664 | if (fAllowToShowActionRescale)
|
---|
3665 | {
|
---|
3666 | updateMenuViewRescale(pMenu);
|
---|
3667 | fSeparator = true;
|
---|
3668 | }
|
---|
3669 | }
|
---|
3670 |
|
---|
3671 | void UIActionPoolRuntime::sltHandleActionTriggerViewScreenToggle()
|
---|
3672 | {
|
---|
3673 | /* Make sure sender is valid: */
|
---|
3674 | QAction *pAction = qobject_cast<QAction*>(sender());
|
---|
3675 | AssertPtrReturnVoid(pAction);
|
---|
3676 |
|
---|
3677 | /* Send request to enable/disable guest-screen: */
|
---|
3678 | const int iGuestScreenIndex = pAction->property("Guest Screen Index").toInt();
|
---|
3679 | const bool fScreenEnabled = pAction->isChecked();
|
---|
3680 | emit sigNotifyAboutTriggeringViewScreenToggle(iGuestScreenIndex, fScreenEnabled);
|
---|
3681 | }
|
---|
3682 |
|
---|
3683 | void UIActionPoolRuntime::sltHandleActionTriggerViewScreenResize(QAction *pAction)
|
---|
3684 | {
|
---|
3685 | /* Make sure sender is valid: */
|
---|
3686 | AssertPtrReturnVoid(pAction);
|
---|
3687 |
|
---|
3688 | /* Send request to resize guest-screen to required size: */
|
---|
3689 | const int iGuestScreenIndex = pAction->property("Guest Screen Index").toInt();
|
---|
3690 | const QSize size = pAction->property("Requested Size").toSize();
|
---|
3691 | emit sigNotifyAboutTriggeringViewScreenResize(iGuestScreenIndex, size);
|
---|
3692 | }
|
---|
3693 |
|
---|
3694 | void UIActionPoolRuntime::sltHandleActionTriggerViewScreenRemap(QAction *pAction)
|
---|
3695 | {
|
---|
3696 | /* Make sure sender is valid: */
|
---|
3697 | AssertPtrReturnVoid(pAction);
|
---|
3698 |
|
---|
3699 | /* Send request to remap guest-screen to required host-screen: */
|
---|
3700 | const int iGuestScreenIndex = pAction->property("Guest Screen Index").toInt();
|
---|
3701 | const int iHostScreenIndex = pAction->property("Host Screen Index").toInt();
|
---|
3702 | emit sigNotifyAboutTriggeringViewScreenRemap(iGuestScreenIndex, iHostScreenIndex);
|
---|
3703 | }
|
---|
3704 |
|
---|
3705 | void UIActionPoolRuntime::sltHandleActionTriggerViewScreenRescale(QAction *pAction)
|
---|
3706 | {
|
---|
3707 | /* Make sure sender is valid: */
|
---|
3708 | AssertPtrReturnVoid(pAction);
|
---|
3709 |
|
---|
3710 | /* Change scale-factor directly: */
|
---|
3711 | const double dScaleFactor = pAction->property("Requested Scale Factor").toDouble();
|
---|
3712 | const int iGuestScreenIndex = pAction->property("Guest Screen Index").toInt();
|
---|
3713 | gEDataManager->setScaleFactor(dScaleFactor, uiCommon().managedVMUuid(), iGuestScreenIndex);
|
---|
3714 | }
|
---|
3715 |
|
---|
3716 | void UIActionPoolRuntime::updateMenuMachine()
|
---|
3717 | {
|
---|
3718 | /* Get corresponding menu: */
|
---|
3719 | UIMenu *pMenu = action(UIActionIndexRT_M_Machine)->menu();
|
---|
3720 | AssertPtrReturnVoid(pMenu);
|
---|
3721 | /* Clear contents: */
|
---|
3722 | pMenu->clear();
|
---|
3723 |
|
---|
3724 | /* Separator: */
|
---|
3725 | bool fSeparator = false;
|
---|
3726 |
|
---|
3727 | /* 'Settings Dialog' action: */
|
---|
3728 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_Settings)) || fSeparator;
|
---|
3729 |
|
---|
3730 | /* Separator: */
|
---|
3731 | if (fSeparator)
|
---|
3732 | {
|
---|
3733 | pMenu->addSeparator();
|
---|
3734 | fSeparator = false;
|
---|
3735 | }
|
---|
3736 |
|
---|
3737 | /* 'Take Snapshot' action: */
|
---|
3738 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_TakeSnapshot)) || fSeparator;
|
---|
3739 | /* 'Information Dialog' action: */
|
---|
3740 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_ShowInformation)) || fSeparator;
|
---|
3741 | /* 'File Manager' action: */
|
---|
3742 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_ShowFileManager)) || fSeparator;
|
---|
3743 | /* 'Log Dialog' action: */
|
---|
3744 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_ShowLogDialog)) || fSeparator;
|
---|
3745 |
|
---|
3746 | /* Separator: */
|
---|
3747 | if (fSeparator)
|
---|
3748 | {
|
---|
3749 | pMenu->addSeparator();
|
---|
3750 | fSeparator = false;
|
---|
3751 | }
|
---|
3752 |
|
---|
3753 | /* 'Pause' action: */
|
---|
3754 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_T_Pause)) || fSeparator;
|
---|
3755 | /* 'Reset' action: */
|
---|
3756 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_Reset)) || fSeparator;
|
---|
3757 | /* 'Detach' action: */
|
---|
3758 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_Detach)) || fSeparator;
|
---|
3759 | /* 'SaveState' action: */
|
---|
3760 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_SaveState)) || fSeparator;
|
---|
3761 | /* 'Shutdown' action: */
|
---|
3762 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_Shutdown)) || fSeparator;
|
---|
3763 | /* 'PowerOff' action: */
|
---|
3764 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Machine_S_PowerOff)) || fSeparator;
|
---|
3765 |
|
---|
3766 | /* Mark menu as valid: */
|
---|
3767 | m_invalidations.remove(UIActionIndexRT_M_Machine);
|
---|
3768 | }
|
---|
3769 |
|
---|
3770 | void UIActionPoolRuntime::updateMenuView()
|
---|
3771 | {
|
---|
3772 | /* Get corresponding menu: */
|
---|
3773 | UIMenu *pMenu = action(UIActionIndexRT_M_View)->menu();
|
---|
3774 | AssertPtrReturnVoid(pMenu);
|
---|
3775 | /* Clear contents: */
|
---|
3776 | pMenu->clear();
|
---|
3777 |
|
---|
3778 | /* Separator: */
|
---|
3779 | bool fSeparator = false;
|
---|
3780 |
|
---|
3781 | /* 'Fullscreen' action: */
|
---|
3782 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_View_T_Fullscreen)) || fSeparator;
|
---|
3783 | /* 'Seamless' action: */
|
---|
3784 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_View_T_Seamless)) || fSeparator;
|
---|
3785 | /* 'Scale' action: */
|
---|
3786 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_View_T_Scale)) || fSeparator;
|
---|
3787 |
|
---|
3788 | /* Separator: */
|
---|
3789 | if (fSeparator)
|
---|
3790 | {
|
---|
3791 | pMenu->addSeparator();
|
---|
3792 | fSeparator = false;
|
---|
3793 | }
|
---|
3794 |
|
---|
3795 | /* 'Adjust Window' action: */
|
---|
3796 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_View_S_AdjustWindow)) || fSeparator;
|
---|
3797 | /* 'Guest Autoresize' action: */
|
---|
3798 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_View_T_GuestAutoresize)) || fSeparator;
|
---|
3799 |
|
---|
3800 | /* Separator: */
|
---|
3801 | if (fSeparator)
|
---|
3802 | {
|
---|
3803 | pMenu->addSeparator();
|
---|
3804 | fSeparator = false;
|
---|
3805 | }
|
---|
3806 |
|
---|
3807 | /* 'Take Screenshot' action: */
|
---|
3808 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_View_S_TakeScreenshot)) || fSeparator;
|
---|
3809 | /* 'Recording' submenu: */
|
---|
3810 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_View_M_Recording), false) || fSeparator;
|
---|
3811 | updateMenuViewRecording();
|
---|
3812 | /* 'Recording Start' action: */
|
---|
3813 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_View_M_Recording_T_Start)) || fSeparator;
|
---|
3814 | /* 'VRDE Server' action: */
|
---|
3815 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_View_T_VRDEServer)) || fSeparator;
|
---|
3816 |
|
---|
3817 | /* Separator: */
|
---|
3818 | if (fSeparator)
|
---|
3819 | {
|
---|
3820 | pMenu->addSeparator();
|
---|
3821 | fSeparator = false;
|
---|
3822 | }
|
---|
3823 |
|
---|
3824 | /* 'Menu Bar' submenu: */
|
---|
3825 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_View_M_MenuBar)) || fSeparator;
|
---|
3826 | updateMenuViewMenuBar();
|
---|
3827 | /* 'Status Bar' submenu: */
|
---|
3828 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_View_M_StatusBar)) || fSeparator;
|
---|
3829 | updateMenuViewStatusBar();
|
---|
3830 |
|
---|
3831 | /* Separator: */
|
---|
3832 | if (fSeparator)
|
---|
3833 | {
|
---|
3834 | pMenu->addSeparator();
|
---|
3835 | fSeparator = false;
|
---|
3836 | }
|
---|
3837 |
|
---|
3838 | /* Do we have to show resize, remap or rescale actions? */
|
---|
3839 | const bool fAllowToShowActionResize = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Resize);
|
---|
3840 | const bool fAllowToShowActionRemap = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Remap);
|
---|
3841 | const bool fAllowToShowActionRescale = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Rescale);
|
---|
3842 | if (fAllowToShowActionResize || fAllowToShowActionRemap || fAllowToShowActionRescale)
|
---|
3843 | {
|
---|
3844 | for (int iGuestScreenIndex = 0; iGuestScreenIndex < m_cGuestScreens; ++iGuestScreenIndex)
|
---|
3845 | {
|
---|
3846 | /* Add 'Virtual Screen %1' menu: */
|
---|
3847 | QMenu *pSubMenu = pMenu->addMenu(UIIconPool::iconSet(":/virtual_screen_16px.png",
|
---|
3848 | ":/virtual_screen_disabled_16px.png"),
|
---|
3849 | QApplication::translate("UIActionPool", "Virtual Screen %1").arg(iGuestScreenIndex + 1));
|
---|
3850 | pSubMenu->setProperty("Guest Screen Index", iGuestScreenIndex);
|
---|
3851 | connect(pSubMenu, &QMenu::aboutToShow, this, &UIActionPoolRuntime::sltPrepareMenuViewScreen);
|
---|
3852 | }
|
---|
3853 | }
|
---|
3854 |
|
---|
3855 | /* Mark menu as valid: */
|
---|
3856 | m_invalidations.remove(UIActionIndexRT_M_View);
|
---|
3857 | }
|
---|
3858 |
|
---|
3859 | void UIActionPoolRuntime::updateMenuViewPopup()
|
---|
3860 | {
|
---|
3861 | /* Get corresponding menu: */
|
---|
3862 | UIMenu *pMenu = action(UIActionIndexRT_M_ViewPopup)->menu();
|
---|
3863 | AssertPtrReturnVoid(pMenu);
|
---|
3864 | /* Clear contents: */
|
---|
3865 | pMenu->clear();
|
---|
3866 |
|
---|
3867 | /* Separator: */
|
---|
3868 | bool fSeparator = false;
|
---|
3869 |
|
---|
3870 | /* 'Adjust Window' action: */
|
---|
3871 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_View_S_AdjustWindow)) || fSeparator;
|
---|
3872 | /* 'Guest Autoresize' action: */
|
---|
3873 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_View_T_GuestAutoresize)) || fSeparator;
|
---|
3874 |
|
---|
3875 | /* Separator: */
|
---|
3876 | if (fSeparator)
|
---|
3877 | {
|
---|
3878 | pMenu->addSeparator();
|
---|
3879 | fSeparator = false;
|
---|
3880 | }
|
---|
3881 |
|
---|
3882 | /* Do we have to show resize or rescale actions? */
|
---|
3883 | const bool fAllowToShowActionResize = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Resize);
|
---|
3884 | const bool fAllowToShowActionRescale = isAllowedInMenuView(UIExtraDataMetaDefs::RuntimeMenuViewActionType_Rescale);
|
---|
3885 | if (fAllowToShowActionResize || fAllowToShowActionRescale)
|
---|
3886 | {
|
---|
3887 | for (int iGuestScreenIndex = 0; iGuestScreenIndex < m_cGuestScreens; ++iGuestScreenIndex)
|
---|
3888 | {
|
---|
3889 | /* Add 'Virtual Screen %1' menu: */
|
---|
3890 | QMenu *pSubMenu = pMenu->addMenu(UIIconPool::iconSet(":/virtual_screen_16px.png",
|
---|
3891 | ":/virtual_screen_disabled_16px.png"),
|
---|
3892 | QApplication::translate("UIActionPool", "Virtual Screen %1").arg(iGuestScreenIndex + 1));
|
---|
3893 | pSubMenu->setProperty("Guest Screen Index", iGuestScreenIndex);
|
---|
3894 | connect(pSubMenu, &QMenu::aboutToShow, this, &UIActionPoolRuntime::sltPrepareMenuViewScreen);
|
---|
3895 | }
|
---|
3896 | }
|
---|
3897 |
|
---|
3898 | /* Mark menu as valid: */
|
---|
3899 | m_invalidations.remove(UIActionIndexRT_M_ViewPopup);
|
---|
3900 | }
|
---|
3901 |
|
---|
3902 | void UIActionPoolRuntime::updateMenuViewRecording()
|
---|
3903 | {
|
---|
3904 | /* Get corresponding menu: */
|
---|
3905 | UIMenu *pMenu = action(UIActionIndexRT_M_View_M_Recording)->menu();
|
---|
3906 | AssertPtrReturnVoid(pMenu);
|
---|
3907 | /* Clear contents: */
|
---|
3908 | pMenu->clear();
|
---|
3909 |
|
---|
3910 | /* Separator: */
|
---|
3911 | bool fSeparator = false;
|
---|
3912 |
|
---|
3913 | /* 'Recording Settings' action: */
|
---|
3914 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_View_M_Recording_S_Settings)) || fSeparator;
|
---|
3915 |
|
---|
3916 | /* Separator: */
|
---|
3917 | if (fSeparator)
|
---|
3918 | {
|
---|
3919 | pMenu->addSeparator();
|
---|
3920 | fSeparator = false;
|
---|
3921 | }
|
---|
3922 |
|
---|
3923 | /* 'Start Recording' action: */
|
---|
3924 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_View_M_Recording_T_Start)) || fSeparator;
|
---|
3925 |
|
---|
3926 | /* Mark menu as valid: */
|
---|
3927 | m_invalidations.remove(UIActionIndexRT_M_View_M_Recording);
|
---|
3928 | }
|
---|
3929 |
|
---|
3930 | void UIActionPoolRuntime::updateMenuViewMenuBar()
|
---|
3931 | {
|
---|
3932 | /* Get corresponding menu: */
|
---|
3933 | UIMenu *pMenu = action(UIActionIndexRT_M_View_M_MenuBar)->menu();
|
---|
3934 | AssertPtrReturnVoid(pMenu);
|
---|
3935 | /* Clear contents: */
|
---|
3936 | pMenu->clear();
|
---|
3937 |
|
---|
3938 | /* 'Menu Bar Settings' action: */
|
---|
3939 | addAction(pMenu, action(UIActionIndexRT_M_View_M_MenuBar_S_Settings));
|
---|
3940 | #ifndef VBOX_WS_MAC
|
---|
3941 | /* 'Toggle Menu Bar' action: */
|
---|
3942 | addAction(pMenu, action(UIActionIndexRT_M_View_M_MenuBar_T_Visibility));
|
---|
3943 | #endif
|
---|
3944 |
|
---|
3945 | /* Mark menu as valid: */
|
---|
3946 | m_invalidations.remove(UIActionIndexRT_M_View_M_MenuBar);
|
---|
3947 | }
|
---|
3948 |
|
---|
3949 | void UIActionPoolRuntime::updateMenuViewStatusBar()
|
---|
3950 | {
|
---|
3951 | /* Get corresponding menu: */
|
---|
3952 | UIMenu *pMenu = action(UIActionIndexRT_M_View_M_StatusBar)->menu();
|
---|
3953 | AssertPtrReturnVoid(pMenu);
|
---|
3954 | /* Clear contents: */
|
---|
3955 | pMenu->clear();
|
---|
3956 |
|
---|
3957 | /* 'Status Bar Settings' action: */
|
---|
3958 | addAction(pMenu, action(UIActionIndexRT_M_View_M_StatusBar_S_Settings));
|
---|
3959 | /* 'Toggle Status Bar' action: */
|
---|
3960 | addAction(pMenu, action(UIActionIndexRT_M_View_M_StatusBar_T_Visibility));
|
---|
3961 |
|
---|
3962 | /* Mark menu as valid: */
|
---|
3963 | m_invalidations.remove(UIActionIndexRT_M_View_M_StatusBar);
|
---|
3964 | }
|
---|
3965 |
|
---|
3966 | void UIActionPoolRuntime::updateMenuViewResize(QMenu *pMenu)
|
---|
3967 | {
|
---|
3968 | AssertPtrReturnVoid(pMenu);
|
---|
3969 |
|
---|
3970 | /* Prepare content: */
|
---|
3971 | const QList<QSize> sizes = QList<QSize>()
|
---|
3972 | << QSize(640, 480)
|
---|
3973 | << QSize(800, 600)
|
---|
3974 | << QSize(1024, 768)
|
---|
3975 | << QSize(1152, 864)
|
---|
3976 | << QSize(1280, 720)
|
---|
3977 | << QSize(1280, 800)
|
---|
3978 | << QSize(1366, 768)
|
---|
3979 | << QSize(1440, 900)
|
---|
3980 | << QSize(1600, 900)
|
---|
3981 | << QSize(1680, 1050)
|
---|
3982 | << QSize(1920, 1080)
|
---|
3983 | << QSize(1920, 1200);
|
---|
3984 |
|
---|
3985 | /* Get corresponding screen index and frame-buffer size: */
|
---|
3986 | const int iGuestScreenIndex = pMenu->property("Guest Screen Index").toInt();
|
---|
3987 | const QSize screenSize = m_mapGuestScreenSize.value(iGuestScreenIndex);
|
---|
3988 | const bool fScreenEnabled = m_mapGuestScreenIsVisible.value(iGuestScreenIndex);
|
---|
3989 |
|
---|
3990 | /* For non-primary screens: */
|
---|
3991 | if (iGuestScreenIndex > 0)
|
---|
3992 | {
|
---|
3993 | /* Create 'toggle' action: */
|
---|
3994 | QAction *pToggleAction = pMenu->addAction(QApplication::translate("UIActionPool", "Enable", "Virtual Screen"),
|
---|
3995 | this, SLOT(sltHandleActionTriggerViewScreenToggle()));
|
---|
3996 | if (pToggleAction)
|
---|
3997 | {
|
---|
3998 | /* Configure 'toggle' action: */
|
---|
3999 | pToggleAction->setEnabled(m_fGuestSupportsGraphics);
|
---|
4000 | pToggleAction->setProperty("Guest Screen Index", iGuestScreenIndex);
|
---|
4001 | pToggleAction->setCheckable(true);
|
---|
4002 | pToggleAction->setChecked(fScreenEnabled);
|
---|
4003 | /* Add separator: */
|
---|
4004 | pMenu->addSeparator();
|
---|
4005 | }
|
---|
4006 | }
|
---|
4007 |
|
---|
4008 | /* Create exclusive 'resize' action-group: */
|
---|
4009 | QActionGroup *pActionGroup = new QActionGroup(pMenu);
|
---|
4010 | if (pActionGroup)
|
---|
4011 | {
|
---|
4012 | /* Configure exclusive 'resize' action-group: */
|
---|
4013 | pActionGroup->setExclusive(true);
|
---|
4014 |
|
---|
4015 | /* For every available size: */
|
---|
4016 | foreach (const QSize &size, sizes)
|
---|
4017 | {
|
---|
4018 | /* Create exclusive 'resize' action: */
|
---|
4019 | QAction *pAction = pActionGroup->addAction(QApplication::translate("UIActionPool", "Resize to %1x%2", "Virtual Screen")
|
---|
4020 | .arg(size.width()).arg(size.height()));
|
---|
4021 | if (pAction)
|
---|
4022 | {
|
---|
4023 | /* Configure exclusive 'resize' action: */
|
---|
4024 | pAction->setEnabled(m_fGuestSupportsGraphics && fScreenEnabled);
|
---|
4025 | pAction->setProperty("Guest Screen Index", iGuestScreenIndex);
|
---|
4026 | pAction->setProperty("Requested Size", size);
|
---|
4027 | pAction->setCheckable(true);
|
---|
4028 | if ( screenSize.width() == size.width()
|
---|
4029 | && screenSize.height() == size.height())
|
---|
4030 | pAction->setChecked(true);
|
---|
4031 | }
|
---|
4032 | }
|
---|
4033 |
|
---|
4034 | /* Insert group actions into menu: */
|
---|
4035 | pMenu->addActions(pActionGroup->actions());
|
---|
4036 | /* Install listener for exclusive action-group: */
|
---|
4037 | connect(pActionGroup, &QActionGroup::triggered,
|
---|
4038 | this, &UIActionPoolRuntime::sltHandleActionTriggerViewScreenResize);
|
---|
4039 | }
|
---|
4040 | }
|
---|
4041 |
|
---|
4042 | void UIActionPoolRuntime::updateMenuViewRemap(QMenu *pMenu)
|
---|
4043 | {
|
---|
4044 | AssertPtrReturnVoid(pMenu);
|
---|
4045 |
|
---|
4046 | /* Get corresponding screen index: */
|
---|
4047 | const int iGuestScreenIndex = pMenu->property("Guest Screen Index").toInt();
|
---|
4048 | const bool fScreenEnabled = m_mapGuestScreenIsVisible.value(iGuestScreenIndex);
|
---|
4049 |
|
---|
4050 | /* For non-primary screens: */
|
---|
4051 | if (iGuestScreenIndex > 0)
|
---|
4052 | {
|
---|
4053 | /* Create 'toggle' action: */
|
---|
4054 | QAction *pToggleAction = pMenu->addAction(QApplication::translate("UIActionPool", "Enable", "Virtual Screen"),
|
---|
4055 | this, SLOT(sltHandleActionTriggerViewScreenToggle()));
|
---|
4056 | if (pToggleAction)
|
---|
4057 | {
|
---|
4058 | /* Configure 'toggle' action: */
|
---|
4059 | pToggleAction->setEnabled(m_fGuestSupportsGraphics);
|
---|
4060 | pToggleAction->setProperty("Guest Screen Index", iGuestScreenIndex);
|
---|
4061 | pToggleAction->setCheckable(true);
|
---|
4062 | pToggleAction->setChecked(fScreenEnabled);
|
---|
4063 | /* Add separator: */
|
---|
4064 | pMenu->addSeparator();
|
---|
4065 | }
|
---|
4066 | }
|
---|
4067 |
|
---|
4068 | /* Create exclusive 'remap' action-group: */
|
---|
4069 | QActionGroup *pActionGroup = new QActionGroup(pMenu);
|
---|
4070 | if (pActionGroup)
|
---|
4071 | {
|
---|
4072 | /* Configure exclusive 'remap' action-group: */
|
---|
4073 | pActionGroup->setExclusive(true);
|
---|
4074 |
|
---|
4075 | /* For every host-screen index: */
|
---|
4076 | for (int iHostScreenIndex = 0; iHostScreenIndex < m_cHostScreens; ++iHostScreenIndex)
|
---|
4077 | {
|
---|
4078 | /* Create exclusive 'remap' action: */
|
---|
4079 | QAction *pAction = pActionGroup->addAction(QApplication::translate("UIActionPool", "Use Host Screen %1")
|
---|
4080 | .arg(iHostScreenIndex + 1));
|
---|
4081 | if (pAction)
|
---|
4082 | {
|
---|
4083 | /* Configure exclusive 'remap' action: */
|
---|
4084 | pAction->setEnabled(m_fGuestSupportsGraphics && fScreenEnabled);
|
---|
4085 | pAction->setProperty("Guest Screen Index", iGuestScreenIndex);
|
---|
4086 | pAction->setProperty("Host Screen Index", iHostScreenIndex);
|
---|
4087 | pAction->setCheckable(true);
|
---|
4088 | if ( m_mapHostScreenForGuestScreen.contains(iGuestScreenIndex)
|
---|
4089 | && m_mapHostScreenForGuestScreen.value(iGuestScreenIndex) == iHostScreenIndex)
|
---|
4090 | pAction->setChecked(true);
|
---|
4091 | }
|
---|
4092 | }
|
---|
4093 |
|
---|
4094 | /* Insert group actions into menu: */
|
---|
4095 | pMenu->addActions(pActionGroup->actions());
|
---|
4096 | /* Install listener for exclusive action-group: */
|
---|
4097 | connect(pActionGroup, &QActionGroup::triggered,
|
---|
4098 | this, &UIActionPoolRuntime::sltHandleActionTriggerViewScreenRemap);
|
---|
4099 | }
|
---|
4100 | }
|
---|
4101 |
|
---|
4102 | void UIActionPoolRuntime::updateMenuViewRescale(QMenu *pMenu)
|
---|
4103 | {
|
---|
4104 | AssertPtrReturnVoid(pMenu);
|
---|
4105 |
|
---|
4106 | /* Get corresponding screen index and scale-factor: */
|
---|
4107 | const int iGuestScreenIndex = pMenu->property("Guest Screen Index").toInt();
|
---|
4108 | const double dCurrentScaleFactor = gEDataManager->scaleFactor(uiCommon().managedVMUuid(), iGuestScreenIndex);
|
---|
4109 |
|
---|
4110 | /* Create exclusive 'rescale' action-group: */
|
---|
4111 | QActionGroup *pActionGroup = new QActionGroup(pMenu);
|
---|
4112 | if (pActionGroup)
|
---|
4113 | {
|
---|
4114 | /* Configure exclusive 'rescale' action-group: */
|
---|
4115 | pActionGroup->setExclusive(true);
|
---|
4116 |
|
---|
4117 | /* Get device-pixel-ratio: */
|
---|
4118 | bool fDevicePixelRatioMentioned = false;
|
---|
4119 | const double dDevicePixelRatioActual = qMin(UIDesktopWidgetWatchdog::devicePixelRatioActual(m_mapHostScreenForGuestScreen.value(iGuestScreenIndex)),
|
---|
4120 | 10.0 /* meh, who knows? */);
|
---|
4121 |
|
---|
4122 | /* Calculate minimum, maximum and step: */
|
---|
4123 | const double dMinimum = 1.0;
|
---|
4124 | const double dMaximum = ceil(dMinimum + dDevicePixelRatioActual);
|
---|
4125 | const double dStep = 0.25;
|
---|
4126 |
|
---|
4127 | /* Now, iterate possible scale-factors: */
|
---|
4128 | double dScaleFactor = dMinimum;
|
---|
4129 | do
|
---|
4130 | {
|
---|
4131 | /* Create exclusive 'rescale' action: */
|
---|
4132 | QAction *pAction = pActionGroup->addAction(QString());
|
---|
4133 | if (pAction)
|
---|
4134 | {
|
---|
4135 | pAction->setProperty("Guest Screen Index", iGuestScreenIndex);
|
---|
4136 | /* For the 'unscaled' action: */
|
---|
4137 | if (dScaleFactor == 1.0)
|
---|
4138 | {
|
---|
4139 | pAction->setProperty("Requested Scale Factor", dScaleFactor);
|
---|
4140 | if (dDevicePixelRatioActual == 1.0)
|
---|
4141 | pAction->setText(QApplication::translate("UIActionPool", "Scale to %1%", "scale-factor")
|
---|
4142 | .arg(dScaleFactor * 100));
|
---|
4143 | else
|
---|
4144 | pAction->setText(QApplication::translate("UIActionPool", "Scale to %1% (unscaled output)", "scale-factor")
|
---|
4145 | .arg(dScaleFactor * 100));
|
---|
4146 | }
|
---|
4147 | /* For the 'autoscaled' action: */
|
---|
4148 | else if ( (dScaleFactor >= dDevicePixelRatioActual)
|
---|
4149 | && (dDevicePixelRatioActual != 1.0)
|
---|
4150 | && !fDevicePixelRatioMentioned)
|
---|
4151 | {
|
---|
4152 | pAction->setProperty("Requested Scale Factor", dDevicePixelRatioActual);
|
---|
4153 | pAction->setText(QApplication::translate("UIActionPool", "Scale to %1% (autoscaled output)", "scale-factor")
|
---|
4154 | .arg(dDevicePixelRatioActual * 100));
|
---|
4155 | fDevicePixelRatioMentioned = true;
|
---|
4156 | }
|
---|
4157 | /* For other actions: */
|
---|
4158 | else
|
---|
4159 | {
|
---|
4160 | pAction->setProperty("Requested Scale Factor", dScaleFactor);
|
---|
4161 | pAction->setText(QApplication::translate("UIActionPool", "Scale to %1%", "scale-factor")
|
---|
4162 | .arg(dScaleFactor * 100));
|
---|
4163 | }
|
---|
4164 |
|
---|
4165 | /* Configure exclusive 'scale-factor' action: */
|
---|
4166 | pAction->setCheckable(true);
|
---|
4167 | if (dScaleFactor == dCurrentScaleFactor)
|
---|
4168 | pAction->setChecked(true);
|
---|
4169 | }
|
---|
4170 |
|
---|
4171 | /* Increment scale-factor: */
|
---|
4172 | dScaleFactor += dStep;
|
---|
4173 | }
|
---|
4174 | while (dScaleFactor <= dMaximum);
|
---|
4175 |
|
---|
4176 | /* Insert group actions into menu: */
|
---|
4177 | pMenu->addActions(pActionGroup->actions());
|
---|
4178 | /* Install listener for exclusive action-group: */
|
---|
4179 | connect(pActionGroup, &QActionGroup::triggered,
|
---|
4180 | this, &UIActionPoolRuntime::sltHandleActionTriggerViewScreenRescale);
|
---|
4181 | }
|
---|
4182 | }
|
---|
4183 |
|
---|
4184 | void UIActionPoolRuntime::updateMenuInput()
|
---|
4185 | {
|
---|
4186 | /* Get corresponding menu: */
|
---|
4187 | UIMenu *pMenu = action(UIActionIndexRT_M_Input)->menu();
|
---|
4188 | AssertPtrReturnVoid(pMenu);
|
---|
4189 | /* Clear contents: */
|
---|
4190 | pMenu->clear();
|
---|
4191 |
|
---|
4192 | /* Separator: */
|
---|
4193 | bool fSeparator = false;
|
---|
4194 |
|
---|
4195 | /* 'Keyboard' submenu: */
|
---|
4196 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Input_M_Keyboard)) || fSeparator;
|
---|
4197 | updateMenuInputKeyboard();
|
---|
4198 | /* 'Mouse' submenu: */
|
---|
4199 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Input_M_Mouse), false) || fSeparator;
|
---|
4200 | updateMenuInputMouse();
|
---|
4201 |
|
---|
4202 | /* Separator: */
|
---|
4203 | if (fSeparator)
|
---|
4204 | {
|
---|
4205 | pMenu->addSeparator();
|
---|
4206 | fSeparator = false;
|
---|
4207 | }
|
---|
4208 |
|
---|
4209 | /* 'Mouse Integration' action: */
|
---|
4210 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Input_M_Mouse_T_Integration)) || fSeparator;
|
---|
4211 |
|
---|
4212 | /* Mark menu as valid: */
|
---|
4213 | m_invalidations.remove(UIActionIndexRT_M_Input);
|
---|
4214 | }
|
---|
4215 |
|
---|
4216 | void UIActionPoolRuntime::updateMenuInputKeyboard()
|
---|
4217 | {
|
---|
4218 | /* Get corresponding menu: */
|
---|
4219 | UIMenu *pMenu = action(UIActionIndexRT_M_Input_M_Keyboard)->menu();
|
---|
4220 | AssertPtrReturnVoid(pMenu);
|
---|
4221 | /* Clear contents: */
|
---|
4222 | pMenu->clear();
|
---|
4223 |
|
---|
4224 | /* Separator: */
|
---|
4225 | bool fSeparator = false;
|
---|
4226 |
|
---|
4227 | /* 'Keyboard Settings' action: */
|
---|
4228 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Input_M_Keyboard_S_Settings)) || fSeparator;
|
---|
4229 | /* 'Soft Keyboard' action: */
|
---|
4230 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Input_M_Keyboard_S_SoftKeyboard)) || fSeparator;
|
---|
4231 | /* Separator: */
|
---|
4232 | if (fSeparator)
|
---|
4233 | {
|
---|
4234 | pMenu->addSeparator();
|
---|
4235 | fSeparator = false;
|
---|
4236 | }
|
---|
4237 |
|
---|
4238 | /* 'Type CAD' action: */
|
---|
4239 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Input_M_Keyboard_S_TypeCAD)) || fSeparator;
|
---|
4240 | #ifdef VBOX_WS_NIX
|
---|
4241 | /* 'Type CABS' action: */
|
---|
4242 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Input_M_Keyboard_S_TypeCABS)) || fSeparator;
|
---|
4243 | #endif
|
---|
4244 | /* 'Type Ctrl-Break' action: */
|
---|
4245 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Input_M_Keyboard_S_TypeCtrlBreak)) || fSeparator;
|
---|
4246 | /* 'Type Insert' action: */
|
---|
4247 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Input_M_Keyboard_S_TypeInsert)) || fSeparator;
|
---|
4248 | /* 'Type Print Screen' action: */
|
---|
4249 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Input_M_Keyboard_S_TypePrintScreen)) || fSeparator;
|
---|
4250 | /* 'Type Alt Print Screen' action: */
|
---|
4251 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Input_M_Keyboard_S_TypeAltPrintScreen)) || fSeparator;
|
---|
4252 | /* 'Type Host Key Combo' action: */
|
---|
4253 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Input_M_Keyboard_T_TypeHostKeyCombo)) || fSeparator;
|
---|
4254 |
|
---|
4255 | /* Mark menu as valid: */
|
---|
4256 | m_invalidations.remove(UIActionIndexRT_M_Input_M_Keyboard);
|
---|
4257 | }
|
---|
4258 |
|
---|
4259 | void UIActionPoolRuntime::updateMenuInputMouse()
|
---|
4260 | {
|
---|
4261 | /* Get corresponding menu: */
|
---|
4262 | UIMenu *pMenu = action(UIActionIndexRT_M_Input_M_Mouse)->menu();
|
---|
4263 | AssertPtrReturnVoid(pMenu);
|
---|
4264 | /* Clear contents: */
|
---|
4265 | pMenu->clear();
|
---|
4266 |
|
---|
4267 | /* 'Machine Integration' action: */
|
---|
4268 | addAction(pMenu, action(UIActionIndexRT_M_Input_M_Mouse_T_Integration));
|
---|
4269 |
|
---|
4270 | /* Mark menu as valid: */
|
---|
4271 | m_invalidations.remove(UIActionIndexRT_M_Input_M_Mouse);
|
---|
4272 | }
|
---|
4273 |
|
---|
4274 | void UIActionPoolRuntime::updateMenuDevices()
|
---|
4275 | {
|
---|
4276 | /* Get corresponding menu: */
|
---|
4277 | UIMenu *pMenu = action(UIActionIndexRT_M_Devices)->menu();
|
---|
4278 | AssertPtrReturnVoid(pMenu);
|
---|
4279 | /* Clear contents: */
|
---|
4280 | pMenu->clear();
|
---|
4281 |
|
---|
4282 | /* Separator: */
|
---|
4283 | bool fSeparator = false;
|
---|
4284 |
|
---|
4285 | /* 'Hard Drives' submenu: */
|
---|
4286 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_M_HardDrives)) || fSeparator;
|
---|
4287 | updateMenuDevicesHardDrives();
|
---|
4288 | /* 'Optical Devices' submenu: */
|
---|
4289 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_M_OpticalDevices)) || fSeparator;
|
---|
4290 | /* 'Floppy Devices' submenu: */
|
---|
4291 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_M_FloppyDevices)) || fSeparator;
|
---|
4292 | /* 'Audio' submenu: */
|
---|
4293 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_M_Audio)) || fSeparator;
|
---|
4294 | updateMenuDevicesAudio();
|
---|
4295 | /* 'Network' submenu: */
|
---|
4296 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_M_Network)) || fSeparator;
|
---|
4297 | updateMenuDevicesNetwork();
|
---|
4298 | /* 'USB Devices' submenu: */
|
---|
4299 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_M_USBDevices)) || fSeparator;
|
---|
4300 | updateMenuDevicesUSBDevices();
|
---|
4301 | /* 'Web Cams' submenu: */
|
---|
4302 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_M_WebCams)) || fSeparator;
|
---|
4303 |
|
---|
4304 | /* Separator: */
|
---|
4305 | if (fSeparator)
|
---|
4306 | {
|
---|
4307 | pMenu->addSeparator();
|
---|
4308 | fSeparator = false;
|
---|
4309 | }
|
---|
4310 |
|
---|
4311 | /* 'Shared Folders' submenu: */
|
---|
4312 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_M_SharedFolders)) || fSeparator;
|
---|
4313 | updateMenuDevicesSharedFolders();
|
---|
4314 | /* 'Shared Clipboard' submenu: */
|
---|
4315 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_M_SharedClipboard)) || fSeparator;
|
---|
4316 | /* 'Drag&Drop' submenu: */
|
---|
4317 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_M_DragAndDrop)) || fSeparator;
|
---|
4318 |
|
---|
4319 | /* Separator: */
|
---|
4320 | if (fSeparator)
|
---|
4321 | {
|
---|
4322 | pMenu->addSeparator();
|
---|
4323 | fSeparator = false;
|
---|
4324 | }
|
---|
4325 |
|
---|
4326 | /* Insert Guest Additions Disk action: */
|
---|
4327 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_S_InsertGuestAdditionsDisk)) || fSeparator;
|
---|
4328 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_S_UpgradeGuestAdditions)) || fSeparator;
|
---|
4329 |
|
---|
4330 | /* Mark menu as valid: */
|
---|
4331 | m_invalidations.remove(UIActionIndexRT_M_Devices);
|
---|
4332 | }
|
---|
4333 |
|
---|
4334 | void UIActionPoolRuntime::updateMenuDevicesHardDrives()
|
---|
4335 | {
|
---|
4336 | /* Get corresponding menu: */
|
---|
4337 | UIMenu *pMenu = action(UIActionIndexRT_M_Devices_M_HardDrives)->menu();
|
---|
4338 | AssertPtrReturnVoid(pMenu);
|
---|
4339 | /* Clear contents: */
|
---|
4340 | pMenu->clear();
|
---|
4341 |
|
---|
4342 | /* 'Hard Drives Settings' action: */
|
---|
4343 | addAction(pMenu, action(UIActionIndexRT_M_Devices_M_HardDrives_S_Settings));
|
---|
4344 |
|
---|
4345 | /* Mark menu as valid: */
|
---|
4346 | m_invalidations.remove(UIActionIndexRT_M_Devices_M_HardDrives);
|
---|
4347 | }
|
---|
4348 |
|
---|
4349 | void UIActionPoolRuntime::updateMenuDevicesAudio()
|
---|
4350 | {
|
---|
4351 | /* Get corresponding menu: */
|
---|
4352 | UIMenu *pMenu = action(UIActionIndexRT_M_Devices_M_Audio)->menu();
|
---|
4353 | AssertPtrReturnVoid(pMenu);
|
---|
4354 | /* Clear contents: */
|
---|
4355 | pMenu->clear();
|
---|
4356 |
|
---|
4357 | /* 'Output' action: */
|
---|
4358 | addAction(pMenu, action(UIActionIndexRT_M_Devices_M_Audio_T_Output));
|
---|
4359 | /* 'Input' action: */
|
---|
4360 | addAction(pMenu, action(UIActionIndexRT_M_Devices_M_Audio_T_Input));
|
---|
4361 |
|
---|
4362 | /* Mark menu as valid: */
|
---|
4363 | m_invalidations.remove(UIActionIndexRT_M_Devices_M_Audio);
|
---|
4364 | }
|
---|
4365 |
|
---|
4366 | void UIActionPoolRuntime::updateMenuDevicesNetwork()
|
---|
4367 | {
|
---|
4368 | /* Get corresponding menu: */
|
---|
4369 | UIMenu *pMenu = action(UIActionIndexRT_M_Devices_M_Network)->menu();
|
---|
4370 | AssertPtrReturnVoid(pMenu);
|
---|
4371 | /* Clear contents: */
|
---|
4372 | pMenu->clear();
|
---|
4373 |
|
---|
4374 | /* Separator: */
|
---|
4375 | bool fSeparator = false;
|
---|
4376 |
|
---|
4377 | /* 'Network Settings' action: */
|
---|
4378 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_M_Network_S_Settings)) || fSeparator;
|
---|
4379 |
|
---|
4380 | /* Separator: */
|
---|
4381 | if (fSeparator)
|
---|
4382 | {
|
---|
4383 | pMenu->addSeparator();
|
---|
4384 | fSeparator = false;
|
---|
4385 | }
|
---|
4386 |
|
---|
4387 | /* This menu always remains invalid.. */
|
---|
4388 | }
|
---|
4389 |
|
---|
4390 | void UIActionPoolRuntime::updateMenuDevicesUSBDevices()
|
---|
4391 | {
|
---|
4392 | /* Get corresponding menu: */
|
---|
4393 | UIMenu *pMenu = action(UIActionIndexRT_M_Devices_M_USBDevices)->menu();
|
---|
4394 | AssertPtrReturnVoid(pMenu);
|
---|
4395 | /* Clear contents: */
|
---|
4396 | pMenu->clear();
|
---|
4397 |
|
---|
4398 | /* Separator: */
|
---|
4399 | bool fSeparator = false;
|
---|
4400 |
|
---|
4401 | /* 'USB Devices Settings' action: */
|
---|
4402 | fSeparator = addAction(pMenu, action(UIActionIndexRT_M_Devices_M_USBDevices_S_Settings)) || fSeparator;
|
---|
4403 |
|
---|
4404 | /* Separator: */
|
---|
4405 | if (fSeparator)
|
---|
4406 | {
|
---|
4407 | pMenu->addSeparator();
|
---|
4408 | fSeparator = false;
|
---|
4409 | }
|
---|
4410 |
|
---|
4411 | /* This menu always remains invalid.. */
|
---|
4412 | }
|
---|
4413 |
|
---|
4414 | void UIActionPoolRuntime::updateMenuDevicesSharedFolders()
|
---|
4415 | {
|
---|
4416 | /* Get corresponding menu: */
|
---|
4417 | UIMenu *pMenu = action(UIActionIndexRT_M_Devices_M_SharedFolders)->menu();
|
---|
4418 | AssertPtrReturnVoid(pMenu);
|
---|
4419 | /* Clear contents: */
|
---|
4420 | pMenu->clear();
|
---|
4421 |
|
---|
4422 | /* 'Shared Folders Settings' action: */
|
---|
4423 | addAction(pMenu, action(UIActionIndexRT_M_Devices_M_SharedFolders_S_Settings));
|
---|
4424 |
|
---|
4425 | /* Mark menu as valid: */
|
---|
4426 | m_invalidations.remove(UIActionIndexRT_M_Devices_M_SharedFolders);
|
---|
4427 | }
|
---|
4428 |
|
---|
4429 | #ifdef VBOX_WITH_DEBUGGER_GUI
|
---|
4430 | void UIActionPoolRuntime::updateMenuDebug()
|
---|
4431 | {
|
---|
4432 | /* Get corresponding menu: */
|
---|
4433 | UIMenu *pMenu = action(UIActionIndexRT_M_Debug)->menu();
|
---|
4434 | AssertPtrReturnVoid(pMenu);
|
---|
4435 | /* Clear contents: */
|
---|
4436 | pMenu->clear();
|
---|
4437 |
|
---|
4438 | /* 'Statistics' action: */
|
---|
4439 | addAction(pMenu, action(UIActionIndexRT_M_Debug_S_ShowStatistics));
|
---|
4440 | /* 'Command Line' action: */
|
---|
4441 | addAction(pMenu, action(UIActionIndexRT_M_Debug_S_ShowCommandLine));
|
---|
4442 | /* 'Logging' action: */
|
---|
4443 | addAction(pMenu, action(UIActionIndexRT_M_Debug_T_Logging));
|
---|
4444 | /* 'Guest Control Terminal' action: */
|
---|
4445 | addAction(pMenu, action(UIActionIndexRT_M_Debug_S_GuestControlConsole));
|
---|
4446 |
|
---|
4447 | /* Mark menu as valid: */
|
---|
4448 | m_invalidations.remove(UIActionIndexRT_M_Debug);
|
---|
4449 | }
|
---|
4450 | #endif /* VBOX_WITH_DEBUGGER_GUI */
|
---|
4451 |
|
---|
4452 |
|
---|
4453 | #include "UIActionPoolRuntime.moc"
|
---|