VirtualBox

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

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

FE/Qt: bugref:10513: VBox Manager: Hide Clone/Move actions for Basic experience mode; That is especially important for Clone actions, cause they presented in Machine and Snapshot menus.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 172.5 KB
Line 
1/* $Id: UIActionPoolManager.cpp 102268 2023-11-22 18:35:28Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIActionPoolManager 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
31/* GUI includes: */
32#include "UICommon.h"
33#include "UIActionPoolManager.h"
34#include "UIExtraDataManager.h"
35#include "UIIconPool.h"
36#include "UIShortcutPool.h"
37#include "UIDefs.h"
38
39/* COM includes: */
40#include "CExtPack.h"
41#include "CExtPackManager.h"
42
43/* TEMPORARY! */
44#if defined(_MSC_VER) && !defined(RT_ARCH_AMD64)
45# pragma optimize("g", off)
46#endif
47
48/* Namespaces: */
49using namespace UIExtraDataDefs;
50
51
52/** Menu action extension, used as 'File' menu class. */
53class UIActionMenuManagerFile : public UIActionMenu
54{
55 Q_OBJECT;
56
57public:
58
59 /** Constructs action passing @a pParent to the base-class. */
60 UIActionMenuManagerFile(UIActionPool *pParent)
61 : UIActionMenu(pParent)
62 {}
63
64protected:
65
66 /** Handles translation event. */
67 virtual void retranslateUi() RT_OVERRIDE
68 {
69#ifdef VBOX_WS_MAC
70 setName(QApplication::translate("UIActionPool", "&File", "Mac OS X version"));
71#else /* VBOX_WS_MAC */
72 setName(QApplication::translate("UIActionPool", "&File", "Non Mac OS X version"));
73#endif /* !VBOX_WS_MAC */
74 }
75};
76
77/** Simple action extension, used as 'Show Import Appliance Wizard' action class. */
78class UIActionSimpleManagerFileShowImportApplianceWizard : public UIActionSimple
79{
80 Q_OBJECT;
81
82public:
83
84 /** Constructs action passing @a pParent to the base-class. */
85 UIActionSimpleManagerFileShowImportApplianceWizard(UIActionPool *pParent)
86 : UIActionSimple(pParent,
87 ":/import_32px.png", ":/import_16px.png",
88 ":/import_disabled_32px.png", ":/import_disabled_16px.png")
89 {}
90
91protected:
92
93 /** Returns shortcut extra-data ID. */
94 virtual QString shortcutExtraDataID() const RT_OVERRIDE
95 {
96 return QString("ImportAppliance");
97 }
98
99 /** Returns default shortcut. */
100 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
101 {
102 return QKeySequence("Ctrl+I");
103 }
104
105 /** Handles translation event. */
106 virtual void retranslateUi() RT_OVERRIDE
107 {
108 setIconText(QApplication::translate("UIActionPool", "Import"));
109 setName(QApplication::translate("UIActionPool", "&Import Appliance..."));
110 setStatusTip(QApplication::translate("UIActionPool", "Import an appliance into VirtualBox"));
111 setToolTip(simplifyText(text()) + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
112 }
113};
114
115/** Simple action extension, used as 'Show Export Appliance Wizard' action class. */
116class UIActionSimpleManagerFileShowExportApplianceWizard : public UIActionSimple
117{
118 Q_OBJECT;
119
120public:
121
122 /** Constructs action passing @a pParent to the base-class. */
123 UIActionSimpleManagerFileShowExportApplianceWizard(UIActionPool *pParent)
124 : UIActionSimple(pParent,
125 ":/export_32px.png", ":/export_16px.png",
126 ":/export_disabled_32px.png", ":/export_disabled_16px.png")
127 {}
128
129protected:
130
131 /** Returns shortcut extra-data ID. */
132 virtual QString shortcutExtraDataID() const RT_OVERRIDE
133 {
134 return QString("ExportAppliance");
135 }
136
137 /** Returns default shortcut. */
138 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
139 {
140 return QKeySequence("Ctrl+E");
141 }
142
143 /** Handles translation event. */
144 virtual void retranslateUi() RT_OVERRIDE
145 {
146 setIconText(QApplication::translate("UIActionPool", "Export"));
147 setName(QApplication::translate("UIActionPool", "&Export Appliance..."));
148 setStatusTip(QApplication::translate("UIActionPool", "Export one or more VirtualBox virtual machines as an appliance"));
149 setToolTip(simplifyText(text()) + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
150 }
151};
152
153/** Menu action extension, used as 'Global Tools' menu class. */
154class UIActionMenuManagerToolsGlobal : public UIActionMenu
155{
156 Q_OBJECT;
157
158public:
159
160 /** Constructs action passing @a pParent to the base-class. */
161 UIActionMenuManagerToolsGlobal(UIActionPool *pParent)
162 : UIActionMenu(pParent, ":/tools_menu_24px.png") /// @todo replace with 16px icon
163 {}
164
165protected:
166
167 /** Returns shortcut extra-data ID. */
168 virtual QString shortcutExtraDataID() const RT_OVERRIDE
169 {
170 return QString("ToolsGlobalMenu");
171 }
172
173 /** Handles translation event. */
174 virtual void retranslateUi() RT_OVERRIDE
175 {
176 setName(QApplication::translate("UIActionPool", "Tools"));
177 }
178};
179
180/** Simple action extension, used as 'Show Welcome Screen' action class. */
181class UIActionToggleManagerToolsGlobalShowWelcomeScreen : public UIActionToggle
182{
183 Q_OBJECT;
184
185public:
186
187 /** Constructs action passing @a pParent to the base-class. */
188 UIActionToggleManagerToolsGlobalShowWelcomeScreen(UIActionPool *pParent)
189 : UIActionToggle(pParent)
190 {
191 setProperty("UIToolType", QVariant::fromValue(UIToolType_Welcome));
192 /// @todo use icons with check-boxes
193 setIcon(UIIconPool::iconSetFull(":/welcome_screen_24px.png", ":/welcome_screen_24px.png",
194 ":/welcome_screen_24px.png", ":/welcome_screen_24px.png"));
195 }
196
197protected:
198
199 /** Returns shortcut extra-data ID. */
200 virtual QString shortcutExtraDataID() const RT_OVERRIDE
201 {
202 return QString("WelcomeScreen");
203 }
204
205 /** Handles translation event. */
206 virtual void retranslateUi() RT_OVERRIDE
207 {
208 setName(QApplication::translate("UIActionPool", "&Welcome Screen"));
209 setStatusTip(QApplication::translate("UIActionPool", "Open the Welcome Screen"));
210 }
211};
212
213/** Simple action extension, used as 'Show Extension Pack Manager' action class. */
214class UIActionToggleManagerToolsGlobalShowExtensionPackManager : public UIActionToggle
215{
216 Q_OBJECT;
217
218public:
219
220 /** Constructs action passing @a pParent to the base-class. */
221 UIActionToggleManagerToolsGlobalShowExtensionPackManager(UIActionPool *pParent)
222 : UIActionToggle(pParent)
223 {
224 setProperty("UIToolType", QVariant::fromValue(UIToolType_Extensions));
225 /// @todo use icons with check-boxes
226 setIcon(UIIconPool::iconSetFull(":/extension_pack_manager_24px.png", ":/extension_pack_manager_16px.png",
227 ":/extension_pack_manager_disabled_24px.png", ":/extension_pack_manager_disabled_16px.png"));
228 }
229
230protected:
231
232 /** Returns shortcut extra-data ID. */
233 virtual QString shortcutExtraDataID() const RT_OVERRIDE
234 {
235 return QString("ExtensionPackManager");
236 }
237
238 /** Returns default shortcut. */
239 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
240 {
241 return QKeySequence("Ctrl+T");
242 }
243
244 /** Handles translation event. */
245 virtual void retranslateUi() RT_OVERRIDE
246 {
247 setName(QApplication::translate("UIActionPool", "&Extension Pack Manager"));
248 setStatusTip(QApplication::translate("UIActionPool", "Open the Extension Pack Manager"));
249 }
250};
251
252/** Simple action extension, used as 'Show Virtual Media Manager' action class. */
253class UIActionToggleManagerToolsGlobalShowVirtualMediaManager : public UIActionToggle
254{
255 Q_OBJECT;
256
257public:
258
259 /** Constructs action passing @a pParent to the base-class. */
260 UIActionToggleManagerToolsGlobalShowVirtualMediaManager(UIActionPool *pParent)
261 : UIActionToggle(pParent)
262 {
263 setProperty("UIToolType", QVariant::fromValue(UIToolType_Media));
264 /// @todo use icons with check-boxes
265 setIcon(UIIconPool::iconSetFull(":/media_manager_24px.png", ":/media_manager_16px.png",
266 ":/media_manager_disabled_24px.png", ":/media_manager_disabled_16px.png"));
267 }
268
269protected:
270
271 /** Returns shortcut extra-data ID. */
272 virtual QString shortcutExtraDataID() const RT_OVERRIDE
273 {
274 return QString("VirtualMediaManager");
275 }
276
277 /** Returns default shortcut. */
278 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
279 {
280 return QKeySequence("Ctrl+D");
281 }
282
283 /** Handles translation event. */
284 virtual void retranslateUi() RT_OVERRIDE
285 {
286 setName(QApplication::translate("UIActionPool", "&Virtual Media Manager"));
287 setStatusTip(QApplication::translate("UIActionPool", "Open the Virtual Media Manager"));
288 }
289};
290
291/** Simple action extension, used as 'Show Network Manager' action class. */
292class UIActionToggleManagerToolsGlobalShowNetworkManager : public UIActionToggle
293{
294 Q_OBJECT;
295
296public:
297
298 /** Constructs action passing @a pParent to the base-class. */
299 UIActionToggleManagerToolsGlobalShowNetworkManager(UIActionPool *pParent)
300 : UIActionToggle(pParent)
301 {
302 setProperty("UIToolType", QVariant::fromValue(UIToolType_Network));
303 /// @todo use icons with check-boxes
304 setIcon(UIIconPool::iconSetFull(":/host_iface_manager_24px.png", ":/host_iface_manager_16px.png",
305 ":/host_iface_manager_disabled_24px.png", ":/host_iface_manager_disabled_16px.png"));
306 }
307
308protected:
309
310 /** Returns shortcut extra-data ID. */
311 virtual QString shortcutExtraDataID() const RT_OVERRIDE
312 {
313 return QString("HostNetworkManager");
314 }
315
316 /** Returns default shortcut. */
317 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
318 {
319 return QKeySequence("Ctrl+H");
320 }
321
322 /** Handles translation event. */
323 virtual void retranslateUi() RT_OVERRIDE
324 {
325 setName(QApplication::translate("UIActionPool", "&Network Manager"));
326 setStatusTip(QApplication::translate("UIActionPool", "Open the Network Manager"));
327 }
328};
329
330/** Simple action extension, used as 'Show Cloud Profile Manager' action class. */
331class UIActionToggleManagerToolsGlobalShowCloudProfileManager : public UIActionToggle
332{
333 Q_OBJECT;
334
335public:
336
337 /** Constructs action passing @a pParent to the base-class. */
338 UIActionToggleManagerToolsGlobalShowCloudProfileManager(UIActionPool *pParent)
339 : UIActionToggle(pParent)
340 {
341 setProperty("UIToolType", QVariant::fromValue(UIToolType_Cloud));
342 /// @todo use icons with check-boxes
343 setIcon(UIIconPool::iconSetFull(":/cloud_profile_manager_24px.png", ":/cloud_profile_manager_16px.png",
344 ":/cloud_profile_manager_disabled_24px.png", ":/cloud_profile_manager_disabled_16px.png"));
345 }
346
347protected:
348
349 /** Returns shortcut extra-data ID. */
350 virtual QString shortcutExtraDataID() const RT_OVERRIDE
351 {
352 return QString("CloudProfileManager");
353 }
354
355 /** Returns default shortcut. */
356 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
357 {
358 return QKeySequence("Ctrl+P");
359 }
360
361 /** Handles translation event. */
362 virtual void retranslateUi() RT_OVERRIDE
363 {
364 setName(QApplication::translate("UIActionPool", "&Cloud Profile Manager"));
365 setStatusTip(QApplication::translate("UIActionPool", "Open the Cloud Profile Manager"));
366 }
367};
368
369/** Simple action extension, used as 'Show VM Activity Overview' action class. */
370class UIActionToggleManagerToolsGlobalShowVMActivityOverview : public UIActionToggle
371{
372 Q_OBJECT;
373
374public:
375
376 /** Constructs action passing @a pParent to the base-class. */
377 UIActionToggleManagerToolsGlobalShowVMActivityOverview(UIActionPool *pParent)
378 : UIActionToggle(pParent)
379 {
380 setProperty("UIToolType", QVariant::fromValue(UIToolType_VMActivityOverview));
381 /// @todo use icons with check-boxes
382 setIcon(UIIconPool::iconSetFull(":/resources_monitor_24px.png", ":/resources_monitor_16px.png",
383 ":/resources_monitor_disabled_24px.png", ":/resources_monitor_disabled_16px.png"));
384 }
385
386protected:
387
388 /** Returns shortcut extra-data ID. */
389 virtual QString shortcutExtraDataID() const RT_OVERRIDE
390 {
391 return QString("ToolsGlobalVMActivityOverview");
392 }
393
394 /** Handles translation event. */
395 virtual void retranslateUi() RT_OVERRIDE
396 {
397 setName(QApplication::translate("UIActionPool", "&VM Activity Overview"));
398 setStatusTip(QApplication::translate("UIActionPool", "Open the VM Activity Overview"));
399 }
400};
401
402#ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
403/** Simple action extension, used as 'Show Extra-data Manager' action class. */
404class UIActionSimpleManagerFileShowExtraDataManager : public UIActionSimple
405{
406 Q_OBJECT;
407
408public:
409
410 /** Constructs action passing @a pParent to the base-class. */
411 UIActionSimpleManagerFileShowExtraDataManager(UIActionPool *pParent)
412 : UIActionSimple(pParent, ":/edata_manager_16px.png", ":/edata_manager_16px.png")
413 {}
414
415protected:
416
417 /** Returns shortcut extra-data ID. */
418 virtual QString shortcutExtraDataID() const RT_OVERRIDE
419 {
420 return QString("ExtraDataManager");
421 }
422
423 /** Returns default shortcut. */
424 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
425 {
426 return QKeySequence("Ctrl+X");
427 }
428
429 /** Handles translation event. */
430 virtual void retranslateUi() RT_OVERRIDE
431 {
432 setName(QApplication::translate("UIActionPool", "E&xtra Data Manager..."));
433 setStatusTip(QApplication::translate("UIActionPool", "Display the Extra Data Manager window"));
434 }
435};
436#endif /* VBOX_GUI_WITH_EXTRADATA_MANAGER_UI */
437
438/** Simple action extension, used as 'Perform Exit' action class. */
439class UIActionSimpleManagerFilePerformExit : public UIActionSimple
440{
441 Q_OBJECT;
442
443public:
444
445 /** Constructs action passing @a pParent to the base-class. */
446 UIActionSimpleManagerFilePerformExit(UIActionPool *pParent)
447 : UIActionSimple(pParent, ":/exit_16px.png", ":/exit_16px.png")
448 {
449 setMenuRole(QAction::QuitRole);
450 }
451
452protected:
453
454 /** Returns shortcut extra-data ID. */
455 virtual QString shortcutExtraDataID() const RT_OVERRIDE
456 {
457 return QString("Exit");
458 }
459
460 /** Returns default shortcut. */
461 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
462 {
463 return QKeySequence("Ctrl+Q");
464 }
465
466 /** Handles translation event. */
467 virtual void retranslateUi() RT_OVERRIDE
468 {
469 setName(QApplication::translate("UIActionPool", "&Quit"));
470 setStatusTip(QApplication::translate("UIActionPool", "Close application"));
471 }
472};
473
474
475/** Menu action extension, used as 'Group' menu class. */
476class UIActionMenuManagerGroup : public UIActionMenu
477{
478 Q_OBJECT;
479
480public:
481
482 /** Constructs action passing @a pParent to the base-class. */
483 UIActionMenuManagerGroup(UIActionPool *pParent)
484 : UIActionMenu(pParent)
485 {}
486
487protected:
488
489 /** Handles translation event. */
490 virtual void retranslateUi() RT_OVERRIDE
491 {
492 setName(QApplication::translate("UIActionPool", "&Group"));
493 }
494};
495
496/** Simple action extension, used as 'Perform Create Machine' action class. */
497class UIActionSimpleManagerGroupPerformCreateMachine : public UIActionSimple
498{
499 Q_OBJECT;
500
501public:
502
503 /** Constructs action passing @a pParent to the base-class. */
504 UIActionSimpleManagerGroupPerformCreateMachine(UIActionPool *pParent)
505 : UIActionSimple(pParent,
506 ":/vm_new_32px.png", ":/vm_new_16px.png",
507 ":/vm_new_disabled_32px.png", ":/vm_new_disabled_16px.png")
508 {}
509
510protected:
511
512 /** Returns shortcut extra-data ID. */
513 virtual QString shortcutExtraDataID() const RT_OVERRIDE
514 {
515 return QString("NewVM");
516 }
517
518 /** Returns default shortcut. */
519 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
520 {
521 return QKeySequence("Ctrl+N");
522 }
523
524 /** Handles translation event. */
525 virtual void retranslateUi() RT_OVERRIDE
526 {
527 /// @todo replace that one with separate "New" before 6.2
528 setIconText(QApplication::translate("UIActionPool", "&New...").remove('.'));
529 setName(QApplication::translate("UIActionPool", "&New Machine..."));
530 setStatusTip(QApplication::translate("UIActionPool", "Create new virtual machine"));
531 setToolTip(simplifyText(text()) + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
532 }
533};
534
535/** Simple action extension, used as 'Perform Add Machine' action class. */
536class UIActionSimpleManagerGroupPerformAddMachine : public UIActionSimple
537{
538 Q_OBJECT;
539
540public:
541
542 /** Constructs action passing @a pParent to the base-class. */
543 UIActionSimpleManagerGroupPerformAddMachine(UIActionPool *pParent)
544 : UIActionSimple(pParent,
545 ":/vm_add_32px.png", ":/vm_add_16px.png",
546 ":/vm_add_disabled_32px.png", ":/vm_add_disabled_16px.png")
547 {}
548
549protected:
550
551 /** Returns shortcut extra-data ID. */
552 virtual QString shortcutExtraDataID() const RT_OVERRIDE
553 {
554 return QString("AddVM");
555 }
556
557 /** Returns default shortcut. */
558 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
559 {
560 return QKeySequence("Ctrl+A");
561 }
562
563 /** Handles translation event. */
564 virtual void retranslateUi() RT_OVERRIDE
565 {
566 /// @todo replace that one with separate "Add" before 6.2
567 setIconText(QApplication::translate("UIActionPool", "&Add...").remove('.'));
568 setName(QApplication::translate("UIActionPool", "&Add Machine..."));
569 setStatusTip(QApplication::translate("UIActionPool", "Add existing virtual machine"));
570 setToolTip(simplifyText(text()) + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
571 }
572};
573
574/** Simple action extension, used as 'Perform Rename Group' action class. */
575class UIActionSimpleManagerGroupPerformRename : public UIActionSimple
576{
577 Q_OBJECT;
578
579public:
580
581 /** Constructs action passing @a pParent to the base-class. */
582 UIActionSimpleManagerGroupPerformRename(UIActionPool *pParent)
583 : UIActionSimple(pParent, ":/vm_group_name_16px.png", ":/vm_group_name_disabled_16px.png")
584 {}
585
586protected:
587
588 /** Returns shortcut extra-data ID. */
589 virtual QString shortcutExtraDataID() const RT_OVERRIDE
590 {
591 return QString("RenameVMGroup");
592 }
593
594 /** Handles translation event. */
595 virtual void retranslateUi() RT_OVERRIDE
596 {
597 setName(QApplication::translate("UIActionPool", "Rena&me Group..."));
598 setStatusTip(QApplication::translate("UIActionPool", "Rename selected virtual machine group"));
599 }
600};
601
602/** Simple action extension, used as 'Perform Remove Group' action class. */
603class UIActionSimpleManagerGroupPerformRemove : public UIActionSimple
604{
605 Q_OBJECT;
606
607public:
608
609 /** Constructs action passing @a pParent to the base-class. */
610 UIActionSimpleManagerGroupPerformRemove(UIActionPool *pParent)
611 : UIActionSimple(pParent, ":/vm_group_remove_16px.png", ":/vm_group_remove_disabled_16px.png")
612 {}
613
614protected:
615
616 /** Returns shortcut extra-data ID. */
617 virtual QString shortcutExtraDataID() const RT_OVERRIDE
618 {
619 return QString("AddVMGroup");
620 }
621
622 /** Handles translation event. */
623 virtual void retranslateUi() RT_OVERRIDE
624 {
625 setName(QApplication::translate("UIActionPool", "&Ungroup"));
626 setStatusTip(QApplication::translate("UIActionPool", "Ungroup items of selected virtual machine group"));
627 }
628};
629
630/** Simple action extension, used as 'Perform Sort Group' action class. */
631class UIActionSimpleManagerGroupPerformSort : public UIActionSimple
632{
633 Q_OBJECT;
634
635public:
636
637 /** Constructs action passing @a pParent to the base-class. */
638 UIActionSimpleManagerGroupPerformSort(UIActionPool *pParent)
639 : UIActionSimple(pParent, ":/sort_16px.png", ":/sort_disabled_16px.png")
640 {}
641
642protected:
643
644 /** Returns shortcut extra-data ID. */
645 virtual QString shortcutExtraDataID() const RT_OVERRIDE
646 {
647 return QString("SortGroup");
648 }
649
650 /** Handles translation event. */
651 virtual void retranslateUi() RT_OVERRIDE
652 {
653 setName(QApplication::translate("UIActionPool", "&Sort"));
654 setStatusTip(QApplication::translate("UIActionPool", "Sort items of selected virtual machine group alphabetically"));
655 }
656};
657
658
659/** Menu action extension, used as 'Machine' menu class. */
660class UIActionMenuManagerMachine : public UIActionMenu
661{
662 Q_OBJECT;
663
664public:
665
666 /** Constructs action passing @a pParent to the base-class. */
667 UIActionMenuManagerMachine(UIActionPool *pParent)
668 : UIActionMenu(pParent)
669 {}
670
671protected:
672
673 /** Handles translation event. */
674 virtual void retranslateUi() RT_OVERRIDE
675 {
676 setName(QApplication::translate("UIActionPool", "&Machine"));
677 }
678};
679
680/** Simple action extension, used as 'Perform Create Machine' action class. */
681class UIActionSimpleManagerMachinePerformCreate : public UIActionSimple
682{
683 Q_OBJECT;
684
685public:
686
687 /** Constructs action passing @a pParent to the base-class. */
688 UIActionSimpleManagerMachinePerformCreate(UIActionPool *pParent)
689 : UIActionSimple(pParent,
690 ":/vm_new_32px.png", ":/vm_new_16px.png",
691 ":/vm_new_disabled_32px.png", ":/vm_new_disabled_16px.png")
692 {}
693
694protected:
695
696 /** Returns shortcut extra-data ID. */
697 virtual QString shortcutExtraDataID() const RT_OVERRIDE
698 {
699 return QString("NewVM");
700 }
701
702 /** Returns default shortcut. */
703 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
704 {
705 return QKeySequence("Ctrl+N");
706 }
707
708 /** Handles translation event. */
709 virtual void retranslateUi() RT_OVERRIDE
710 {
711 setName(QApplication::translate("UIActionPool", "&New..."));
712 setStatusTip(QApplication::translate("UIActionPool", "Create new virtual machine"));
713 setToolTip(simplifyText(text()) + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
714 }
715};
716
717/** Simple action extension, used as 'Perform Add Machine' action class. */
718class UIActionSimpleManagerMachinePerformAdd : public UIActionSimple
719{
720 Q_OBJECT;
721
722public:
723
724 /** Constructs action passing @a pParent to the base-class. */
725 UIActionSimpleManagerMachinePerformAdd(UIActionPool *pParent)
726 : UIActionSimple(pParent,
727 ":/vm_add_32px.png", ":/vm_add_16px.png",
728 ":/vm_add_disabled_32px.png", ":/vm_add_disabled_16px.png")
729 {}
730
731protected:
732
733 /** Returns shortcut extra-data ID. */
734 virtual QString shortcutExtraDataID() const RT_OVERRIDE
735 {
736 return QString("AddVM");
737 }
738
739 /** Returns default shortcut. */
740 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
741 {
742 return QKeySequence("Ctrl+A");
743 }
744
745 /** Handles translation event. */
746 virtual void retranslateUi() RT_OVERRIDE
747 {
748 setName(QApplication::translate("UIActionPool", "&Add..."));
749 setStatusTip(QApplication::translate("UIActionPool", "Add existing virtual machine"));
750 setToolTip(simplifyText(text()) + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
751 }
752};
753
754/** Simple action extension, used as 'Move to Group => New' action class. */
755class UIActionSimpleManagerMachineMoveToGroupNew : public UIActionSimple
756{
757 Q_OBJECT;
758
759public:
760
761 /** Constructs action passing @a pParent to the base-class. */
762 UIActionSimpleManagerMachineMoveToGroupNew(UIActionPool *pParent)
763 : UIActionSimple(pParent)
764 {}
765
766protected:
767
768 /** Returns shortcut extra-data ID. */
769 virtual QString shortcutExtraDataID() const RT_OVERRIDE
770 {
771 return QString("AddVMGroup");
772 }
773
774 /** Handles translation event. */
775 virtual void retranslateUi() RT_OVERRIDE
776 {
777 setName(QApplication::translate("UIActionPool", "[New]", "group"));
778 setStatusTip(QApplication::translate("UIActionPool", "Add new group based on selected virtual machines"));
779 }
780};
781
782/** Simple action extension, used as 'Show Machine Settings' action class. */
783class UIActionSimpleManagerMachineShowSettings : public UIActionSimple
784{
785 Q_OBJECT;
786
787public:
788
789 /** Constructs action passing @a pParent to the base-class. */
790 UIActionSimpleManagerMachineShowSettings(UIActionPool *pParent)
791 : UIActionSimple(pParent,
792 ":/vm_settings_32px.png", ":/vm_settings_16px.png",
793 ":/vm_settings_disabled_32px.png", ":/vm_settings_disabled_16px.png")
794 {}
795
796protected:
797
798 /** Returns shortcut extra-data ID. */
799 virtual QString shortcutExtraDataID() const RT_OVERRIDE
800 {
801 return QString("SettingsVM");
802 }
803
804 /** Returns default shortcut. */
805 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
806 {
807 return QKeySequence("Ctrl+S");
808 }
809
810 /** Handles translation event. */
811 virtual void retranslateUi() RT_OVERRIDE
812 {
813 setName(QApplication::translate("UIActionPool", "&Settings..."));
814 setStatusTip(QApplication::translate("UIActionPool", "Display the virtual machine settings window"));
815 setToolTip(simplifyText(text()) + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
816 }
817};
818
819/** Simple action extension, used as 'Perform Clone Machine' action class. */
820class UIActionSimpleManagerMachinePerformClone : public UIActionSimple
821{
822 Q_OBJECT;
823
824public:
825
826 /** Constructs action passing @a pParent to the base-class. */
827 UIActionSimpleManagerMachinePerformClone(UIActionPool *pParent)
828 : UIActionSimple(pParent, ":/vm_clone_16px.png", ":/vm_clone_disabled_16px.png")
829 {}
830
831protected:
832
833 /** Returns shortcut extra-data ID. */
834 virtual QString shortcutExtraDataID() const RT_OVERRIDE
835 {
836 return QString("CloneVM");
837 }
838
839 /** Returns default shortcut. */
840 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
841 {
842 return QKeySequence("Ctrl+O");
843 }
844
845 /** Handles translation event. */
846 virtual void retranslateUi() RT_OVERRIDE
847 {
848 setName(QApplication::translate("UIActionPool", "Cl&one..."));
849 setStatusTip(QApplication::translate("UIActionPool", "Clone selected virtual machine"));
850 }
851};
852
853/** Simple action extension, used as 'Perform Move Machine' action class. */
854class UIActionSimpleManagerMachinePerformMove : public UIActionSimple
855{
856 Q_OBJECT;
857
858public:
859
860 /** Constructs action passing @a pParent to the base-class. */
861 UIActionSimpleManagerMachinePerformMove(UIActionPool *pParent)
862 : UIActionSimple(pParent, ":/vm_move_16px.png", ":/vm_move_disabled_16px.png")
863 {}
864
865protected:
866
867 /** Returns shortcut extra-data ID. */
868 virtual QString shortcutExtraDataID() const RT_OVERRIDE
869 {
870 return QString("MoveVM");
871 }
872
873 /** Handles translation event. */
874 virtual void retranslateUi() RT_OVERRIDE
875 {
876 setName(QApplication::translate("UIActionPool", "&Move..."));
877 setStatusTip(QApplication::translate("UIActionPool", "Move selected virtual machine"));
878 }
879};
880
881/** Simple action extension, used as 'Perform Export Machine locally' action class. */
882class UIActionSimpleManagerMachinePerformExportLocally : public UIActionSimple
883{
884 Q_OBJECT;
885
886public:
887
888 /** Constructs action passing @a pParent to the base-class. */
889 UIActionSimpleManagerMachinePerformExportLocally(UIActionPool *pParent)
890 : UIActionSimple(pParent, ":/export_16px.png", ":/export_disabled_16px.png")
891 {}
892
893protected:
894
895 /** Returns shortcut extra-data ID. */
896 virtual QString shortcutExtraDataID() const RT_OVERRIDE
897 {
898 return QString("ExportLocally");
899 }
900
901 /** Handles translation event. */
902 virtual void retranslateUi() RT_OVERRIDE
903 {
904 setName(QApplication::translate("UIActionPool", "E&xport Locally..."));
905 setStatusTip(QApplication::translate("UIActionPool", "Export selected virtual machine locally"));
906 }
907};
908
909/** Simple action extension, used as 'Perform Export Machine to OCI' action class. */
910class UIActionSimpleManagerMachinePerformExportToOCI : public UIActionSimple
911{
912 Q_OBJECT;
913
914public:
915
916 /** Constructs action passing @a pParent to the base-class. */
917 UIActionSimpleManagerMachinePerformExportToOCI(UIActionPool *pParent)
918 : UIActionSimple(pParent, ":/export_16px.png", ":/export_disabled_16px.png")
919 {}
920
921protected:
922
923 /** Returns shortcut extra-data ID. */
924 virtual QString shortcutExtraDataID() const RT_OVERRIDE
925 {
926 return QString("ExportToOCI");
927 }
928
929 /** Handles translation event. */
930 virtual void retranslateUi() RT_OVERRIDE
931 {
932 setName(QApplication::translate("UIActionPool", "E&xport to OCI..."));
933 setStatusTip(QApplication::translate("UIActionPool", "Export selected virtual machine to OCI"));
934 }
935};
936
937/** Simple action extension, used as 'Perform Remove Machine' action class. */
938class UIActionSimpleManagerMachinePerformRemove : public UIActionSimple
939{
940 Q_OBJECT;
941
942public:
943
944 /** Constructs action passing @a pParent to the base-class. */
945 UIActionSimpleManagerMachinePerformRemove(UIActionPool *pParent)
946 : UIActionSimple(pParent,
947 ":/vm_delete_32px.png", ":/vm_delete_16px.png",
948 ":/vm_delete_disabled_32px.png", ":/vm_delete_disabled_16px.png")
949 {}
950
951protected:
952
953 /** Returns shortcut extra-data ID. */
954 virtual QString shortcutExtraDataID() const RT_OVERRIDE
955 {
956 return QString("RemoveVM");
957 }
958
959 /** Handles translation event. */
960 virtual void retranslateUi() RT_OVERRIDE
961 {
962 setName(QApplication::translate("UIActionPool", "&Remove..."));
963 setStatusTip(QApplication::translate("UIActionPool", "Remove selected virtual machines"));
964 }
965};
966
967/** Simple action extension, used as 'Perform Sort Parent' action class. */
968class UIActionSimpleManagerMachinePerformSortParent : public UIActionSimple
969{
970 Q_OBJECT;
971
972public:
973
974 /** Constructs action passing @a pParent to the base-class. */
975 UIActionSimpleManagerMachinePerformSortParent(UIActionPool *pParent)
976 : UIActionSimple(pParent, ":/sort_16px.png", ":/sort_disabled_16px.png")
977 {}
978
979protected:
980
981 /** Returns shortcut extra-data ID. */
982 virtual QString shortcutExtraDataID() const RT_OVERRIDE
983 {
984 return QString("SortGroup");
985 }
986
987 /** Handles translation event. */
988 virtual void retranslateUi() RT_OVERRIDE
989 {
990 setName(QApplication::translate("UIActionPool", "&Sort"));
991 setStatusTip(QApplication::translate("UIActionPool", "Sort group of first selected virtual machine alphabetically"));
992 }
993};
994
995
996/** Menu action extension, used as 'Move to Group' menu class. */
997class UIActionMenuManagerCommonMoveToGroup : public UIActionMenu
998{
999 Q_OBJECT;
1000
1001public:
1002
1003 /** Constructs action passing @a pParent to the base-class. */
1004 UIActionMenuManagerCommonMoveToGroup(UIActionPool *pParent)
1005 : UIActionMenu(pParent, ":/vm_group_create_16px.png", ":/vm_group_create_disabled_16px.png")
1006 {}
1007
1008protected:
1009
1010 /** Handles translation event. */
1011 virtual void retranslateUi() RT_OVERRIDE
1012 {
1013 setName(QApplication::translate("UIActionPool", "Move to Gro&up"));
1014 }
1015};
1016
1017/** Menu action extension, used as 'Start or Show' menu class. */
1018class UIActionStateManagerCommonStartOrShow : public UIActionMenu
1019{
1020 Q_OBJECT;
1021
1022public:
1023
1024 /** Constructs action passing @a pParent to the base-class. */
1025 UIActionStateManagerCommonStartOrShow(UIActionPool *pParent)
1026 : UIActionMenu(pParent,
1027 ":/vm_start_32px.png", ":/vm_start_16px.png",
1028 ":/vm_start_disabled_32px.png", ":/vm_start_disabled_16px.png")
1029 {}
1030
1031protected:
1032
1033 /** Returns shortcut extra-data ID. */
1034 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1035 {
1036 return QString("StartVM");
1037 }
1038
1039 /** Handles translation event. */
1040 virtual void retranslateUi() RT_OVERRIDE
1041 {
1042 switch (state())
1043 {
1044 case 0:
1045 {
1046 setName(QApplication::translate("UIActionPool", "S&tart"));
1047 setStatusTip(QApplication::translate("UIActionPool", "Start selected virtual machines"));
1048 setToolTip(simplifyText(text()) + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
1049 break;
1050 }
1051 case 1:
1052 {
1053 setName(QApplication::translate("UIActionPool", "S&how"));
1054 setStatusTip(QApplication::translate("UIActionPool", "Switch to the windows of selected virtual machines"));
1055 setToolTip(simplifyText(text()) + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
1056 break;
1057 }
1058 default:
1059 break;
1060 }
1061 }
1062
1063 /** Handles state change. */
1064 virtual void handleStateChange() RT_OVERRIDE
1065 {
1066 switch (state())
1067 {
1068 case 0: showMenu(); break;
1069 case 1: hideMenu(); break;
1070 default: break;
1071 }
1072 }
1073};
1074
1075/** Simple action extension, used as 'Perform Normal Start' action class. */
1076class UIActionSimpleManagerCommonPerformStartNormal : public UIActionSimple
1077{
1078 Q_OBJECT;
1079
1080public:
1081
1082 /** Constructs action passing @a pParent to the base-class. */
1083 UIActionSimpleManagerCommonPerformStartNormal(UIActionPool *pParent)
1084 : UIActionSimple(pParent, ":/vm_start_16px.png", ":/vm_start_16px.png")
1085 {}
1086
1087protected:
1088
1089 /** Returns shortcut extra-data ID. */
1090 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1091 {
1092 return QString("StartVMNormal");
1093 }
1094
1095 /** Handles translation event. */
1096 virtual void retranslateUi() RT_OVERRIDE
1097 {
1098 setName(QApplication::translate("UIActionPool", "&Normal Start"));
1099 setStatusTip(QApplication::translate("UIActionPool", "Start selected virtual machines"));
1100 }
1101};
1102
1103/** Simple action extension, used as 'Perform Headless Start' action class. */
1104class UIActionSimpleManagerCommonPerformStartHeadless : public UIActionSimple
1105{
1106 Q_OBJECT;
1107
1108public:
1109
1110 /** Constructs action passing @a pParent to the base-class. */
1111 UIActionSimpleManagerCommonPerformStartHeadless(UIActionPool *pParent)
1112 : UIActionSimple(pParent, ":/vm_start_headless_16px.png", ":/vm_start_headless_16px.png")
1113 {}
1114
1115protected:
1116
1117 /** Returns shortcut extra-data ID. */
1118 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1119 {
1120 return QString("StartVMHeadless");
1121 }
1122
1123 /** Handles translation event. */
1124 virtual void retranslateUi() RT_OVERRIDE
1125 {
1126 setName(QApplication::translate("UIActionPool", "&Headless Start"));
1127 setStatusTip(QApplication::translate("UIActionPool", "Start selected virtual machines in the background"));
1128 }
1129};
1130
1131/** Simple action extension, used as 'Perform Detachable Start' action class. */
1132class UIActionSimpleManagerCommonPerformStartDetachable : public UIActionSimple
1133{
1134 Q_OBJECT;
1135
1136public:
1137
1138 /** Constructs action passing @a pParent to the base-class. */
1139 UIActionSimpleManagerCommonPerformStartDetachable(UIActionPool *pParent)
1140 : UIActionSimple(pParent, ":/vm_start_separate_16px.png", ":/vm_start_separate_16px.png")
1141 {}
1142
1143protected:
1144
1145 /** Returns shortcut extra-data ID. */
1146 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1147 {
1148 return QString("StartVMDetachable");
1149 }
1150
1151 /** Handles translation event. */
1152 virtual void retranslateUi() RT_OVERRIDE
1153 {
1154 setName(QApplication::translate("UIActionPool", "&Detachable Start"));
1155 setStatusTip(QApplication::translate("UIActionPool", "Start selected virtual machines with option of continuing in background"));
1156 }
1157};
1158
1159/** Toggle action extension, used as 'Pause and Resume' action class. */
1160class UIActionToggleManagerCommonPauseAndResume : public UIActionToggle
1161{
1162 Q_OBJECT;
1163
1164public:
1165
1166 /** Constructs action passing @a pParent to the base-class. */
1167 UIActionToggleManagerCommonPauseAndResume(UIActionPool *pParent)
1168 : UIActionToggle(pParent,
1169 ":/vm_pause_on_16px.png", ":/vm_pause_16px.png",
1170 ":/vm_pause_on_disabled_16px.png", ":/vm_pause_disabled_16px.png")
1171 {}
1172
1173protected:
1174
1175 /** Returns shortcut extra-data ID. */
1176 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1177 {
1178 return QString("PauseVM");
1179 }
1180
1181 /** Handles translation event. */
1182 virtual void retranslateUi() RT_OVERRIDE
1183 {
1184 setName(QApplication::translate("UIActionPool", "&Pause"));
1185 setStatusTip(QApplication::translate("UIActionPool", "Suspend execution of selected virtual machines"));
1186 }
1187};
1188
1189/** Simple action extension, used as 'Perform Reset' action class. */
1190class UIActionSimpleManagerCommonPerformReset : public UIActionSimple
1191{
1192 Q_OBJECT;
1193
1194public:
1195
1196 /** Constructs action passing @a pParent to the base-class. */
1197 UIActionSimpleManagerCommonPerformReset(UIActionPool *pParent)
1198 : UIActionSimple(pParent, ":/vm_reset_16px.png", ":/vm_reset_disabled_16px.png")
1199 {}
1200
1201protected:
1202
1203 /** Returns shortcut extra-data ID. */
1204 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1205 {
1206 return QString("ResetVM");
1207 }
1208
1209 /** Handles translation event. */
1210 virtual void retranslateUi() RT_OVERRIDE
1211 {
1212 setName(QApplication::translate("UIActionPool", "&Reset"));
1213 setStatusTip(QApplication::translate("UIActionPool", "Reset selected virtual machines"));
1214 }
1215};
1216
1217/** Simple action extension, used as 'Perform Detach' action class. */
1218class UIActionSimpleManagerCommonPerformDetach : public UIActionSimple
1219{
1220 Q_OBJECT;
1221
1222public:
1223
1224 /** Constructs action passing @a pParent to the base-class. */
1225 UIActionSimpleManagerCommonPerformDetach(UIActionPool *pParent)
1226 : UIActionSimple(pParent, ":/vm_create_shortcut_16px.png", ":/vm_create_shortcut_disabled_16px.png")
1227 {}
1228
1229protected:
1230
1231 /** Returns shortcut extra-data ID. */
1232 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1233 {
1234 return QString("DetachUIVM");
1235 }
1236
1237 /** Handles translation event. */
1238 virtual void retranslateUi() RT_OVERRIDE
1239 {
1240 setName(QApplication::translate("UIActionPool", "&Detach GUI"));
1241 setStatusTip(QApplication::translate("UIActionPool", "Detach the GUI from headless VM"));
1242 }
1243};
1244
1245/** Simple menu action extension, used as 'Perform Discard' action class. */
1246class UIActionSimpleManagerCommonPerformDiscard : public UIActionSimple
1247{
1248 Q_OBJECT;
1249
1250public:
1251
1252 /** Constructs action passing @a pParent to the base-class. */
1253 UIActionSimpleManagerCommonPerformDiscard(UIActionPool *pParent)
1254 : UIActionSimple(pParent,
1255 ":/vm_discard_32px.png", ":/vm_discard_16px.png",
1256 ":/vm_discard_disabled_32px.png", ":/vm_discard_disabled_16px.png")
1257 {}
1258
1259protected:
1260
1261 /** Returns shortcut extra-data ID. */
1262 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1263 {
1264 return QString("DiscardVM");
1265 }
1266
1267 /** Handles translation event. */
1268 virtual void retranslateUi() RT_OVERRIDE
1269 {
1270 setIconText(QApplication::translate("UIActionPool", "Discard"));
1271 setName(QApplication::translate("UIActionPool", "D&iscard Saved State..."));
1272 setStatusTip(QApplication::translate("UIActionPool", "Discard saved state of selected virtual machines"));
1273 setToolTip(simplifyText(text()) + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
1274 }
1275};
1276
1277/** Simple action extension, used as 'Show Machine Logs' action class. */
1278class UIActionSimpleManagerCommonShowMachineLogs : public UIActionSimple
1279{
1280 Q_OBJECT;
1281
1282public:
1283
1284 /** Constructs action passing @a pParent to the base-class. */
1285 UIActionSimpleManagerCommonShowMachineLogs(UIActionPool *pParent)
1286 : UIActionSimple(pParent,
1287 ":/vm_show_logs_32px.png", ":/vm_show_logs_16px.png",
1288 ":/vm_show_logs_disabled_32px.png", ":/vm_show_logs_disabled_16px.png")
1289 {
1290 retranslateUi();
1291 }
1292
1293protected:
1294
1295 /** Returns shortcut extra-data ID. */
1296 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1297 {
1298 return QString("LogViewer");
1299 }
1300
1301 /** Returns default shortcut. */
1302 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
1303 {
1304 return QKeySequence("Ctrl+L");
1305 }
1306
1307 /** Handles translation event. */
1308 virtual void retranslateUi() RT_OVERRIDE
1309 {
1310 setName(QApplication::translate("UIActionPool", "Show &Log..."));
1311 setStatusTip(QApplication::translate("UIActionPool", "Show log files of selected virtual machines"));
1312 }
1313};
1314
1315/** Simple action extension, used as 'Perform Refresh' action class. */
1316class UIActionSimpleManagerCommonPerformRefresh : public UIActionSimple
1317{
1318 Q_OBJECT;
1319
1320public:
1321
1322 /** Constructs action passing @a pParent to the base-class. */
1323 UIActionSimpleManagerCommonPerformRefresh(UIActionPool *pParent)
1324 : UIActionSimple(pParent,
1325 ":/refresh_32px.png", ":/refresh_16px.png",
1326 ":/refresh_disabled_32px.png", ":/refresh_disabled_16px.png")
1327 {}
1328
1329protected:
1330
1331 /** Returns shortcut extra-data ID. */
1332 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1333 {
1334 return QString("RefreshVM");
1335 }
1336
1337 /** Handles translation event. */
1338 virtual void retranslateUi() RT_OVERRIDE
1339 {
1340 setName(QApplication::translate("UIActionPool", "Re&fresh"));
1341 setStatusTip(QApplication::translate("UIActionPool", "Refresh accessibility state of selected virtual machines"));
1342 }
1343};
1344
1345/** Simple action extension, used as 'Show in File Manager' action class. */
1346class UIActionSimpleManagerCommonShowInFileManager : public UIActionSimple
1347{
1348 Q_OBJECT;
1349
1350public:
1351
1352 /** Constructs action passing @a pParent to the base-class. */
1353 UIActionSimpleManagerCommonShowInFileManager(UIActionPool *pParent)
1354 : UIActionSimple(pParent, ":/vm_open_filemanager_16px.png", ":/vm_open_filemanager_disabled_16px.png")
1355 {}
1356
1357protected:
1358
1359 /** Returns shortcut extra-data ID. */
1360 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1361 {
1362 return QString("ShowVMInFileManager");
1363 }
1364
1365 /** Handles translation event. */
1366 virtual void retranslateUi() RT_OVERRIDE
1367 {
1368#if defined(VBOX_WS_MAC)
1369 setName(QApplication::translate("UIActionPool", "S&how in Finder"));
1370 setStatusTip(QApplication::translate("UIActionPool", "Show the VirtualBox Machine Definition files in Finder"));
1371#elif defined(VBOX_WS_WIN)
1372 setName(QApplication::translate("UIActionPool", "S&how in Explorer"));
1373 setStatusTip(QApplication::translate("UIActionPool", "Show the VirtualBox Machine Definition files in Explorer"));
1374#else
1375 setName(QApplication::translate("UIActionPool", "S&how in File Manager"));
1376 setStatusTip(QApplication::translate("UIActionPool", "Show the VirtualBox Machine Definition files in the File Manager"));
1377#endif
1378 }
1379};
1380
1381/** Simple action extension, used as 'Perform Create Shortcut' action class. */
1382class UIActionSimpleManagerCommonPerformCreateShortcut : public UIActionSimple
1383{
1384 Q_OBJECT;
1385
1386public:
1387
1388 /** Constructs action passing @a pParent to the base-class. */
1389 UIActionSimpleManagerCommonPerformCreateShortcut(UIActionPool *pParent)
1390 : UIActionSimple(pParent, ":/vm_create_shortcut_16px.png", ":/vm_create_shortcut_disabled_16px.png")
1391 {}
1392
1393protected:
1394
1395 /** Returns shortcut extra-data ID. */
1396 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1397 {
1398 return QString("CreateVMAlias");
1399 }
1400
1401 /** Handles translation event. */
1402 virtual void retranslateUi() RT_OVERRIDE
1403 {
1404#if defined(VBOX_WS_MAC)
1405 setName(QApplication::translate("UIActionPool", "Cr&eate Alias on Desktop"));
1406 setStatusTip(QApplication::translate("UIActionPool", "Create alias files to the VirtualBox Machine Definition files on your desktop"));
1407#else
1408 setName(QApplication::translate("UIActionPool", "Cr&eate Shortcut on Desktop"));
1409 setStatusTip(QApplication::translate("UIActionPool", "Create shortcut files to the VirtualBox Machine Definition files on your desktop"));
1410#endif
1411 }
1412};
1413
1414/** Toggle action extension, used as 'Search' action class. */
1415class UIActionToggleManagerCommonToggleSearch : public UIActionToggle
1416{
1417 Q_OBJECT;
1418
1419public:
1420
1421 /** Constructs action passing @a pParent to the base-class. */
1422 UIActionToggleManagerCommonToggleSearch(UIActionPool *pParent)
1423 : UIActionToggle(pParent,
1424 ":/search_16px.png", ":/search_16px.png",
1425 ":/search_16px.png", ":/search_16px.png") /// @todo use icons with check-boxes
1426 {}
1427
1428protected:
1429
1430 /** Returns shortcut extra-data ID. */
1431 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1432 {
1433 return QString("SearchVM");
1434 }
1435
1436 /** Returns default shortcut. */
1437 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
1438 {
1439 return QKeySequence("Ctrl+F");
1440 }
1441
1442 /** Handles translation event. */
1443 virtual void retranslateUi() RT_OVERRIDE
1444 {
1445 setName(QApplication::translate("UIActionPool", "S&earch"));
1446 setStatusTip(QApplication::translate("UIActionPool", "Search virtual machines with respect to a search term"));
1447 }
1448};
1449
1450
1451/** Menu action extension, used as 'Console' menu class. */
1452class UIActionMenuManagerConsole : public UIActionMenu
1453{
1454 Q_OBJECT;
1455
1456public:
1457
1458 /** Constructs action passing @a pParent to the base-class. */
1459 UIActionMenuManagerConsole(UIActionPool *pParent)
1460 : UIActionMenu(pParent, ":/cloud_machine_console_16px.png")
1461 {}
1462
1463protected:
1464
1465 /** Handles translation event. */
1466 virtual void retranslateUi() RT_OVERRIDE
1467 {
1468 setName(QApplication::translate("UIActionPool", "C&onsole"));
1469 }
1470};
1471
1472/** Simple action extension, used as 'Perform Create Console Connection' action class. */
1473class UIActionSimpleManagerConsolePerformCreateConnection : public UIActionSimple
1474{
1475 Q_OBJECT;
1476
1477public:
1478
1479 /** Constructs action passing @a pParent to the base-class. */
1480 UIActionSimpleManagerConsolePerformCreateConnection(UIActionPool *pParent)
1481 : UIActionSimple(pParent,
1482 ":/cloud_machine_console_create_connection_16px.png",
1483 ":/cloud_machine_console_create_connection_disabled_16px.png")
1484 {}
1485
1486protected:
1487
1488 /** Returns shortcut extra-data ID. */
1489 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1490 {
1491 return QString("CreateConsoleConnection");
1492 }
1493
1494 /** Handles translation event. */
1495 virtual void retranslateUi() RT_OVERRIDE
1496 {
1497 setName(QApplication::translate("UIActionPool", "&Create Connection"));
1498 setStatusTip(QApplication::translate("UIActionPool", "Create console connection to be able to use ssh/vnc clients"));
1499 }
1500};
1501
1502/** Simple action extension, used as 'Perform Delete Console Connection' action class. */
1503class UIActionSimpleManagerConsolePerformDeleteConnection : public UIActionSimple
1504{
1505 Q_OBJECT;
1506
1507public:
1508
1509 /** Constructs action passing @a pParent to the base-class. */
1510 UIActionSimpleManagerConsolePerformDeleteConnection(UIActionPool *pParent)
1511 : UIActionSimple(pParent,
1512 ":/cloud_machine_console_delete_connection_16px.png",
1513 ":/cloud_machine_console_delete_connection_disabled_16px.png")
1514 {}
1515
1516protected:
1517
1518 /** Returns shortcut extra-data ID. */
1519 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1520 {
1521 return QString("DeleteConsoleConnection");
1522 }
1523
1524 /** Handles translation event. */
1525 virtual void retranslateUi() RT_OVERRIDE
1526 {
1527 setName(QApplication::translate("UIActionPool", "&Delete Connection"));
1528 setStatusTip(QApplication::translate("UIActionPool", "Delete console connection to disconnect ssh/vnc clients"));
1529 }
1530};
1531
1532/** Simple action extension, used as 'Perform Configure Applications' action class. */
1533class UIActionSimpleManagerConsolePerformConfigureApplications : public UIActionSimple
1534{
1535 Q_OBJECT;
1536
1537public:
1538
1539 /** Constructs action passing @a pParent to the base-class. */
1540 UIActionSimpleManagerConsolePerformConfigureApplications(UIActionPool *pParent)
1541 : UIActionSimple(pParent,
1542 ":/cloud_machine_console_configure_external_terminal_16px.png",
1543 ":/cloud_machine_console_configure_external_terminal_disabled_16px.png")
1544 {
1545 setProperty("UIToolType", QVariant::fromValue(UIToolType_CloudConsole));
1546 }
1547
1548protected:
1549
1550 /** Returns shortcut extra-data ID. */
1551 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1552 {
1553 return QString("ConfigureConsoleApplications");
1554 }
1555
1556 /** Handles translation event. */
1557 virtual void retranslateUi() RT_OVERRIDE
1558 {
1559 setName(QApplication::translate("UIActionPool", "&Configure Console Applications"));
1560 setStatusTip(QApplication::translate("UIActionPool", "Open configuration dialog to edit console application settings"));
1561 }
1562};
1563
1564/** Simple action extension, used as 'Copy Command' action class. */
1565class UIActionSimpleManagerConsolePerformCopyCommand : public UIActionSimple
1566{
1567 Q_OBJECT;
1568
1569public:
1570
1571 /** Constructs action passing @a pParent to the base-class. */
1572 UIActionSimpleManagerConsolePerformCopyCommand(UIActionPool *pParent, bool fSerial, bool fUnix)
1573 : UIActionSimple(pParent)
1574 , m_fSerial(fSerial)
1575 , m_fUnix(fUnix)
1576 {
1577 if (m_fSerial)
1578 setIcon(UIIconPool::iconSet(":/cloud_machine_console_get_serial_console_command_16px.png",
1579 ":/cloud_machine_console_get_serial_console_command_disabled_16px.png"));
1580 else
1581 setIcon(UIIconPool::iconSet(":/cloud_machine_console_get_vnc_console_command_16px.png",
1582 ":/cloud_machine_console_get_vnc_console_command_disabled_16px.png"));
1583 }
1584
1585protected:
1586
1587 /** Returns shortcut extra-data ID. */
1588 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1589 {
1590 return m_fSerial
1591 ? QString("CopyConsoleCommandSerial")
1592 : QString("CopyConsoleCommandVNC");
1593 }
1594
1595 /** Handles translation event. */
1596 virtual void retranslateUi() RT_OVERRIDE
1597 {
1598 if (m_fSerial)
1599 {
1600 if (m_fUnix)
1601 setName(QApplication::translate("UIActionPool", "&Copy Command (serial) for Unix"));
1602 else
1603 setName(QApplication::translate("UIActionPool", "&Copy Command (serial) for Windows"));
1604 setStatusTip(QApplication::translate("UIActionPool", "Copy console command for serial connection"));
1605 }
1606 else
1607 {
1608 if (m_fUnix)
1609 setName(QApplication::translate("UIActionPool", "&Copy Command (VNC) for Unix"));
1610 else
1611 setName(QApplication::translate("UIActionPool", "&Copy Command (VNC) for Windows"));
1612 setStatusTip(QApplication::translate("UIActionPool", "Copy console command for VNC connection"));
1613 }
1614 }
1615
1616private:
1617
1618 /** Holds whether this command is of serial type. */
1619 bool m_fSerial;
1620 /** Holds whether this command is for unix. */
1621 bool m_fUnix;
1622};
1623
1624/** Simple action extension, used as 'Show Log' action class. */
1625class UIActionSimpleManagerConsolePerformShowLog : public UIActionSimple
1626{
1627 Q_OBJECT;
1628
1629public:
1630
1631 /** Constructs action passing @a pParent to the base-class. */
1632 UIActionSimpleManagerConsolePerformShowLog(UIActionPool *pParent)
1633 : UIActionSimple(pParent,
1634 ":/vm_show_logs_16px.png",
1635 ":/vm_show_logs_disabled_16px.png")
1636 {}
1637
1638protected:
1639
1640 /** Returns shortcut extra-data ID. */
1641 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1642 {
1643 return QString("ShowConsoleLog");
1644 }
1645
1646 /** Handles translation event. */
1647 virtual void retranslateUi() RT_OVERRIDE
1648 {
1649 setName(QApplication::translate("UIActionPool", "Show &Log"));
1650 setStatusTip(QApplication::translate("UIActionPool", "Show cloud console log"));
1651 }
1652};
1653
1654
1655/** Menu action extension, used as 'Stop' menu class. */
1656class UIActionMenuManagerStop : public UIActionMenu
1657{
1658 Q_OBJECT;
1659
1660public:
1661
1662 /** Constructs action passing @a pParent to the base-class. */
1663 UIActionMenuManagerStop(UIActionPool *pParent)
1664 : UIActionMenu(pParent, ":/exit_16px.png")
1665 {}
1666
1667protected:
1668
1669 /** Handles translation event. */
1670 virtual void retranslateUi() RT_OVERRIDE
1671 {
1672 setName(QApplication::translate("UIActionPool", "&Stop"));
1673 }
1674};
1675
1676/** Simple action extension, used as 'Perform Save' action class. */
1677class UIActionSimpleManagerStopPerformSave : public UIActionSimple
1678{
1679 Q_OBJECT;
1680
1681public:
1682
1683 /** Constructs action passing @a pParent to the base-class. */
1684 UIActionSimpleManagerStopPerformSave(UIActionPool *pParent)
1685 : UIActionSimple(pParent, ":/vm_save_state_16px.png", ":/vm_save_state_disabled_16px.png")
1686 {}
1687
1688protected:
1689
1690 /** Returns shortcut extra-data ID. */
1691 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1692 {
1693 return QString("SaveVM");
1694 }
1695
1696 /** Handles translation event. */
1697 virtual void retranslateUi() RT_OVERRIDE
1698 {
1699 setName(QApplication::translate("UIActionPool", "&Save State"));
1700 setStatusTip(QApplication::translate("UIActionPool", "Save state of selected virtual machines"));
1701 }
1702};
1703
1704/** Simple action extension, used as 'Perform Terminate' action class. */
1705class UIActionSimpleManagerStopPerformTerminate : public UIActionSimple
1706{
1707 Q_OBJECT;
1708
1709public:
1710
1711 /** Constructs action passing @a pParent to the base-class. */
1712 UIActionSimpleManagerStopPerformTerminate(UIActionPool *pParent)
1713 : UIActionSimple(pParent, ":/vm_discard_16px.png", ":/vm_discard_disabled_16px.png")
1714 {}
1715
1716protected:
1717
1718 /** Returns shortcut extra-data ID. */
1719 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1720 {
1721 return QString("TerminateVM");
1722 }
1723
1724 /** Handles translation event. */
1725 virtual void retranslateUi() RT_OVERRIDE
1726 {
1727 setIconText(QApplication::translate("UIActionPool", "Terminate"));
1728 setName(QApplication::translate("UIActionPool", "&Terminate Cloud Instance..."));
1729 setStatusTip(QApplication::translate("UIActionPool", "Terminate cloud instance of selected virtual machines"));
1730 setToolTip(simplifyText(text()) + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
1731 }
1732};
1733
1734/** Simple action extension, used as 'Perform Shutdown' action class. */
1735class UIActionSimpleManagerStopPerformShutdown : public UIActionSimple
1736{
1737 Q_OBJECT;
1738
1739public:
1740
1741 /** Constructs action passing @a pParent to the base-class. */
1742 UIActionSimpleManagerStopPerformShutdown(UIActionPool *pParent)
1743 : UIActionSimple(pParent, ":/vm_shutdown_16px.png", ":/vm_shutdown_disabled_16px.png")
1744 {}
1745
1746protected:
1747
1748 /** Returns shortcut extra-data ID. */
1749 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1750 {
1751 return QString("ACPIShutdownVM");
1752 }
1753
1754 /** Handles translation event. */
1755 virtual void retranslateUi() RT_OVERRIDE
1756 {
1757 setName(QApplication::translate("UIActionPool", "ACPI Sh&utdown"));
1758 setStatusTip(QApplication::translate("UIActionPool", "Send ACPI Shutdown signal to selected virtual machines"));
1759 }
1760};
1761
1762/** Simple action extension, used as 'Perform PowerOff' action class. */
1763class UIActionSimpleManagerStopPerformPowerOff : public UIActionSimple
1764{
1765 Q_OBJECT;
1766
1767public:
1768
1769 /** Constructs action passing @a pParent to the base-class. */
1770 UIActionSimpleManagerStopPerformPowerOff(UIActionPool *pParent)
1771 : UIActionSimple(pParent, ":/vm_poweroff_16px.png", ":/vm_poweroff_disabled_16px.png")
1772 {}
1773
1774protected:
1775
1776 /** Returns shortcut extra-data ID. */
1777 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1778 {
1779 return QString("PowerOffVM");
1780 }
1781
1782 /** Handles translation event. */
1783 virtual void retranslateUi() RT_OVERRIDE
1784 {
1785 setName(QApplication::translate("UIActionPool", "Po&wer Off"));
1786 setStatusTip(QApplication::translate("UIActionPool", "Power off selected virtual machines"));
1787 }
1788};
1789
1790
1791/** Menu action extension, used as 'Machine Tools' menu class. */
1792class UIActionMenuManagerToolsMachine : public UIActionMenu
1793{
1794 Q_OBJECT;
1795
1796public:
1797
1798 /** Constructs action passing @a pParent to the base-class. */
1799 UIActionMenuManagerToolsMachine(UIActionPool *pParent)
1800 : UIActionMenu(pParent, ":/tools_menu_24px.png") /// @todo replace with 16px icon
1801 {}
1802
1803protected:
1804
1805 /** Returns shortcut extra-data ID. */
1806 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1807 {
1808 return QString("ToolsMachineMenu");
1809 }
1810
1811 /** Handles translation event. */
1812 virtual void retranslateUi() RT_OVERRIDE
1813 {
1814 setName(QApplication::translate("UIActionPool", "Tools"));
1815 }
1816};
1817
1818/** Simple action extension, used as 'Show Machine Details' action class. */
1819class UIActionToggleManagerToolsMachineShowDetails : public UIActionToggle
1820{
1821 Q_OBJECT;
1822
1823public:
1824
1825 /** Constructs action passing @a pParent to the base-class. */
1826 UIActionToggleManagerToolsMachineShowDetails(UIActionPool *pParent)
1827 : UIActionToggle(pParent)
1828 {
1829 setProperty("UIToolType", QVariant::fromValue(UIToolType_Details));
1830 /// @todo use icons with check-boxes
1831 setIcon(UIIconPool::iconSetFull(":/machine_details_manager_24px.png", ":/machine_details_manager_16px.png",
1832 ":/machine_details_manager_disabled_24px.png", ":/machine_details_manager_disabled_16px.png"));
1833 }
1834
1835protected:
1836
1837 /** Returns shortcut extra-data ID. */
1838 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1839 {
1840 return QString("ToolsMachineDetails");
1841 }
1842
1843 /** Handles translation event. */
1844 virtual void retranslateUi() RT_OVERRIDE
1845 {
1846 setName(QApplication::translate("UIActionPool", "&Details"));
1847 setStatusTip(QApplication::translate("UIActionPool", "Open the machine details pane"));
1848 }
1849};
1850
1851/** Simple action extension, used as 'Show Machine Snapshots' action class. */
1852class UIActionToggleManagerToolsMachineShowSnapshots : public UIActionToggle
1853{
1854 Q_OBJECT;
1855
1856public:
1857
1858 /** Constructs action passing @a pParent to the base-class. */
1859 UIActionToggleManagerToolsMachineShowSnapshots(UIActionPool *pParent)
1860 : UIActionToggle(pParent)
1861 {
1862 setProperty("UIToolType", QVariant::fromValue(UIToolType_Snapshots));
1863 /// @todo use icons with check-boxes
1864 setIcon(UIIconPool::iconSetFull(":/snapshot_manager_24px.png", ":/snapshot_manager_16px.png",
1865 ":/snapshot_manager_disabled_24px.png", ":/snapshot_manager_disabled_16px.png"));
1866 }
1867
1868protected:
1869
1870 /** Returns shortcut extra-data ID. */
1871 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1872 {
1873 return QString("ToolsMachineSnapshots");
1874 }
1875
1876 /** Handles translation event. */
1877 virtual void retranslateUi() RT_OVERRIDE
1878 {
1879 setName(QApplication::translate("UIActionPool", "&Snapshots"));
1880 setStatusTip(QApplication::translate("UIActionPool", "Open the machine snapshots pane"));
1881 }
1882};
1883
1884/** Simple action extension, used as 'Show Machine Logs' action class. */
1885class UIActionToggleManagerToolsMachineShowLogs : public UIActionToggle
1886{
1887 Q_OBJECT;
1888
1889public:
1890
1891 /** Constructs action passing @a pParent to the base-class. */
1892 UIActionToggleManagerToolsMachineShowLogs(UIActionPool *pParent)
1893 : UIActionToggle(pParent)
1894 {
1895 setProperty("UIToolType", QVariant::fromValue(UIToolType_Logs));
1896 /// @todo use icons with check-boxes
1897 setIcon(UIIconPool::iconSetFull(":/vm_show_logs_32px.png", ":/vm_show_logs_16px.png",
1898 ":/vm_show_logs_disabled_32px.png", ":/vm_show_logs_disabled_16px.png"));
1899 }
1900
1901protected:
1902
1903 /** Returns shortcut extra-data ID. */
1904 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1905 {
1906 return QString("ToolsMachineLogViewer");
1907 }
1908
1909 /** Handles translation event. */
1910 virtual void retranslateUi() RT_OVERRIDE
1911 {
1912 setName(QApplication::translate("UIActionPool", "&Logs"));
1913 setStatusTip(QApplication::translate("UIActionPool", "Open the machine logs pane"));
1914 }
1915};
1916
1917/** Simple action extension, used as 'Show VM Activity Monitor' action class. */
1918class UIActionToggleManagerToolsMachineShowActivity : public UIActionToggle
1919{
1920 Q_OBJECT;
1921
1922public:
1923
1924 /** Constructs action passing @a pParent to the base-class. */
1925 UIActionToggleManagerToolsMachineShowActivity(UIActionPool *pParent)
1926 : UIActionToggle(pParent)
1927 {
1928 setProperty("UIToolType", QVariant::fromValue(UIToolType_VMActivity));
1929 /// @todo use icons with check-boxes
1930 setIcon(UIIconPool::iconSetFull(":/performance_monitor_32px.png", ":/performance_monitor_16px.png",
1931 ":/performance_monitor_disabled_32px.png", ":/performance_monitor_disabled_16px.png"));
1932 }
1933
1934protected:
1935
1936 /** Returns shortcut extra-data ID. */
1937 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1938 {
1939 return QString("ToolsMachineVMActivityMonitor");
1940 }
1941
1942 /** Handles translation event. */
1943 virtual void retranslateUi() RT_OVERRIDE
1944 {
1945 setName(QApplication::translate("UIActionPool", "&Activity"));
1946 setStatusTip(QApplication::translate("UIActionPool", "Open the machine activity monitor pane"));
1947 }
1948};
1949
1950/** Simple action extension, used as 'Show File Manager' action class. */
1951class UIActionToggleManagerToolsMachineShowFileManager : public UIActionToggle
1952{
1953 Q_OBJECT;
1954
1955public:
1956
1957 /** Constructs action passing @a pParent to the base-class. */
1958 UIActionToggleManagerToolsMachineShowFileManager(UIActionPool *pParent)
1959 : UIActionToggle(pParent)
1960 {
1961 setProperty("UIToolType", QVariant::fromValue(UIToolType_FileManager));
1962 /// @todo use icons with check-boxes
1963 setIcon(UIIconPool::iconSetFull(":/file_manager_24px.png", ":/file_manager_16px.png",
1964 ":/file_manager_disabled_24px.png", ":/file_manager_disabled_16px.png"));
1965 }
1966
1967protected:
1968
1969 /** Returns shortcut extra-data ID. */
1970 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1971 {
1972 return QString("ToolsMachineFileManager");
1973 }
1974
1975 /** Handles translation event. */
1976 virtual void retranslateUi() RT_OVERRIDE
1977 {
1978 setName(QApplication::translate("UIActionPool", "&File Manager"));
1979 setStatusTip(QApplication::translate("UIActionPool", "Open the File Manager"));
1980 }
1981};
1982
1983
1984/** Menu action extension, used as 'Snapshot' menu class. */
1985class UIActionMenuManagerSnapshot : public UIActionMenu
1986{
1987 Q_OBJECT;
1988
1989public:
1990
1991 /** Constructs action passing @a pParent to the base-class. */
1992 UIActionMenuManagerSnapshot(UIActionPool *pParent)
1993 : UIActionMenu(pParent)
1994 {}
1995
1996protected:
1997
1998 /** Returns shortcut extra-data ID. */
1999 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2000 {
2001 return QString("SnapshotMenu");
2002 }
2003
2004 /** Handles translation event. */
2005 virtual void retranslateUi() RT_OVERRIDE
2006 {
2007 setName(QApplication::translate("UIActionPool", "&Snapshot"));
2008 }
2009};
2010
2011/** Simple action extension, used as 'Perform Take' action class. */
2012class UIActionMenuManagerSnapshotPerformTake : public UIActionSimple
2013{
2014 Q_OBJECT;
2015
2016public:
2017
2018 /** Constructs action passing @a pParent to the base-class. */
2019 UIActionMenuManagerSnapshotPerformTake(UIActionPool *pParent)
2020 : UIActionSimple(pParent,
2021 ":/snapshot_take_32px.png", ":/snapshot_take_16px.png",
2022 ":/snapshot_take_disabled_32px.png", ":/snapshot_take_disabled_16px.png")
2023 {
2024 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2025 }
2026
2027protected:
2028
2029 /** Returns shortcut extra-data ID. */
2030 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2031 {
2032 return QString("TakeSnapshot");
2033 }
2034
2035 /** Returns default shortcut. */
2036 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
2037 {
2038 return QKeySequence("Ctrl+Shift+T");
2039 }
2040
2041 /** Handles translation event. */
2042 virtual void retranslateUi() RT_OVERRIDE
2043 {
2044 setName(QApplication::translate("UIActionPool", "&Take..."));
2045 setShortcutScope(QApplication::translate("UIActionPool", "Snapshot Pane"));
2046 setStatusTip(QApplication::translate("UIActionPool", "Take a snapshot of the current virtual machine state"));
2047 setToolTip( QApplication::translate("UIActionPool", "Take Snapshot")
2048 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2049 }
2050};
2051
2052/** Simple action extension, used as 'Perform Delete' action class. */
2053class UIActionMenuManagerSnapshotPerformDelete : public UIActionSimple
2054{
2055 Q_OBJECT;
2056
2057public:
2058
2059 /** Constructs action passing @a pParent to the base-class. */
2060 UIActionMenuManagerSnapshotPerformDelete(UIActionPool *pParent)
2061 : UIActionSimple(pParent,
2062 ":/snapshot_delete_32px.png", ":/snapshot_delete_16px.png",
2063 ":/snapshot_delete_disabled_32px.png", ":/snapshot_delete_disabled_16px.png")
2064 {
2065 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2066 }
2067
2068protected:
2069
2070 /** Returns shortcut extra-data ID. */
2071 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2072 {
2073 return QString("DeleteSnapshot");
2074 }
2075
2076 /** Returns default shortcut. */
2077 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
2078 {
2079 return QKeySequence("Ctrl+Shift+D");
2080 }
2081
2082 /** Handles translation event. */
2083 virtual void retranslateUi() RT_OVERRIDE
2084 {
2085 setName(QApplication::translate("UIActionPool", "&Delete..."));
2086 setShortcutScope(QApplication::translate("UIActionPool", "Snapshot Pane"));
2087 setStatusTip(QApplication::translate("UIActionPool", "Delete selected snapshot of the virtual machine"));
2088 setToolTip( QApplication::translate("UIActionPool", "Delete Snapshot")
2089 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2090 }
2091};
2092
2093/** Simple action extension, used as 'Perform Restore' action class. */
2094class UIActionMenuManagerSnapshotPerformRestore : public UIActionSimple
2095{
2096 Q_OBJECT;
2097
2098public:
2099
2100 /** Constructs action passing @a pParent to the base-class. */
2101 UIActionMenuManagerSnapshotPerformRestore(UIActionPool *pParent)
2102 : UIActionSimple(pParent,
2103 ":/snapshot_restore_32px.png", ":/snapshot_restore_16px.png",
2104 ":/snapshot_restore_disabled_32px.png", ":/snapshot_restore_disabled_16px.png")
2105 {
2106 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2107 }
2108
2109protected:
2110
2111 /** Returns shortcut extra-data ID. */
2112 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2113 {
2114 return QString("RestoreSnapshot");
2115 }
2116
2117 /** Returns default shortcut. */
2118 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
2119 {
2120 return QKeySequence("Ctrl+Shift+R");
2121 }
2122
2123 /** Handles translation event. */
2124 virtual void retranslateUi() RT_OVERRIDE
2125 {
2126 setName(QApplication::translate("UIActionPool", "&Restore..."));
2127 setShortcutScope(QApplication::translate("UIActionPool", "Snapshot Pane"));
2128 setStatusTip(QApplication::translate("UIActionPool", "Restore selected snapshot of the virtual machine"));
2129 setToolTip( QApplication::translate("UIActionPool", "Restore Snapshot")
2130 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2131 }
2132};
2133
2134/** Toggle action extension, used as 'Toggle Snapshot Properties' action class. */
2135class UIActionMenuManagerSnapshotToggleProperties : public UIActionToggle
2136{
2137 Q_OBJECT;
2138
2139public:
2140
2141 /** Constructs action passing @a pParent to the base-class. */
2142 UIActionMenuManagerSnapshotToggleProperties(UIActionPool *pParent)
2143 : UIActionToggle(pParent)
2144 {
2145 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2146 /// @todo use icons with check-boxes
2147 setIcon(UIIconPool::iconSetFull(":/snapshot_show_details_32px.png", ":/snapshot_show_details_16px.png",
2148 ":/snapshot_show_details_disabled_32px.png", ":/snapshot_show_details_disabled_16px.png"));
2149 }
2150
2151protected:
2152
2153 /** Returns shortcut extra-data ID. */
2154 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2155 {
2156 return QString("ToggleSnapshotProperties");
2157 }
2158
2159 /** Returns default shortcut. */
2160 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
2161 {
2162 return QKeySequence("Ctrl+Shift+P");
2163 }
2164
2165 /** Handles translation event. */
2166 virtual void retranslateUi() RT_OVERRIDE
2167 {
2168 setName(QApplication::translate("UIActionPool", "&Properties"));
2169 setShortcutScope(QApplication::translate("UIActionPool", "Snapshot Pane"));
2170 setStatusTip(QApplication::translate("UIActionPool", "Open pane with the selected snapshot properties"));
2171 setToolTip( QApplication::translate("UIActionPool", "Open Snapshot Properties")
2172 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2173 }
2174};
2175
2176/** Simple action extension, used as 'Perform Clone' action class. */
2177class UIActionMenuManagerSnapshotPerformClone : public UIActionSimple
2178{
2179 Q_OBJECT;
2180
2181public:
2182
2183 /** Constructs action passing @a pParent to the base-class. */
2184 UIActionMenuManagerSnapshotPerformClone(UIActionPool *pParent)
2185 : UIActionSimple(pParent,
2186 ":/vm_clone_32px.png", ":/vm_clone_16px.png",
2187 ":/vm_clone_disabled_32px.png", ":/vm_clone_disabled_16px.png")
2188 {
2189 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2190 }
2191
2192protected:
2193
2194 /** Returns shortcut extra-data ID. */
2195 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2196 {
2197 return QString("CloneSnapshot");
2198 }
2199
2200 /** Returns default shortcut. */
2201 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
2202 {
2203 return QKeySequence("Ctrl+Shift+C");
2204 }
2205
2206 /** Handles translation event. */
2207 virtual void retranslateUi() RT_OVERRIDE
2208 {
2209 setName(QApplication::translate("UIActionPool", "&Clone..."));
2210 setShortcutScope(QApplication::translate("UIActionPool", "Snapshot Pane"));
2211 setStatusTip(QApplication::translate("UIActionPool", "Clone selected virtual machine"));
2212 setToolTip( QApplication::translate("UIActionPool", "Clone Virtual Machine")
2213 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2214 }
2215};
2216
2217
2218/** Menu action extension, used as 'Extension' menu class. */
2219class UIActionMenuManagerExtension : public UIActionMenu
2220{
2221 Q_OBJECT;
2222
2223public:
2224
2225 /** Constructs action passing @a pParent to the base-class. */
2226 UIActionMenuManagerExtension(UIActionPool *pParent)
2227 : UIActionMenu(pParent)
2228 {}
2229
2230protected:
2231
2232 /** Returns shortcut extra-data ID. */
2233 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2234 {
2235 return QString("ExtensionMenu");
2236 }
2237
2238 /** Handles translation event. */
2239 virtual void retranslateUi() RT_OVERRIDE
2240 {
2241 setName(QApplication::translate("UIActionPool", "&Extension"));
2242 }
2243};
2244
2245/** Simple action extension, used as 'Perform Install' action class. */
2246class UIActionSimpleManagerExtensionPerformInstall : public UIActionSimple
2247{
2248 Q_OBJECT;
2249
2250public:
2251
2252 /** Constructs action passing @a pParent to the base-class. */
2253 UIActionSimpleManagerExtensionPerformInstall(UIActionPool *pParent)
2254 : UIActionSimple(pParent,
2255 ":/extension_pack_install_32px.png", ":/extension_pack_install_16px.png",
2256 ":/extension_pack_install_disabled_32px.png", ":/extension_pack_install_disabled_16px.png")
2257 {
2258 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2259 }
2260
2261protected:
2262
2263 /** Returns shortcut extra-data ID. */
2264 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2265 {
2266 return QString("InstallExtension");
2267 }
2268
2269 /** Returns default shortcut. */
2270 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
2271 {
2272 return QKeySequence("Ctrl+Shift+I");
2273 }
2274
2275 /** Handles translation event. */
2276 virtual void retranslateUi() RT_OVERRIDE
2277 {
2278 setName(QApplication::translate("UIActionPool", "&Install..."));
2279 setShortcutScope(QApplication::translate("UIActionPool", "Extension Pack Manager"));
2280 setStatusTip(QApplication::translate("UIActionPool", "Install extension pack"));
2281 setToolTip( QApplication::translate("UIActionPool", "Install Extension Pack")
2282 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2283 }
2284};
2285
2286/** Simple action extension, used as 'Perform Uninstall' action class. */
2287class UIActionSimpleManagerExtensionPerformUninstall : public UIActionSimple
2288{
2289 Q_OBJECT;
2290
2291public:
2292
2293 /** Constructs action passing @a pParent to the base-class. */
2294 UIActionSimpleManagerExtensionPerformUninstall(UIActionPool *pParent)
2295 : UIActionSimple(pParent,
2296 ":/extension_pack_uninstall_32px.png", ":/extension_pack_uninstall_16px.png",
2297 ":/extension_pack_uninstall_disabled_32px.png", ":/extension_pack_uninstall_disabled_16px.png")
2298 {
2299 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2300 }
2301
2302protected:
2303
2304 /** Returns shortcut extra-data ID. */
2305 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2306 {
2307 return QString("UninstallExtension");
2308 }
2309
2310 /** Returns default shortcut. */
2311 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
2312 {
2313 return QKeySequence("Ctrl+Shift+U");
2314 }
2315
2316 /** Handles translation event. */
2317 virtual void retranslateUi() RT_OVERRIDE
2318 {
2319 setName(QApplication::translate("UIActionPool", "&Uninstall..."));
2320 setShortcutScope(QApplication::translate("UIActionPool", "Extension Pack Manager"));
2321 setStatusTip(QApplication::translate("UIActionPool", "Uninstall selected extension pack"));
2322 setToolTip( QApplication::translate("UIActionPool", "Uninstall Extension Pack")
2323 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2324 }
2325};
2326
2327
2328/** Menu action extension, used as 'Medium' menu class. */
2329class UIActionMenuManagerMedium : public UIActionMenu
2330{
2331 Q_OBJECT;
2332
2333public:
2334
2335 /** Constructs action passing @a pParent to the base-class. */
2336 UIActionMenuManagerMedium(UIActionPool *pParent)
2337 : UIActionMenu(pParent)
2338 {}
2339
2340protected:
2341
2342 /** Returns shortcut extra-data ID. */
2343 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2344 {
2345 return QString("MediumMenu");
2346 }
2347
2348 /** Handles translation event. */
2349 virtual void retranslateUi() RT_OVERRIDE
2350 {
2351 setName(QApplication::translate("UIActionPool", "&Medium"));
2352 }
2353};
2354
2355/** Simple action extension, used as 'Perform Add' action class. */
2356class UIActionMenuManagerMediumPerformAdd : public UIActionSimple
2357{
2358 Q_OBJECT;
2359
2360public:
2361
2362 /** Constructs action passing @a pParent to the base-class. */
2363 UIActionMenuManagerMediumPerformAdd(UIActionPool *pParent)
2364 : UIActionSimple(pParent)
2365 {
2366 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2367 setIcon(0, UIIconPool::iconSetFull(":/hd_add_32px.png", ":/hd_add_16px.png",
2368 ":/hd_add_disabled_32px.png", ":/hd_add_disabled_16px.png"));
2369 setIcon(1, UIIconPool::iconSetFull(":/cd_add_32px.png", ":/cd_add_16px.png",
2370 ":/cd_add_disabled_32px.png", ":/cd_add_disabled_16px.png"));
2371 setIcon(2, UIIconPool::iconSetFull(":/fd_add_32px.png", ":/fd_add_16px.png",
2372 ":/fd_add_disabled_32px.png", ":/fd_add_disabled_16px.png"));
2373 }
2374
2375protected:
2376
2377 /** Returns shortcut extra-data ID. */
2378 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2379 {
2380 return QString("AddMedium");
2381 }
2382
2383 /** Returns default shortcut. */
2384 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
2385 {
2386 return QKeySequence("Ctrl+Shift+A");
2387 }
2388
2389 /** Handles translation event. */
2390 virtual void retranslateUi() RT_OVERRIDE
2391 {
2392 setName(QApplication::translate("UIActionPool", "&Add..."));
2393 setShortcutScope(QApplication::translate("UIActionPool", "Media Manager"));
2394 setStatusTip(QApplication::translate("UIActionPool", "Add a disk image"));
2395 setToolTip( QApplication::translate("UIActionPool", "Add Disk Image")
2396 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2397 }
2398};
2399
2400/** Simple action extension, used as 'Perform Create' action class. */
2401class UIActionMenuManagerMediumPerformCreate : public UIActionSimple
2402{
2403 Q_OBJECT;
2404
2405public:
2406
2407 /** Constructs action passing @a pParent to the base-class. */
2408 UIActionMenuManagerMediumPerformCreate(UIActionPool *pParent)
2409 : UIActionSimple(pParent)
2410 {
2411 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2412 setIcon(0, UIIconPool::iconSetFull(":/hd_create_32px.png", ":/hd_create_16px.png",
2413 ":/hd_create_disabled_32px.png", ":/hd_create_disabled_16px.png"));
2414 setIcon(1, UIIconPool::iconSetFull(":/cd_create_32px.png", ":/cd_create_16px.png",
2415 ":/cd_create_disabled_32px.png", ":/cd_create_disabled_16px.png"));
2416 setIcon(2, UIIconPool::iconSetFull(":/fd_create_32px.png", ":/fd_create_16px.png",
2417 ":/fd_create_disabled_32px.png", ":/fd_create_disabled_16px.png"));
2418 }
2419
2420protected:
2421
2422 /** Returns shortcut extra-data ID. */
2423 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2424 {
2425 return QString("CreateMedium");
2426 }
2427
2428 /** Returns default shortcut. */
2429 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
2430 {
2431 return QKeySequence("");
2432 }
2433
2434 /** Handles translation event. */
2435 virtual void retranslateUi() RT_OVERRIDE
2436 {
2437 setName(QApplication::translate("UIActionPool", "&Create..."));
2438 setShortcutScope(QApplication::translate("UIActionPool", "Media Manager"));
2439 setStatusTip(QApplication::translate("UIActionPool", "Create a new disk image"));
2440 setToolTip( QApplication::translate("UIActionPool", "Create Disk Image")
2441 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2442 }
2443};
2444
2445/** Simple action extension, used as 'Perform Copy' action class. */
2446class UIActionMenuManagerMediumPerformCopy : public UIActionSimple
2447{
2448 Q_OBJECT;
2449
2450public:
2451
2452 /** Constructs action passing @a pParent to the base-class. */
2453 UIActionMenuManagerMediumPerformCopy(UIActionPool *pParent)
2454 : UIActionSimple(pParent)
2455 {
2456 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2457 setIcon(0, UIIconPool::iconSetFull(":/hd_copy_32px.png", ":/hd_copy_16px.png",
2458 ":/hd_copy_disabled_32px.png", ":/hd_copy_disabled_16px.png"));
2459 setIcon(1, UIIconPool::iconSetFull(":/cd_copy_32px.png", ":/cd_copy_16px.png",
2460 ":/cd_copy_disabled_32px.png", ":/cd_copy_disabled_16px.png"));
2461 setIcon(2, UIIconPool::iconSetFull(":/fd_copy_32px.png", ":/fd_copy_16px.png",
2462 ":/fd_copy_disabled_32px.png", ":/fd_copy_disabled_16px.png"));
2463 }
2464
2465protected:
2466
2467 /** Returns shortcut extra-data ID. */
2468 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2469 {
2470 return QString("CopyMedium");
2471 }
2472
2473 /** Returns default shortcut. */
2474 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
2475 {
2476 return QKeySequence("Ctrl+Shift+C");
2477 }
2478
2479 /** Handles translation event. */
2480 virtual void retranslateUi() RT_OVERRIDE
2481 {
2482 setName(QApplication::translate("UIActionPool", "&Copy..."));
2483 setShortcutScope(QApplication::translate("UIActionPool", "Media Manager"));
2484 setStatusTip(QApplication::translate("UIActionPool", "Copy selected disk image"));
2485 setToolTip( QApplication::translate("UIActionPool", "Copy Disk Image")
2486 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2487 }
2488};
2489
2490/** Simple action extension, used as 'Perform Move' action class. */
2491class UIActionMenuManagerMediumPerformMove : public UIActionSimple
2492{
2493 Q_OBJECT;
2494
2495public:
2496
2497 /** Constructs action passing @a pParent to the base-class. */
2498 UIActionMenuManagerMediumPerformMove(UIActionPool *pParent)
2499 : UIActionSimple(pParent)
2500 {
2501 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2502 setIcon(0, UIIconPool::iconSetFull(":/hd_move_32px.png", ":/hd_move_16px.png",
2503 ":/hd_move_disabled_32px.png", ":/hd_move_disabled_16px.png"));
2504 setIcon(1, UIIconPool::iconSetFull(":/cd_move_32px.png", ":/cd_move_16px.png",
2505 ":/cd_move_disabled_32px.png", ":/cd_move_disabled_16px.png"));
2506 setIcon(2, UIIconPool::iconSetFull(":/fd_move_32px.png", ":/fd_move_16px.png",
2507 ":/fd_move_disabled_32px.png", ":/fd_move_disabled_16px.png"));
2508 }
2509
2510protected:
2511
2512 /** Returns shortcut extra-data ID. */
2513 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2514 {
2515 return QString("MoveMedium");
2516 }
2517
2518 /** Returns default shortcut. */
2519 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
2520 {
2521 return QKeySequence("Ctrl+Shift+M");
2522 }
2523
2524 /** Handles translation event. */
2525 virtual void retranslateUi() RT_OVERRIDE
2526 {
2527 setName(QApplication::translate("UIActionPool", "&Move..."));
2528 setShortcutScope(QApplication::translate("UIActionPool", "Media Manager"));
2529 setStatusTip(QApplication::translate("UIActionPool", "Move selected disk image"));
2530 setToolTip( QApplication::translate("UIActionPool", "Move Disk Image")
2531 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2532 }
2533};
2534
2535/** Simple action extension, used as 'Perform Remove' action class. */
2536class UIActionMenuManagerMediumPerformRemove : public UIActionSimple
2537{
2538 Q_OBJECT;
2539
2540public:
2541
2542 /** Constructs action passing @a pParent to the base-class. */
2543 UIActionMenuManagerMediumPerformRemove(UIActionPool *pParent)
2544 : UIActionSimple(pParent)
2545 {
2546 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2547 setIcon(0, UIIconPool::iconSetFull(":/hd_remove_32px.png", ":/hd_remove_16px.png",
2548 ":/hd_remove_disabled_32px.png", ":/hd_remove_disabled_16px.png"));
2549 setIcon(1, UIIconPool::iconSetFull(":/cd_remove_32px.png", ":/cd_remove_16px.png",
2550 ":/cd_remove_disabled_32px.png", ":/cd_remove_disabled_16px.png"));
2551 setIcon(2, UIIconPool::iconSetFull(":/fd_remove_32px.png", ":/fd_remove_16px.png",
2552 ":/fd_remove_disabled_32px.png", ":/fd_remove_disabled_16px.png"));
2553 }
2554
2555protected:
2556
2557 /** Returns shortcut extra-data ID. */
2558 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2559 {
2560 return QString("RemoveMedium");
2561 }
2562
2563 /** Returns default shortcut. */
2564 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
2565 {
2566 return QKeySequence("Ctrl+Shift+R");
2567 }
2568
2569 /** Handles translation event. */
2570 virtual void retranslateUi() RT_OVERRIDE
2571 {
2572 setName(QApplication::translate("UIActionPool", "&Remove..."));
2573 setShortcutScope(QApplication::translate("UIActionPool", "Media Manager"));
2574 setStatusTip(QApplication::translate("UIActionPool", "Remove selected disk image"));
2575 setToolTip( QApplication::translate("UIActionPool", "Remove Disk Image")
2576 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2577 }
2578};
2579
2580/** Simple action extension, used as 'Perform Release' action class. */
2581class UIActionMenuManagerMediumPerformRelease : public UIActionSimple
2582{
2583 Q_OBJECT;
2584
2585public:
2586
2587 /** Constructs action passing @a pParent to the base-class. */
2588 UIActionMenuManagerMediumPerformRelease(UIActionPool *pParent)
2589 : UIActionSimple(pParent)
2590 {
2591 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2592 setIcon(0, UIIconPool::iconSetFull(":/hd_release_32px.png", ":/hd_release_16px.png",
2593 ":/hd_release_disabled_32px.png", ":/hd_release_disabled_16px.png"));
2594 setIcon(1, UIIconPool::iconSetFull(":/cd_release_32px.png", ":/cd_release_16px.png",
2595 ":/cd_release_disabled_32px.png", ":/cd_release_disabled_16px.png"));
2596 setIcon(2, UIIconPool::iconSetFull(":/fd_release_32px.png", ":/fd_release_16px.png",
2597 ":/fd_release_disabled_32px.png", ":/fd_release_disabled_16px.png"));
2598 }
2599
2600protected:
2601
2602 /** Returns shortcut extra-data ID. */
2603 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2604 {
2605 return QString("ReleaseMedium");
2606 }
2607
2608 /** Returns default shortcut. */
2609 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
2610 {
2611 return QKeySequence("Ctrl+Shift+L");
2612 }
2613
2614 /** Handles translation event. */
2615 virtual void retranslateUi() RT_OVERRIDE
2616 {
2617 setName(QApplication::translate("UIActionPool", "Re&lease..."));
2618 setShortcutScope(QApplication::translate("UIActionPool", "Media Manager"));
2619 setStatusTip(QApplication::translate("UIActionPool", "Release selected disk image"));
2620 setToolTip( QApplication::translate("UIActionPool", "Release Disk Image")
2621 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2622 }
2623};
2624
2625/** Toggle action extension, used as 'Toggle Medium Properties' action class. */
2626class UIActionMenuManagerMediumToggleProperties : public UIActionToggle
2627{
2628 Q_OBJECT;
2629
2630public:
2631
2632 /** Constructs action passing @a pParent to the base-class. */
2633 UIActionMenuManagerMediumToggleProperties(UIActionPool *pParent)
2634 : UIActionToggle(pParent)
2635 {
2636 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2637 /// @todo use icons with check-boxes
2638 setIcon(0, UIIconPool::iconSetFull(":/hd_modify_32px.png", ":/hd_modify_16px.png",
2639 ":/hd_modify_disabled_32px.png", ":/hd_modify_disabled_16px.png"));
2640 setIcon(1, UIIconPool::iconSetFull(":/cd_modify_32px.png", ":/cd_modify_16px.png",
2641 ":/cd_modify_disabled_32px.png", ":/cd_modify_disabled_16px.png"));
2642 setIcon(2, UIIconPool::iconSetFull(":/fd_modify_32px.png", ":/fd_modify_16px.png",
2643 ":/fd_modify_disabled_32px.png", ":/fd_modify_disabled_16px.png"));
2644 }
2645
2646protected:
2647
2648 /** Returns shortcut extra-data ID. */
2649 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2650 {
2651 return QString("ToggleMediumProperties");
2652 }
2653
2654 /** Returns default shortcut. */
2655 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
2656 {
2657 return QKeySequence("Ctrl+Shift+P");
2658 }
2659
2660 /** Handles translation event. */
2661 virtual void retranslateUi() RT_OVERRIDE
2662 {
2663 setName(QApplication::translate("UIActionPool", "&Properties"));
2664 setShortcutScope(QApplication::translate("UIActionPool", "Media Manager"));
2665 setStatusTip(QApplication::translate("UIActionPool", "Open pane with selected disk image properties"));
2666 setToolTip( QApplication::translate("UIActionPool", "Open Disk Image Properties")
2667 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2668 }
2669};
2670
2671/** Toggle action extension, used as 'Toggle Search Pane' action class. */
2672class UIActionMenuManagerMediumToggleSearch : public UIActionToggle
2673{
2674 Q_OBJECT;
2675
2676public:
2677
2678 /** Constructs action passing @a pParent to the base-class. */
2679 UIActionMenuManagerMediumToggleSearch(UIActionPool *pParent)
2680 : UIActionToggle(pParent)
2681 {
2682 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2683 /// @todo use icons with check-boxes
2684 setIcon(0, UIIconPool::iconSetFull(":/hd_search_32px.png", ":/hd_search_16px.png",
2685 ":/hd_search_disabled_32px.png", ":/hd_search_disabled_16px.png"));
2686 setIcon(1, UIIconPool::iconSetFull(":/cd_search_32px.png", ":/cd_search_16px.png",
2687 ":/cd_search_disabled_32px.png", ":/cd_search_disabled_16px.png"));
2688 setIcon(2, UIIconPool::iconSetFull(":/fd_search_32px.png", ":/fd_search_16px.png",
2689 ":/fd_search_disabled_32px.png", ":/fd_search_disabled_16px.png"));
2690 }
2691
2692protected:
2693
2694 /** Returns shortcut extra-data ID. */
2695 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2696 {
2697 return QString("ToggleMediumSearch");
2698 }
2699
2700 /** Returns standard shortcut. */
2701 virtual QKeySequence standardShortcut(UIActionPoolType) const RT_OVERRIDE
2702 {
2703 return actionPool()->isTemporary() ? QKeySequence() : QKeySequence(QKeySequence::Find);
2704 }
2705
2706 /** Handles translation event. */
2707 virtual void retranslateUi() RT_OVERRIDE
2708 {
2709 setName(QApplication::translate("UIActionPool", "&Search"));
2710 setShortcutScope(QApplication::translate("UIActionPool", "Media Manager"));
2711 setStatusTip(QApplication::translate("UIActionPool", "Open the disk image search pane"));
2712 setToolTip( QApplication::translate("UIActionPool", "Open Disk Image Search Pane")
2713 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2714 }
2715};
2716
2717/** Simple action extension, used as 'Perform Refresh' action class. */
2718class UIActionMenuManagerMediumPerformRefresh : public UIActionSimple
2719{
2720 Q_OBJECT;
2721
2722public:
2723
2724 /** Constructs action passing @a pParent to the base-class. */
2725 UIActionMenuManagerMediumPerformRefresh(UIActionPool *pParent)
2726 : UIActionSimple(pParent,
2727 ":/refresh_32px.png", ":/refresh_16px.png",
2728 ":/refresh_disabled_32px.png", ":/refresh_disabled_16px.png")
2729 {
2730 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2731 }
2732
2733protected:
2734
2735 /** Returns shortcut extra-data ID. */
2736 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2737 {
2738 return QString("RefreshMedia");
2739 }
2740
2741 /** Returns default shortcut. */
2742 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
2743 {
2744 return QKeySequence("Ctrl+Shift+F");
2745 }
2746
2747 /** Returns standard shortcut. */
2748 virtual QKeySequence standardShortcut(UIActionPoolType) const RT_OVERRIDE
2749 {
2750 return actionPool()->isTemporary() ? QKeySequence() : QKeySequence(QKeySequence::Refresh);
2751 }
2752
2753 /** Handles translation event. */
2754 virtual void retranslateUi() RT_OVERRIDE
2755 {
2756 setName(QApplication::translate("UIActionPool", "Re&fresh..."));
2757 setShortcutScope(QApplication::translate("UIActionPool", "Media Manager"));
2758 setStatusTip(QApplication::translate("UIActionPool", "Refresh the list of disk images"));
2759 setToolTip( QApplication::translate("UIActionPool", "Refresh Disk Images")
2760 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2761 }
2762};
2763
2764/** Simple action extension, used as 'Perform Clear' action class. */
2765class UIActionMenuManagerMediumPerformClear : public UIActionSimple
2766{
2767 Q_OBJECT;
2768
2769public:
2770
2771 /** Constructs action passing @a pParent to the base-class. */
2772 UIActionMenuManagerMediumPerformClear(UIActionPool *pParent)
2773 : UIActionSimple(pParent)
2774 {
2775 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2776 setIcon(1, UIIconPool::iconSetFull(":/cd_clear_32px.png", ":/cd_clear_16px.png",
2777 ":/cd_clear_disabled_32px.png", ":/cd_clear_disabled_16px.png"));
2778 setIcon(2, UIIconPool::iconSetFull(":/fd_clear_32px.png", ":/fd_clear_16px.png",
2779 ":/fd_clear_disabled_32px.png", ":/fd_clear_disabled_16px.png"));
2780 }
2781
2782protected:
2783
2784 /** Returns shortcut extra-data ID. */
2785 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2786 {
2787 return QString("Clear");
2788 }
2789
2790 /** Returns default shortcut. */
2791 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
2792 {
2793 return QKeySequence();
2794 }
2795
2796 /** Handles translation event. */
2797 virtual void retranslateUi() RT_OVERRIDE
2798 {
2799 setName(QApplication::translate("UIActionPool", "&Clear"));
2800 setShortcutScope(QApplication::translate("UIActionPool", "Media Manager"));
2801 setStatusTip(QApplication::translate("UIActionPool", "Remove all inaccessible media"));
2802 setToolTip( QApplication::translate("UIActionPool", "Remove Inaccessible Media")
2803 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2804 }
2805};
2806
2807/** Menu action extension, used as 'Network' menu class. */
2808class UIActionMenuManagerNetwork : public UIActionMenu
2809{
2810 Q_OBJECT;
2811
2812public:
2813
2814 /** Constructs action passing @a pParent to the base-class. */
2815 UIActionMenuManagerNetwork(UIActionPool *pParent)
2816 : UIActionMenu(pParent)
2817 {}
2818
2819protected:
2820
2821 /** Returns shortcut extra-data ID. */
2822 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2823 {
2824 return QString("NetworkMenu");
2825 }
2826
2827 /** Handles translation event. */
2828 virtual void retranslateUi() RT_OVERRIDE
2829 {
2830 setName(QApplication::translate("UIActionPool", "&Network"));
2831 }
2832};
2833
2834/** Simple action extension, used as 'Perform Create' action class. */
2835class UIActionMenuManagerNetworkPerformCreate : public UIActionSimple
2836{
2837 Q_OBJECT;
2838
2839public:
2840
2841 /** Constructs action passing @a pParent to the base-class. */
2842 UIActionMenuManagerNetworkPerformCreate(UIActionPool *pParent)
2843 : UIActionSimple(pParent,
2844 ":/host_iface_add_32px.png", ":/host_iface_add_16px.png",
2845 ":/host_iface_add_disabled_32px.png", ":/host_iface_add_disabled_16px.png")
2846 {
2847 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2848 }
2849
2850protected:
2851
2852 /** Returns shortcut extra-data ID. */
2853 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2854 {
2855 return QString("CreateNetwork");
2856 }
2857
2858 /** Returns default shortcut. */
2859 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
2860 {
2861 return QKeySequence("Ctrl+Shift+C");
2862 }
2863
2864 /** Handles translation event. */
2865 virtual void retranslateUi() RT_OVERRIDE
2866 {
2867 setName(QApplication::translate("UIActionPool", "&Create..."));
2868 setShortcutScope(QApplication::translate("UIActionPool", "Network Manager"));
2869 setStatusTip(QApplication::translate("UIActionPool", "Create new host-only network"));
2870 setToolTip( QApplication::translate("UIActionPool", "Create Host-only Network")
2871 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2872 }
2873};
2874
2875/** Simple action extension, used as 'Perform Remove' action class. */
2876class UIActionMenuManagerNetworkPerformRemove : public UIActionSimple
2877{
2878 Q_OBJECT;
2879
2880public:
2881
2882 /** Constructs action passing @a pParent to the base-class. */
2883 UIActionMenuManagerNetworkPerformRemove(UIActionPool *pParent)
2884 : UIActionSimple(pParent,
2885 ":/host_iface_remove_32px.png", ":/host_iface_remove_16px.png",
2886 ":/host_iface_remove_disabled_32px.png", ":/host_iface_remove_disabled_16px.png")
2887 {
2888 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2889 }
2890
2891protected:
2892
2893 /** Returns shortcut extra-data ID. */
2894 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2895 {
2896 return QString("RemoveNetwork");
2897 }
2898
2899 /** Returns default shortcut. */
2900 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
2901 {
2902 return QKeySequence("Ctrl+Shift+R");
2903 }
2904
2905 /** Handles translation event. */
2906 virtual void retranslateUi() RT_OVERRIDE
2907 {
2908 setName(QApplication::translate("UIActionPool", "&Remove..."));
2909 setShortcutScope(QApplication::translate("UIActionPool", "Network Manager"));
2910 setStatusTip(QApplication::translate("UIActionPool", "Remove selected host-only network"));
2911 setToolTip( QApplication::translate("UIActionPool", "Remove Host-only Network")
2912 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2913 }
2914};
2915
2916/** Toggle action extension, used as 'Toggle Network Properties' action class. */
2917class UIActionMenuManagerNetworkToggleProperties : public UIActionToggle
2918{
2919 Q_OBJECT;
2920
2921public:
2922
2923 /** Constructs action passing @a pParent to the base-class. */
2924 UIActionMenuManagerNetworkToggleProperties(UIActionPool *pParent)
2925 : UIActionToggle(pParent)
2926 {
2927 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2928 /// @todo use icons with check-boxes
2929 setIcon(UIIconPool::iconSetFull(":/host_iface_edit_32px.png", ":/host_iface_edit_16px.png",
2930 ":/host_iface_edit_disabled_32px.png", ":/host_iface_edit_disabled_16px.png"));
2931 }
2932
2933protected:
2934
2935 /** Returns shortcut extra-data ID. */
2936 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2937 {
2938 return QString("ToggleNetworkProperties");
2939 }
2940
2941 /** Returns default shortcut. */
2942 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
2943 {
2944 return QKeySequence("Ctrl+Shift+P");
2945 }
2946
2947 /** Handles translation event. */
2948 virtual void retranslateUi() RT_OVERRIDE
2949 {
2950 setName(QApplication::translate("UIActionPool", "&Properties"));
2951 setShortcutScope(QApplication::translate("UIActionPool", "Network Manager"));
2952 setStatusTip(QApplication::translate("UIActionPool", "Open pane with selected host-only network properties"));
2953 setToolTip( QApplication::translate("UIActionPool", "Open Host-only Network Properties")
2954 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2955 }
2956};
2957
2958/** Simple action extension, used as 'Perform Refresh' action class. */
2959class UIActionMenuManagerNetworkPerformRefresh : public UIActionSimple
2960{
2961 Q_OBJECT;
2962
2963public:
2964
2965 /** Constructs action passing @a pParent to the base-class. */
2966 UIActionMenuManagerNetworkPerformRefresh(UIActionPool *pParent)
2967 : UIActionSimple(pParent,
2968 ":/refresh_32px.png", ":/refresh_16px.png",
2969 ":/refresh_disabled_32px.png", ":/refresh_disabled_16px.png")
2970 {
2971 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2972 }
2973
2974protected:
2975
2976 /** Returns shortcut extra-data ID. */
2977 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2978 {
2979 return QString("RefreshNetworks");
2980 }
2981
2982 /** Returns default shortcut. */
2983 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
2984 {
2985 return QKeySequence("Ctrl+Shift+F");
2986 }
2987
2988 /** Returns standard shortcut. */
2989 virtual QKeySequence standardShortcut(UIActionPoolType) const RT_OVERRIDE
2990 {
2991 return actionPool()->isTemporary() ? QKeySequence() : QKeySequence(QKeySequence::Refresh);
2992 }
2993
2994 /** Handles translation event. */
2995 virtual void retranslateUi() RT_OVERRIDE
2996 {
2997 setName(QApplication::translate("UIActionPool", "Re&fresh..."));
2998 setShortcutScope(QApplication::translate("UIActionPool", "Network Manager"));
2999 setStatusTip(QApplication::translate("UIActionPool", "Refresh the list of host-only networks"));
3000 setToolTip( QApplication::translate("UIActionPool", "Refresh Host-only Networks")
3001 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
3002 }
3003};
3004
3005
3006/** Menu action extension, used as 'Cloud' menu class. */
3007class UIActionMenuManagerCloud : public UIActionMenu
3008{
3009 Q_OBJECT;
3010
3011public:
3012
3013 /** Constructs action passing @a pParent to the base-class. */
3014 UIActionMenuManagerCloud(UIActionPool *pParent)
3015 : UIActionMenu(pParent)
3016 {}
3017
3018protected:
3019
3020 /** Returns shortcut extra-data ID. */
3021 virtual QString shortcutExtraDataID() const RT_OVERRIDE
3022 {
3023 return QString("CloudProfileMenu");
3024 }
3025
3026 /** Handles translation event. */
3027 virtual void retranslateUi() RT_OVERRIDE
3028 {
3029 setName(QApplication::translate("UIActionPool", "&Cloud"));
3030 }
3031};
3032
3033/** Simple action extension, used as 'Perform Add' action class. */
3034class UIActionMenuManagerCloudPerformAdd : public UIActionSimple
3035{
3036 Q_OBJECT;
3037
3038public:
3039
3040 /** Constructs action passing @a pParent to the base-class. */
3041 UIActionMenuManagerCloudPerformAdd(UIActionPool *pParent)
3042 : UIActionSimple(pParent,
3043 ":/cloud_profile_add_32px.png", ":/cloud_profile_add_16px.png",
3044 ":/cloud_profile_add_disabled_32px.png", ":/cloud_profile_add_disabled_16px.png")
3045 {
3046 setShortcutContext(Qt::WidgetWithChildrenShortcut);
3047 }
3048
3049protected:
3050
3051 /** Returns shortcut extra-data ID. */
3052 virtual QString shortcutExtraDataID() const RT_OVERRIDE
3053 {
3054 return QString("AddCloudProfile");
3055 }
3056
3057 /** Returns default shortcut. */
3058 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
3059 {
3060 return QKeySequence("Ctrl+Shift+A");
3061 }
3062
3063 /** Handles translation event. */
3064 virtual void retranslateUi() RT_OVERRIDE
3065 {
3066 setIconText(QApplication::translate("UIActionPool", "Add"));
3067 setName(QApplication::translate("UIActionPool", "&Add Profile..."));
3068 setShortcutScope(QApplication::translate("UIActionPool", "Cloud Profile Manager"));
3069 setStatusTip(QApplication::translate("UIActionPool", "Add new cloud profile"));
3070 setToolTip( QApplication::translate("UIActionPool", "Add Cloud Profile")
3071 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
3072 }
3073};
3074
3075/** Simple action extension, used as 'Perform Import' action class. */
3076class UIActionMenuManagerCloudPerformImport : public UIActionSimple
3077{
3078 Q_OBJECT;
3079
3080public:
3081
3082 /** Constructs action passing @a pParent to the base-class. */
3083 UIActionMenuManagerCloudPerformImport(UIActionPool *pParent)
3084 : UIActionSimple(pParent,
3085 ":/cloud_profile_restore_32px.png", ":/cloud_profile_restore_16px.png",
3086 ":/cloud_profile_restore_disabled_32px.png", ":/cloud_profile_restore_disabled_16px.png")
3087 {
3088 setShortcutContext(Qt::WidgetWithChildrenShortcut);
3089 }
3090
3091protected:
3092
3093 /** Returns shortcut extra-data ID. */
3094 virtual QString shortcutExtraDataID() const RT_OVERRIDE
3095 {
3096 return QString("ImportCloudProfiles");
3097 }
3098
3099 /** Returns default shortcut. */
3100 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
3101 {
3102 return QKeySequence("Ctrl+Shift+I");
3103 }
3104
3105 /** Handles translation event. */
3106 virtual void retranslateUi() RT_OVERRIDE
3107 {
3108 setIconText(QApplication::translate("UIActionPool", "Import"));
3109 setName(QApplication::translate("UIActionPool", "&Import Profiles..."));
3110 setShortcutScope(QApplication::translate("UIActionPool", "Cloud Profile Manager"));
3111 setStatusTip(QApplication::translate("UIActionPool", "Import the list of cloud profiles from external files"));
3112 setToolTip( QApplication::translate("UIActionPool", "Import Cloud Profiles")
3113 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
3114 }
3115};
3116
3117/** Simple action extension, used as 'Perform Remove' action class. */
3118class UIActionMenuManagerCloudPerformRemove : public UIActionSimple
3119{
3120 Q_OBJECT;
3121
3122public:
3123
3124 /** Constructs action passing @a pParent to the base-class. */
3125 UIActionMenuManagerCloudPerformRemove(UIActionPool *pParent)
3126 : UIActionSimple(pParent,
3127 ":/cloud_profile_remove_32px.png", ":/cloud_profile_remove_16px.png",
3128 ":/cloud_profile_remove_disabled_32px.png", ":/cloud_profile_remove_disabled_16px.png")
3129 {
3130 setShortcutContext(Qt::WidgetWithChildrenShortcut);
3131 }
3132
3133protected:
3134
3135 /** Returns shortcut extra-data ID. */
3136 virtual QString shortcutExtraDataID() const RT_OVERRIDE
3137 {
3138 return QString("RemoveCloudProfile");
3139 }
3140
3141 /** Returns default shortcut. */
3142 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
3143 {
3144 return QKeySequence("Ctrl+Shift+R");
3145 }
3146
3147 /** Handles translation event. */
3148 virtual void retranslateUi() RT_OVERRIDE
3149 {
3150 setIconText(QApplication::translate("UIActionPool", "Remove"));
3151 setName(QApplication::translate("UIActionPool", "&Remove Profile..."));
3152 setShortcutScope(QApplication::translate("UIActionPool", "Cloud Profile Manager"));
3153 setStatusTip(QApplication::translate("UIActionPool", "Remove selected cloud profile"));
3154 setToolTip( QApplication::translate("UIActionPool", "Remove Cloud Profile")
3155 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
3156 }
3157};
3158
3159/** Toggle action extension, used as 'Toggle Properties' action class. */
3160class UIActionMenuManagerCloudToggleProperties : public UIActionToggle
3161{
3162 Q_OBJECT;
3163
3164public:
3165
3166 /** Constructs action passing @a pParent to the base-class. */
3167 UIActionMenuManagerCloudToggleProperties(UIActionPool *pParent)
3168 : UIActionToggle(pParent)
3169 {
3170 setShortcutContext(Qt::WidgetWithChildrenShortcut);
3171 /// @todo use icons with check-boxes
3172 setIcon(UIIconPool::iconSetFull(":/cloud_profile_edit_32px.png", ":/cloud_profile_edit_16px.png",
3173 ":/cloud_profile_edit_disabled_32px.png", ":/cloud_profile_edit_disabled_16px.png"));
3174 }
3175
3176protected:
3177
3178 /** Returns shortcut extra-data ID. */
3179 virtual QString shortcutExtraDataID() const RT_OVERRIDE
3180 {
3181 return QString("ToggleCloudProfileProperties");
3182 }
3183
3184 /** Returns default shortcut. */
3185 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
3186 {
3187 return QKeySequence("Ctrl+Shift+P");
3188 }
3189
3190 /** Handles translation event. */
3191 virtual void retranslateUi() RT_OVERRIDE
3192 {
3193 setIconText(QApplication::translate("UIActionPool", "Properties"));
3194 setName(QApplication::translate("UIActionPool", "Profile &Properties"));
3195 setShortcutScope(QApplication::translate("UIActionPool", "Cloud Profile Manager"));
3196 setStatusTip(QApplication::translate("UIActionPool", "Open pane with selected cloud profile properties"));
3197 setToolTip( QApplication::translate("UIActionPool", "Open Cloud Profile Properties")
3198 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
3199 }
3200};
3201
3202/** Simple action extension, used as 'Try Page' action class. */
3203class UIActionMenuManagerCloudShowTryPage : public UIActionSimple
3204{
3205 Q_OBJECT;
3206
3207public:
3208
3209 /** Constructs action passing @a pParent to the base-class. */
3210 UIActionMenuManagerCloudShowTryPage(UIActionPool *pParent)
3211 : UIActionSimple(pParent,
3212 ":/cloud_profile_try_32px.png", ":/cloud_profile_try_16px.png",
3213 ":/cloud_profile_try_disabled_32px.png", ":/cloud_profile_try_disabled_16px.png")
3214 {
3215 setShortcutContext(Qt::WidgetWithChildrenShortcut);
3216 }
3217
3218protected:
3219
3220 /** Returns shortcut extra-data ID. */
3221 virtual QString shortcutExtraDataID() const RT_OVERRIDE
3222 {
3223 return QString("ShowCloudProfileTryPage");
3224 }
3225
3226 /** Returns default shortcut. */
3227 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
3228 {
3229 return QKeySequence("Ctrl+Shift+T");
3230 }
3231
3232 /** Handles translation event. */
3233 virtual void retranslateUi() RT_OVERRIDE
3234 {
3235 setIconText(QApplication::translate("UIActionPool", "Try"));
3236 setName(QApplication::translate("UIActionPool", "&Try Oracle Cloud for Free..."));
3237 setShortcutScope(QApplication::translate("UIActionPool", "Cloud Profile Manager"));
3238 setStatusTip(QApplication::translate("UIActionPool", "Try Oracle cloud for free"));
3239 setToolTip( QApplication::translate("UIActionPool", "Try Oracle Cloud for Free")
3240 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
3241 }
3242};
3243
3244/** Simple action extension, used as 'Show Help' action class. */
3245class UIActionMenuManagerCloudShowHelp : public UIActionSimple
3246{
3247 Q_OBJECT;
3248
3249public:
3250
3251 /** Constructs action passing @a pParent to the base-class. */
3252 UIActionMenuManagerCloudShowHelp(UIActionPool *pParent)
3253 : UIActionSimple(pParent,
3254 ":/cloud_profile_help_32px.png", ":/cloud_profile_help_16px.png",
3255 ":/cloud_profile_help_disabled_32px.png", ":/cloud_profile_help_disabled_16px.png")
3256 {
3257 setShortcutContext(Qt::WidgetWithChildrenShortcut);
3258 }
3259
3260protected:
3261
3262 /** Returns shortcut extra-data ID. */
3263 virtual QString shortcutExtraDataID() const RT_OVERRIDE
3264 {
3265 return QString("ShowCloudProfileHelp");
3266 }
3267
3268 /** Returns default shortcut. */
3269 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
3270 {
3271 return QKeySequence("Ctrl+Shift+H");
3272 }
3273
3274 /** Returns standard shortcut. */
3275 virtual QKeySequence standardShortcut(UIActionPoolType) const RT_OVERRIDE
3276 {
3277 return actionPool()->isTemporary() ? QKeySequence() : QKeySequence(QKeySequence::HelpContents);
3278 }
3279
3280 /** Handles translation event. */
3281 virtual void retranslateUi() RT_OVERRIDE
3282 {
3283 setIconText(QApplication::translate("UIActionPool", "Help"));
3284 setName(QApplication::translate("UIActionPool", "&Show Help..."));
3285 setShortcutScope(QApplication::translate("UIActionPool", "Cloud Profile Manager"));
3286 setStatusTip(QApplication::translate("UIActionPool", "Show cloud profile help"));
3287 setToolTip( QApplication::translate("UIActionPool", "Show Cloud Profile Help")
3288 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
3289 }
3290};
3291
3292
3293/** Menu action extension, used as 'Cloud Console' menu class. */
3294class UIActionMenuManagerCloudConsole : public UIActionMenu
3295{
3296 Q_OBJECT;
3297
3298public:
3299
3300 /** Constructs action passing @a pParent to the base-class. */
3301 UIActionMenuManagerCloudConsole(UIActionPool *pParent)
3302 : UIActionMenu(pParent)
3303 {}
3304
3305protected:
3306
3307 /** Returns shortcut extra-data ID. */
3308 virtual QString shortcutExtraDataID() const RT_OVERRIDE
3309 {
3310 return QString("CloudConsoleMenu");
3311 }
3312
3313 /** Handles translation event. */
3314 virtual void retranslateUi() RT_OVERRIDE
3315 {
3316 setName(QApplication::translate("UIActionPool", "&Console"));
3317 }
3318};
3319
3320/** Simple action extension, used as 'Perform Console Application Add' action class. */
3321class UIActionMenuManagerCloudConsolePerformApplicationAdd : public UIActionSimple
3322{
3323 Q_OBJECT;
3324
3325public:
3326
3327 /** Constructs action passing @a pParent to the base-class. */
3328 UIActionMenuManagerCloudConsolePerformApplicationAdd(UIActionPool *pParent)
3329 : UIActionSimple(pParent,
3330 ":/cloud_console_application_add_32px.png", ":/cloud_console_application_add_16px.png",
3331 ":/cloud_console_application_add_disabled_32px.png", ":/cloud_console_application_add_disabled_16px.png")
3332 {
3333 setShortcutContext(Qt::WidgetWithChildrenShortcut);
3334 }
3335
3336protected:
3337
3338 /** Returns shortcut extra-data ID. */
3339 virtual QString shortcutExtraDataID() const RT_OVERRIDE
3340 {
3341 return QString("AddCloudConsoleApplication");
3342 }
3343
3344 /** Handles translation event. */
3345 virtual void retranslateUi() RT_OVERRIDE
3346 {
3347 setName(QApplication::translate("UIActionPool", "&Add Application..."));
3348 setShortcutScope(QApplication::translate("UIActionPool", "Cloud Console Manager"));
3349 setStatusTip(QApplication::translate("UIActionPool", "Add new cloud console application"));
3350 setToolTip( QApplication::translate("UIActionPool", "Add Cloud Console Application")
3351 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
3352 }
3353};
3354
3355/** Simple action extension, used as 'Perform Console Application Remove' action class. */
3356class UIActionMenuManagerCloudConsolePerformApplicationRemove : public UIActionSimple
3357{
3358 Q_OBJECT;
3359
3360public:
3361
3362 /** Constructs action passing @a pParent to the base-class. */
3363 UIActionMenuManagerCloudConsolePerformApplicationRemove(UIActionPool *pParent)
3364 : UIActionSimple(pParent,
3365 ":/cloud_console_application_remove_32px.png", ":/cloud_console_application_remove_16px.png",
3366 ":/cloud_console_application_remove_disabled_32px.png", ":/cloud_console_application_remove_disabled_16px.png")
3367 {
3368 setShortcutContext(Qt::WidgetWithChildrenShortcut);
3369 }
3370
3371protected:
3372
3373 /** Returns shortcut extra-data ID. */
3374 virtual QString shortcutExtraDataID() const RT_OVERRIDE
3375 {
3376 return QString("RemoveCloudConsoleApplication");
3377 }
3378
3379 /** Handles translation event. */
3380 virtual void retranslateUi() RT_OVERRIDE
3381 {
3382 setName(QApplication::translate("UIActionPool", "&Remove Application..."));
3383 setShortcutScope(QApplication::translate("UIActionPool", "Cloud Console Manager"));
3384 setStatusTip(QApplication::translate("UIActionPool", "Remove selected cloud console application"));
3385 setToolTip( QApplication::translate("UIActionPool", "Remove Cloud Console Application")
3386 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
3387 }
3388};
3389
3390/** Simple action extension, used as 'Perform Console Profile Add' action class. */
3391class UIActionMenuManagerCloudConsolePerformProfileAdd : public UIActionSimple
3392{
3393 Q_OBJECT;
3394
3395public:
3396
3397 /** Constructs action passing @a pParent to the base-class. */
3398 UIActionMenuManagerCloudConsolePerformProfileAdd(UIActionPool *pParent)
3399 : UIActionSimple(pParent,
3400 ":/cloud_console_profile_add_32px.png", ":/cloud_console_profile_add_16px.png",
3401 ":/cloud_console_profile_add_disabled_32px.png", ":/cloud_console_profile_add_disabled_16px.png")
3402 {
3403 setShortcutContext(Qt::WidgetWithChildrenShortcut);
3404 }
3405
3406protected:
3407
3408 /** Returns shortcut extra-data ID. */
3409 virtual QString shortcutExtraDataID() const RT_OVERRIDE
3410 {
3411 return QString("AddCloudConsoleProfile");
3412 }
3413
3414 /** Handles translation event. */
3415 virtual void retranslateUi() RT_OVERRIDE
3416 {
3417 setName(QApplication::translate("UIActionPool", "&Add Profile..."));
3418 setShortcutScope(QApplication::translate("UIActionPool", "Cloud Console Manager"));
3419 setStatusTip(QApplication::translate("UIActionPool", "Add new cloud console profile"));
3420 setToolTip( QApplication::translate("UIActionPool", "Add Cloud Console Profile")
3421 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
3422 }
3423};
3424
3425/** Simple action extension, used as 'Perform Console Profile Remove' action class. */
3426class UIActionMenuManagerCloudConsolePerformProfileRemove : public UIActionSimple
3427{
3428 Q_OBJECT;
3429
3430public:
3431
3432 /** Constructs action passing @a pParent to the base-class. */
3433 UIActionMenuManagerCloudConsolePerformProfileRemove(UIActionPool *pParent)
3434 : UIActionSimple(pParent,
3435 ":/cloud_console_profile_remove_32px.png", ":/cloud_console_profile_remove_16px.png",
3436 ":/cloud_console_profile_remove_disabled_32px.png", ":/cloud_console_profile_remove_disabled_16px.png")
3437 {
3438 setShortcutContext(Qt::WidgetWithChildrenShortcut);
3439 }
3440
3441protected:
3442
3443 /** Returns shortcut extra-data ID. */
3444 virtual QString shortcutExtraDataID() const RT_OVERRIDE
3445 {
3446 return QString("RemoveCloudConsoleProfile");
3447 }
3448
3449 /** Handles translation event. */
3450 virtual void retranslateUi() RT_OVERRIDE
3451 {
3452 setName(QApplication::translate("UIActionPool", "&Remove Profile..."));
3453 setShortcutScope(QApplication::translate("UIActionPool", "Cloud Console Manager"));
3454 setStatusTip(QApplication::translate("UIActionPool", "Remove selected cloud console profile"));
3455 setToolTip( QApplication::translate("UIActionPool", "Remove Cloud Console Profile")
3456 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
3457 }
3458};
3459
3460/** Toggle action extension, used as 'Toggle Cloud Console Properties' action class. */
3461class UIActionMenuManagerCloudConsoleToggleProperties : public UIActionToggle
3462{
3463 Q_OBJECT;
3464
3465public:
3466
3467 /** Constructs action passing @a pParent to the base-class. */
3468 UIActionMenuManagerCloudConsoleToggleProperties(UIActionPool *pParent)
3469 : UIActionToggle(pParent)
3470 {
3471 setShortcutContext(Qt::WidgetWithChildrenShortcut);
3472 /// @todo use icons with check-boxes
3473 setIcon(UIIconPool::iconSetFull(":/cloud_console_edit_32px.png", ":/cloud_console_edit_16px.png",
3474 ":/cloud_console_edit_disabled_32px.png", ":/cloud_console_edit_disabled_16px.png"));
3475 }
3476
3477protected:
3478
3479 /** Returns shortcut extra-data ID. */
3480 virtual QString shortcutExtraDataID() const RT_OVERRIDE
3481 {
3482 return QString("ToggleCloudConsoleProperties");
3483 }
3484
3485 /** Returns default shortcut. */
3486 virtual QKeySequence defaultShortcut(UIActionPoolType) const RT_OVERRIDE
3487 {
3488 return QKeySequence("Ctrl+Shift+P");
3489 }
3490
3491 /** Handles translation event. */
3492 virtual void retranslateUi() RT_OVERRIDE
3493 {
3494 setIconText(QApplication::translate("UIActionPool", "Properties"));
3495 setName(QApplication::translate("UIActionPool", "Console &Properties"));
3496 setShortcutScope(QApplication::translate("UIActionPool", "Cloud Console Manager"));
3497 setStatusTip(QApplication::translate("UIActionPool", "Open pane with selected cloud console properties"));
3498 setToolTip( QApplication::translate("UIActionPool", "Open Cloud Console Properties")
3499 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
3500 }
3501};
3502
3503
3504/** Menu action extension, used as 'Resources' menu class. */
3505class UIActionMenuVMActivityOverview : public UIActionMenu
3506{
3507 Q_OBJECT;
3508
3509public:
3510
3511 /** Constructs action passing @a pParent to the base-class. */
3512 UIActionMenuVMActivityOverview(UIActionPool *pParent)
3513 : UIActionMenu(pParent)
3514 {}
3515
3516protected:
3517
3518 /** Returns shortcut extra-data ID. */
3519 virtual QString shortcutExtraDataID() const RT_OVERRIDE
3520 {
3521 return QString("VMActivityOverviewMenu");
3522 }
3523
3524 /** Handles translation event. */
3525 virtual void retranslateUi() RT_OVERRIDE
3526 {
3527 setName(QApplication::translate("UIActionPool", "&Resources"));
3528 }
3529};
3530
3531/** Menu action extension, used as 'Columns' menu class. */
3532class UIActionMenuManagerVMActivityOverviewColumns : public UIActionMenu
3533{
3534 Q_OBJECT;
3535
3536public:
3537
3538 /** Constructs action passing @a pParent to the base-class. */
3539 UIActionMenuManagerVMActivityOverviewColumns(UIActionPool *pParent)
3540 : UIActionMenu(pParent,
3541 ":/resources_monitor_columns_32px.png", ":/resources_monitor_columns_16px.png",
3542 ":/resources_monitor_columns_disabled_32px.png", ":/resources_monitor_columns_disabled_16px.png")
3543 {
3544 setShortcutContext(Qt::WidgetWithChildrenShortcut);
3545 }
3546
3547protected:
3548
3549 /** Returns shortcut extra-data ID. */
3550 virtual QString shortcutExtraDataID() const RT_OVERRIDE
3551 {
3552 return QString("VMActivityOverviewColumns");
3553 }
3554
3555 /** Handles translation event. */
3556 virtual void retranslateUi() RT_OVERRIDE
3557 {
3558 setName(QApplication::translate("UIActionPool", "Columns"));
3559 setShortcutScope(QApplication::translate("UIActionPool", "VM Activity Overview"));
3560 setStatusTip(QApplication::translate("UIActionPool", "Show/Hide Columns"));
3561 setToolTip( QApplication::translate("UIActionPool", "Show/Hide Columns")
3562 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
3563 }
3564};
3565
3566/** Simple action extension, used as 'Switch to Machine Activity' action class. */
3567class UIActionMenuManagerVMActivityOverviewSwitchToMachineActivity : public UIActionSimple
3568{
3569 Q_OBJECT;
3570
3571public:
3572
3573 /** Constructs action passing @a pParent to the base-class. */
3574 UIActionMenuManagerVMActivityOverviewSwitchToMachineActivity(UIActionPool *pParent)
3575 : UIActionSimple(pParent,
3576 ":/resources_monitor_jump_to_vm_32px.png", ":/resources_monitor_jump_to_vm_16px.png",
3577 ":/resources_monitor_jump_to_vm_disabled_32px.png", ":/resources_monitor_jump_to_vm_disabled_16px.png")
3578 {
3579 setShortcutContext(Qt::WidgetWithChildrenShortcut);
3580 }
3581
3582protected:
3583
3584 /** Returns shortcut extra-data ID. */
3585 virtual QString shortcutExtraDataID() const RT_OVERRIDE
3586 {
3587 return QString("VMActivityOverviewSwitchToMachineActivity");
3588 }
3589
3590 /** Handles translation event. */
3591 virtual void retranslateUi() RT_OVERRIDE
3592 {
3593 setName(QApplication::translate("UIActionPool", "VM Activity"));
3594 setShortcutScope(QApplication::translate("UIActionPool", "VM Activity Overview"));
3595 setStatusTip(QApplication::translate("UIActionPool", "Switch to selected virtual machine's activity monitor pane"));
3596 setToolTip( QApplication::translate("UIActionPool", "Switch to selected virtual machine's activity monitor pane")
3597 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
3598 }
3599};
3600
3601
3602/*********************************************************************************************************************************
3603* Class UIActionPoolManager implementation. *
3604*********************************************************************************************************************************/
3605
3606UIActionPoolManager::UIActionPoolManager(bool fTemporary /* = false */)
3607 : UIActionPool(UIActionPoolType_Manager, fTemporary)
3608{
3609}
3610
3611void UIActionPoolManager::preparePool()
3612{
3613 /* 'File' actions: */
3614 m_pool[UIActionIndexMN_M_File] = new UIActionMenuManagerFile(this);
3615 m_pool[UIActionIndexMN_M_File_S_ImportAppliance] = new UIActionSimpleManagerFileShowImportApplianceWizard(this);
3616 m_pool[UIActionIndexMN_M_File_S_ExportAppliance] = new UIActionSimpleManagerFileShowExportApplianceWizard(this);
3617 m_pool[UIActionIndexMN_M_File_M_Tools] = new UIActionMenuManagerToolsGlobal(this);
3618 m_pool[UIActionIndexMN_M_File_M_Tools_T_WelcomeScreen] = new UIActionToggleManagerToolsGlobalShowWelcomeScreen(this);
3619 m_pool[UIActionIndexMN_M_File_M_Tools_T_ExtensionPackManager] = new UIActionToggleManagerToolsGlobalShowExtensionPackManager(this);
3620 m_pool[UIActionIndexMN_M_File_M_Tools_T_VirtualMediaManager] = new UIActionToggleManagerToolsGlobalShowVirtualMediaManager(this);
3621 m_pool[UIActionIndexMN_M_File_M_Tools_T_NetworkManager] = new UIActionToggleManagerToolsGlobalShowNetworkManager(this);
3622 m_pool[UIActionIndexMN_M_File_M_Tools_T_CloudProfileManager] = new UIActionToggleManagerToolsGlobalShowCloudProfileManager(this);
3623 m_pool[UIActionIndexMN_M_File_M_Tools_T_VMActivityOverview] = new UIActionToggleManagerToolsGlobalShowVMActivityOverview(this);
3624#ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
3625 m_pool[UIActionIndexMN_M_File_S_ShowExtraDataManager] = new UIActionSimpleManagerFileShowExtraDataManager(this);
3626#endif
3627 m_pool[UIActionIndexMN_M_File_S_Close] = new UIActionSimpleManagerFilePerformExit(this);
3628
3629 /* 'Welcome' actions: */
3630 m_pool[UIActionIndexMN_M_Welcome] = new UIActionMenuManagerMachine(this);
3631 m_pool[UIActionIndexMN_M_Welcome_S_New] = new UIActionSimpleManagerMachinePerformCreate(this);
3632 m_pool[UIActionIndexMN_M_Welcome_S_Add] = new UIActionSimpleManagerMachinePerformAdd(this);
3633
3634 /* 'Group' actions: */
3635 m_pool[UIActionIndexMN_M_Group] = new UIActionMenuManagerGroup(this);
3636 m_pool[UIActionIndexMN_M_Group_S_New] = new UIActionSimpleManagerGroupPerformCreateMachine(this);
3637 m_pool[UIActionIndexMN_M_Group_S_Add] = new UIActionSimpleManagerGroupPerformAddMachine(this);
3638 m_pool[UIActionIndexMN_M_Group_S_Rename] = new UIActionSimpleManagerGroupPerformRename(this);
3639 m_pool[UIActionIndexMN_M_Group_S_Remove] = new UIActionSimpleManagerGroupPerformRemove(this);
3640 m_pool[UIActionIndexMN_M_Group_M_MoveToGroup] = new UIActionMenuManagerCommonMoveToGroup(this);
3641 m_pool[UIActionIndexMN_M_Group_M_StartOrShow] = new UIActionStateManagerCommonStartOrShow(this);
3642 m_pool[UIActionIndexMN_M_Group_M_StartOrShow_S_StartNormal] = new UIActionSimpleManagerCommonPerformStartNormal(this);
3643 m_pool[UIActionIndexMN_M_Group_M_StartOrShow_S_StartHeadless] = new UIActionSimpleManagerCommonPerformStartHeadless(this);
3644 m_pool[UIActionIndexMN_M_Group_M_StartOrShow_S_StartDetachable] = new UIActionSimpleManagerCommonPerformStartDetachable(this);
3645 m_pool[UIActionIndexMN_M_Group_T_Pause] = new UIActionToggleManagerCommonPauseAndResume(this);
3646 m_pool[UIActionIndexMN_M_Group_S_Reset] = new UIActionSimpleManagerCommonPerformReset(this);
3647 m_pool[UIActionIndexMN_M_Group_S_Detach] = new UIActionSimpleManagerCommonPerformDetach(this);
3648 m_pool[UIActionIndexMN_M_Group_M_Console] = new UIActionMenuManagerConsole(this);
3649 m_pool[UIActionIndexMN_M_Group_M_Console_S_CreateConnection] = new UIActionSimpleManagerConsolePerformCreateConnection(this);
3650 m_pool[UIActionIndexMN_M_Group_M_Console_S_DeleteConnection] = new UIActionSimpleManagerConsolePerformDeleteConnection(this);
3651 m_pool[UIActionIndexMN_M_Group_M_Console_S_ConfigureApplications] = new UIActionSimpleManagerConsolePerformConfigureApplications(this);
3652 m_pool[UIActionIndexMN_M_Group_M_Stop] = new UIActionMenuManagerStop(this);
3653 m_pool[UIActionIndexMN_M_Group_M_Stop_S_SaveState] = new UIActionSimpleManagerStopPerformSave(this);
3654 m_pool[UIActionIndexMN_M_Group_M_Stop_S_Terminate] = new UIActionSimpleManagerStopPerformTerminate(this);
3655 m_pool[UIActionIndexMN_M_Group_M_Stop_S_Shutdown] = new UIActionSimpleManagerStopPerformShutdown(this);
3656 m_pool[UIActionIndexMN_M_Group_M_Stop_S_PowerOff] = new UIActionSimpleManagerStopPerformPowerOff(this);
3657 m_pool[UIActionIndexMN_M_Group_M_Tools] = new UIActionMenuManagerToolsMachine(this);
3658 m_pool[UIActionIndexMN_M_Group_M_Tools_T_Details] = new UIActionToggleManagerToolsMachineShowDetails(this);
3659 m_pool[UIActionIndexMN_M_Group_M_Tools_T_Snapshots] = new UIActionToggleManagerToolsMachineShowSnapshots(this);
3660 m_pool[UIActionIndexMN_M_Group_M_Tools_T_Logs] = new UIActionToggleManagerToolsMachineShowLogs(this);
3661 m_pool[UIActionIndexMN_M_Group_M_Tools_T_Activity] = new UIActionToggleManagerToolsMachineShowActivity(this);
3662 m_pool[UIActionIndexMN_M_Group_M_Tools_T_FileManager] = new UIActionToggleManagerToolsMachineShowFileManager(this);
3663 m_pool[UIActionIndexMN_M_Group_S_Discard] = new UIActionSimpleManagerCommonPerformDiscard(this);
3664 m_pool[UIActionIndexMN_M_Group_S_ShowLogDialog] = new UIActionSimpleManagerCommonShowMachineLogs(this);
3665 m_pool[UIActionIndexMN_M_Group_S_ShowLogDialog] = new UIActionSimpleManagerCommonShowMachineLogs(this);
3666 m_pool[UIActionIndexMN_M_Group_S_Refresh] = new UIActionSimpleManagerCommonPerformRefresh(this);
3667 m_pool[UIActionIndexMN_M_Group_S_ShowInFileManager] = new UIActionSimpleManagerCommonShowInFileManager(this);
3668 m_pool[UIActionIndexMN_M_Group_S_CreateShortcut] = new UIActionSimpleManagerCommonPerformCreateShortcut(this);
3669 m_pool[UIActionIndexMN_M_Group_S_Sort] = new UIActionSimpleManagerGroupPerformSort(this);
3670 m_pool[UIActionIndexMN_M_Group_T_Search] = new UIActionToggleManagerCommonToggleSearch(this);
3671
3672 /* 'Machine' actions: */
3673 m_pool[UIActionIndexMN_M_Machine] = new UIActionMenuManagerMachine(this);
3674 m_pool[UIActionIndexMN_M_Machine_S_New] = new UIActionSimpleManagerMachinePerformCreate(this);
3675 m_pool[UIActionIndexMN_M_Machine_S_Add] = new UIActionSimpleManagerMachinePerformAdd(this);
3676 m_pool[UIActionIndexMN_M_Machine_S_Settings] = new UIActionSimpleManagerMachineShowSettings(this);
3677 m_pool[UIActionIndexMN_M_Machine_S_Clone] = new UIActionSimpleManagerMachinePerformClone(this);
3678 m_pool[UIActionIndexMN_M_Machine_S_Move] = new UIActionSimpleManagerMachinePerformMove(this);
3679 m_pool[UIActionIndexMN_M_Machine_S_ExportToOCI] = new UIActionSimpleManagerMachinePerformExportToOCI(this);
3680 m_pool[UIActionIndexMN_M_Machine_S_Remove] = new UIActionSimpleManagerMachinePerformRemove(this);
3681 m_pool[UIActionIndexMN_M_Machine_M_MoveToGroup] = new UIActionMenuManagerCommonMoveToGroup(this);
3682 m_pool[UIActionIndexMN_M_Machine_M_MoveToGroup_S_New] = new UIActionSimpleManagerMachineMoveToGroupNew(this);
3683 m_pool[UIActionIndexMN_M_Machine_M_StartOrShow] = new UIActionStateManagerCommonStartOrShow(this);
3684 m_pool[UIActionIndexMN_M_Machine_M_StartOrShow_S_StartNormal] = new UIActionSimpleManagerCommonPerformStartNormal(this);
3685 m_pool[UIActionIndexMN_M_Machine_M_StartOrShow_S_StartHeadless] = new UIActionSimpleManagerCommonPerformStartHeadless(this);
3686 m_pool[UIActionIndexMN_M_Machine_M_StartOrShow_S_StartDetachable] = new UIActionSimpleManagerCommonPerformStartDetachable(this);
3687 m_pool[UIActionIndexMN_M_Machine_T_Pause] = new UIActionToggleManagerCommonPauseAndResume(this);
3688 m_pool[UIActionIndexMN_M_Machine_S_Reset] = new UIActionSimpleManagerCommonPerformReset(this);
3689 m_pool[UIActionIndexMN_M_Machine_S_Detach] = new UIActionSimpleManagerCommonPerformDetach(this);
3690 m_pool[UIActionIndexMN_M_Machine_M_Console] = new UIActionMenuManagerConsole(this);
3691 m_pool[UIActionIndexMN_M_Machine_M_Console_S_CreateConnection] = new UIActionSimpleManagerConsolePerformCreateConnection(this);
3692 m_pool[UIActionIndexMN_M_Machine_M_Console_S_DeleteConnection] = new UIActionSimpleManagerConsolePerformDeleteConnection(this);
3693 m_pool[UIActionIndexMN_M_Machine_M_Console_S_CopyCommandSerialUnix] = new UIActionSimpleManagerConsolePerformCopyCommand(this, true, true);
3694 m_pool[UIActionIndexMN_M_Machine_M_Console_S_CopyCommandSerialWindows] = new UIActionSimpleManagerConsolePerformCopyCommand(this, true, false);
3695 m_pool[UIActionIndexMN_M_Machine_M_Console_S_CopyCommandVNCUnix] = new UIActionSimpleManagerConsolePerformCopyCommand(this, false, true);
3696 m_pool[UIActionIndexMN_M_Machine_M_Console_S_CopyCommandVNCWindows] = new UIActionSimpleManagerConsolePerformCopyCommand(this, false, false);
3697 m_pool[UIActionIndexMN_M_Machine_M_Console_S_ConfigureApplications] = new UIActionSimpleManagerConsolePerformConfigureApplications(this);
3698 m_pool[UIActionIndexMN_M_Machine_M_Console_S_ShowLog] = new UIActionSimpleManagerConsolePerformShowLog(this);
3699 m_pool[UIActionIndexMN_M_Machine_M_Stop] = new UIActionMenuManagerStop(this);
3700 m_pool[UIActionIndexMN_M_Machine_M_Stop_S_SaveState] = new UIActionSimpleManagerStopPerformSave(this);
3701 m_pool[UIActionIndexMN_M_Machine_M_Stop_S_Terminate] = new UIActionSimpleManagerStopPerformTerminate(this);
3702 m_pool[UIActionIndexMN_M_Machine_M_Stop_S_Shutdown] = new UIActionSimpleManagerStopPerformShutdown(this);
3703 m_pool[UIActionIndexMN_M_Machine_M_Stop_S_PowerOff] = new UIActionSimpleManagerStopPerformPowerOff(this);
3704 m_pool[UIActionIndexMN_M_Machine_M_Tools] = new UIActionMenuManagerToolsMachine(this);
3705 m_pool[UIActionIndexMN_M_Machine_M_Tools_T_Details] = new UIActionToggleManagerToolsMachineShowDetails(this);
3706 m_pool[UIActionIndexMN_M_Machine_M_Tools_T_Snapshots] = new UIActionToggleManagerToolsMachineShowSnapshots(this);
3707 m_pool[UIActionIndexMN_M_Machine_M_Tools_T_Logs] = new UIActionToggleManagerToolsMachineShowLogs(this);
3708 m_pool[UIActionIndexMN_M_Machine_M_Tools_T_Activity] = new UIActionToggleManagerToolsMachineShowActivity(this);
3709 m_pool[UIActionIndexMN_M_Machine_M_Tools_T_FileManager] = new UIActionToggleManagerToolsMachineShowFileManager(this);
3710 m_pool[UIActionIndexMN_M_Machine_S_Discard] = new UIActionSimpleManagerCommonPerformDiscard(this);
3711 m_pool[UIActionIndexMN_M_Machine_S_ShowLogDialog] = new UIActionSimpleManagerCommonShowMachineLogs(this);
3712 m_pool[UIActionIndexMN_M_Machine_S_Refresh] = new UIActionSimpleManagerCommonPerformRefresh(this);
3713 m_pool[UIActionIndexMN_M_Machine_S_ShowInFileManager] = new UIActionSimpleManagerCommonShowInFileManager(this);
3714 m_pool[UIActionIndexMN_M_Machine_S_CreateShortcut] = new UIActionSimpleManagerCommonPerformCreateShortcut(this);
3715 m_pool[UIActionIndexMN_M_Machine_S_SortParent] = new UIActionSimpleManagerMachinePerformSortParent(this);
3716 m_pool[UIActionIndexMN_M_Machine_T_Search] = new UIActionToggleManagerCommonToggleSearch(this);
3717
3718 /* Snapshot Pane actions: */
3719 m_pool[UIActionIndexMN_M_Snapshot] = new UIActionMenuManagerSnapshot(this);
3720 m_pool[UIActionIndexMN_M_Snapshot_S_Take] = new UIActionMenuManagerSnapshotPerformTake(this);
3721 m_pool[UIActionIndexMN_M_Snapshot_S_Delete] = new UIActionMenuManagerSnapshotPerformDelete(this);
3722 m_pool[UIActionIndexMN_M_Snapshot_S_Restore] = new UIActionMenuManagerSnapshotPerformRestore(this);
3723 m_pool[UIActionIndexMN_M_Snapshot_T_Properties] = new UIActionMenuManagerSnapshotToggleProperties(this);
3724 m_pool[UIActionIndexMN_M_Snapshot_S_Clone] = new UIActionMenuManagerSnapshotPerformClone(this);
3725
3726 /* Extension Pack Manager actions: */
3727 m_pool[UIActionIndexMN_M_ExtensionWindow] = new UIActionMenuManagerExtension(this);
3728 m_pool[UIActionIndexMN_M_Extension] = new UIActionMenuManagerExtension(this);
3729 m_pool[UIActionIndexMN_M_Extension_S_Install] = new UIActionSimpleManagerExtensionPerformInstall(this);
3730 m_pool[UIActionIndexMN_M_Extension_S_Uninstall] = new UIActionSimpleManagerExtensionPerformUninstall(this);
3731
3732 /* Virtual Medium Manager actions: */
3733 m_pool[UIActionIndexMN_M_MediumWindow] = new UIActionMenuManagerMedium(this);
3734 m_pool[UIActionIndexMN_M_Medium] = new UIActionMenuManagerMedium(this);
3735 m_pool[UIActionIndexMN_M_Medium_S_Add] = new UIActionMenuManagerMediumPerformAdd(this);
3736 m_pool[UIActionIndexMN_M_Medium_S_Create] = new UIActionMenuManagerMediumPerformCreate(this);
3737 m_pool[UIActionIndexMN_M_Medium_S_Copy] = new UIActionMenuManagerMediumPerformCopy(this);
3738 m_pool[UIActionIndexMN_M_Medium_S_Move] = new UIActionMenuManagerMediumPerformMove(this);
3739 m_pool[UIActionIndexMN_M_Medium_S_Remove] = new UIActionMenuManagerMediumPerformRemove(this);
3740 m_pool[UIActionIndexMN_M_Medium_S_Release] = new UIActionMenuManagerMediumPerformRelease(this);
3741 m_pool[UIActionIndexMN_M_Medium_T_Details] = new UIActionMenuManagerMediumToggleProperties(this);
3742 m_pool[UIActionIndexMN_M_Medium_T_Search] = new UIActionMenuManagerMediumToggleSearch(this);
3743 m_pool[UIActionIndexMN_M_Medium_S_Refresh] = new UIActionMenuManagerMediumPerformRefresh(this);
3744 m_pool[UIActionIndexMN_M_Medium_S_Clear] = new UIActionMenuManagerMediumPerformClear(this);
3745
3746 /* Network Manager actions: */
3747 m_pool[UIActionIndexMN_M_NetworkWindow] = new UIActionMenuManagerNetwork(this);
3748 m_pool[UIActionIndexMN_M_Network] = new UIActionMenuManagerNetwork(this);
3749 m_pool[UIActionIndexMN_M_Network_S_Create] = new UIActionMenuManagerNetworkPerformCreate(this);
3750 m_pool[UIActionIndexMN_M_Network_S_Remove] = new UIActionMenuManagerNetworkPerformRemove(this);
3751 m_pool[UIActionIndexMN_M_Network_T_Details] = new UIActionMenuManagerNetworkToggleProperties(this);
3752 m_pool[UIActionIndexMN_M_Network_S_Refresh] = new UIActionMenuManagerNetworkPerformRefresh(this);
3753
3754 /* Cloud Profile Manager actions: */
3755 m_pool[UIActionIndexMN_M_CloudWindow] = new UIActionMenuManagerCloud(this);
3756 m_pool[UIActionIndexMN_M_Cloud] = new UIActionMenuManagerCloud(this);
3757 m_pool[UIActionIndexMN_M_Cloud_S_Add] = new UIActionMenuManagerCloudPerformAdd(this);
3758 m_pool[UIActionIndexMN_M_Cloud_S_Import] = new UIActionMenuManagerCloudPerformImport(this);
3759 m_pool[UIActionIndexMN_M_Cloud_S_Remove] = new UIActionMenuManagerCloudPerformRemove(this);
3760 m_pool[UIActionIndexMN_M_Cloud_T_Details] = new UIActionMenuManagerCloudToggleProperties(this);
3761 m_pool[UIActionIndexMN_M_Cloud_S_TryPage] = new UIActionMenuManagerCloudShowTryPage(this);
3762 m_pool[UIActionIndexMN_M_Cloud_S_Help] = new UIActionMenuManagerCloudShowHelp(this);
3763
3764 /* Cloud Console Manager actions: */
3765 m_pool[UIActionIndexMN_M_CloudConsoleWindow] = new UIActionMenuManagerCloudConsole(this);
3766 m_pool[UIActionIndexMN_M_CloudConsole] = new UIActionMenuManagerCloudConsole(this);
3767 m_pool[UIActionIndexMN_M_CloudConsole_S_ApplicationAdd] = new UIActionMenuManagerCloudConsolePerformApplicationAdd(this);
3768 m_pool[UIActionIndexMN_M_CloudConsole_S_ApplicationRemove] = new UIActionMenuManagerCloudConsolePerformApplicationRemove(this);
3769 m_pool[UIActionIndexMN_M_CloudConsole_S_ProfileAdd] = new UIActionMenuManagerCloudConsolePerformProfileAdd(this);
3770 m_pool[UIActionIndexMN_M_CloudConsole_S_ProfileRemove] = new UIActionMenuManagerCloudConsolePerformProfileRemove(this);
3771 m_pool[UIActionIndexMN_M_CloudConsole_T_Details] = new UIActionMenuManagerCloudConsoleToggleProperties(this);
3772
3773 /* VM Activity Overview actions: */
3774 m_pool[UIActionIndexMN_M_VMActivityOverview] = new UIActionMenuVMActivityOverview(this);
3775 m_pool[UIActionIndexMN_M_VMActivityOverview_M_Columns] = new UIActionMenuManagerVMActivityOverviewColumns(this);
3776 m_pool[UIActionIndexMN_M_VMActivityOverview_S_SwitchToMachineActivity] = new UIActionMenuManagerVMActivityOverviewSwitchToMachineActivity(this);
3777
3778 /* 'File' action groups: */
3779 m_groupPool[UIActionIndexMN_M_File_M_Tools] = new QActionGroup(m_pool.value(UIActionIndexMN_M_File_M_Tools));
3780 m_groupPool[UIActionIndexMN_M_File_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_File_M_Tools_T_WelcomeScreen));
3781 m_groupPool[UIActionIndexMN_M_File_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_File_M_Tools_T_ExtensionPackManager));
3782 m_groupPool[UIActionIndexMN_M_File_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_File_M_Tools_T_VirtualMediaManager));
3783 m_groupPool[UIActionIndexMN_M_File_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_File_M_Tools_T_NetworkManager));
3784 m_groupPool[UIActionIndexMN_M_File_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_File_M_Tools_T_CloudProfileManager));
3785 m_groupPool[UIActionIndexMN_M_File_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_File_M_Tools_T_VMActivityOverview));
3786
3787 /* 'Group' action groups: */
3788 m_groupPool[UIActionIndexMN_M_Group_M_Tools] = new QActionGroup(m_pool.value(UIActionIndexMN_M_Group_M_Tools));
3789 m_groupPool[UIActionIndexMN_M_Group_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_Group_M_Tools_T_Details));
3790 m_groupPool[UIActionIndexMN_M_Group_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_Group_M_Tools_T_Snapshots));
3791 m_groupPool[UIActionIndexMN_M_Group_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_Group_M_Tools_T_Logs));
3792 m_groupPool[UIActionIndexMN_M_Group_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_Group_M_Tools_T_Activity));
3793 m_groupPool[UIActionIndexMN_M_Group_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_Group_M_Tools_T_FileManager));
3794
3795 /* 'Machine' action groups: */
3796 m_groupPool[UIActionIndexMN_M_Machine_M_Tools] = new QActionGroup(m_pool.value(UIActionIndexMN_M_Machine_M_Tools));
3797 m_groupPool[UIActionIndexMN_M_Machine_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_Machine_M_Tools_T_Details));
3798 m_groupPool[UIActionIndexMN_M_Machine_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_Machine_M_Tools_T_Snapshots));
3799 m_groupPool[UIActionIndexMN_M_Machine_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_Machine_M_Tools_T_Logs));
3800 m_groupPool[UIActionIndexMN_M_Machine_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_Machine_M_Tools_T_Activity));
3801 m_groupPool[UIActionIndexMN_M_Machine_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_Machine_M_Tools_T_FileManager));
3802
3803 /* Prepare update-handlers for known menus: */
3804 m_menuUpdateHandlers[UIActionIndexMN_M_File].ptfm = &UIActionPoolManager::updateMenuFile;
3805 m_menuUpdateHandlers[UIActionIndexMN_M_File_M_Tools].ptfm = &UIActionPoolManager::updateMenuFileTools;
3806 m_menuUpdateHandlers[UIActionIndexMN_M_Welcome].ptfm = &UIActionPoolManager::updateMenuWelcome;
3807 m_menuUpdateHandlers[UIActionIndexMN_M_Group].ptfm = &UIActionPoolManager::updateMenuGroup;
3808 m_menuUpdateHandlers[UIActionIndexMN_M_Machine].ptfm = &UIActionPoolManager::updateMenuMachine;
3809 m_menuUpdateHandlers[UIActionIndexMN_M_Group_M_MoveToGroup].ptfm = &UIActionPoolManager::updateMenuGroupMoveToGroup;
3810 m_menuUpdateHandlers[UIActionIndexMN_M_Machine_M_MoveToGroup].ptfm = &UIActionPoolManager::updateMenuMachineMoveToGroup;
3811 m_menuUpdateHandlers[UIActionIndexMN_M_Group_M_StartOrShow].ptfm = &UIActionPoolManager::updateMenuGroupStartOrShow;
3812 m_menuUpdateHandlers[UIActionIndexMN_M_Machine_M_StartOrShow].ptfm = &UIActionPoolManager::updateMenuMachineStartOrShow;
3813 m_menuUpdateHandlers[UIActionIndexMN_M_Group_M_Console].ptfm = &UIActionPoolManager::updateMenuGroupConsole;
3814 m_menuUpdateHandlers[UIActionIndexMN_M_Machine_M_Console].ptfm = &UIActionPoolManager::updateMenuMachineConsole;
3815 m_menuUpdateHandlers[UIActionIndexMN_M_Group_M_Stop].ptfm = &UIActionPoolManager::updateMenuGroupClose;
3816 m_menuUpdateHandlers[UIActionIndexMN_M_Machine_M_Stop].ptfm = &UIActionPoolManager::updateMenuMachineClose;
3817 m_menuUpdateHandlers[UIActionIndexMN_M_Group_M_Tools].ptfm = &UIActionPoolManager::updateMenuGroupTools;
3818 m_menuUpdateHandlers[UIActionIndexMN_M_Machine_M_Tools].ptfm = &UIActionPoolManager::updateMenuMachineTools;
3819 m_menuUpdateHandlers[UIActionIndexMN_M_ExtensionWindow].ptfm = &UIActionPoolManager::updateMenuExtensionWindow;
3820 m_menuUpdateHandlers[UIActionIndexMN_M_Extension].ptfm = &UIActionPoolManager::updateMenuExtension;
3821 m_menuUpdateHandlers[UIActionIndexMN_M_MediumWindow].ptfm = &UIActionPoolManager::updateMenuMediumWindow;
3822 m_menuUpdateHandlers[UIActionIndexMN_M_Medium].ptfm = &UIActionPoolManager::updateMenuMedium;
3823 m_menuUpdateHandlers[UIActionIndexMN_M_NetworkWindow].ptfm = &UIActionPoolManager::updateMenuNetworkWindow;
3824 m_menuUpdateHandlers[UIActionIndexMN_M_Network].ptfm = &UIActionPoolManager::updateMenuNetwork;
3825 m_menuUpdateHandlers[UIActionIndexMN_M_CloudWindow].ptfm = &UIActionPoolManager::updateMenuCloudWindow;
3826 m_menuUpdateHandlers[UIActionIndexMN_M_Cloud].ptfm = &UIActionPoolManager::updateMenuCloud;
3827 m_menuUpdateHandlers[UIActionIndexMN_M_CloudConsoleWindow].ptfm = &UIActionPoolManager::updateMenuCloudConsoleWindow;
3828 m_menuUpdateHandlers[UIActionIndexMN_M_CloudConsole].ptfm = &UIActionPoolManager::updateMenuCloudConsole;
3829 m_menuUpdateHandlers[UIActionIndexMN_M_VMActivityOverview].ptfm = &UIActionPoolManager::updateMenuVMActivityOverview;
3830 m_menuUpdateHandlers[UIActionIndexMN_M_Snapshot].ptfm = &UIActionPoolManager::updateMenuSnapshot;
3831
3832 /* Call to base-class: */
3833 UIActionPool::preparePool();
3834}
3835
3836void UIActionPoolManager::prepareConnections()
3837{
3838 /* Prepare connections: */
3839 connect(gShortcutPool, &UIShortcutPool::sigManagerShortcutsReloaded,
3840 this, &UIActionPoolManager::sltApplyShortcuts);
3841 connect(gShortcutPool, &UIShortcutPool::sigRuntimeShortcutsReloaded,
3842 this, &UIActionPoolManager::sltApplyShortcuts);
3843 connect(gEDataManager, &UIExtraDataManager::sigSettingsExpertModeChange,
3844 this, &UIActionPoolManager::sltHandleSettingsExpertModeChange);
3845
3846 /* Call to base-class: */
3847 UIActionPool::prepareConnections();
3848}
3849
3850void UIActionPoolManager::updateMenu(int iIndex)
3851{
3852 /* If index belongs to base-class => delegate to base-class: */
3853 if (iIndex < UIActionIndex_Max)
3854 UIActionPool::updateMenu(iIndex);
3855 /* Otherwise,
3856 * if menu with such index is invalidated
3857 * and there is update-handler => handle it here: */
3858 else if ( iIndex > UIActionIndex_Max
3859 && m_invalidations.contains(iIndex)
3860 && m_menuUpdateHandlers.contains(iIndex))
3861 (this->*(m_menuUpdateHandlers.value(iIndex).ptfm))();
3862}
3863
3864void UIActionPoolManager::updateMenus()
3865{
3866 /* Clear menu list: */
3867 m_mainMenus.clear();
3868
3869 /* 'File' menu: */
3870 addMenu(m_mainMenus, action(UIActionIndexMN_M_File));
3871 updateMenuFile();
3872
3873 /* 'File' / 'Tools' menu: */
3874 updateMenuFileTools();
3875
3876 /* 'Welcome' menu: */
3877 addMenu(m_mainMenus, action(UIActionIndexMN_M_Welcome));
3878 updateMenuWelcome();
3879 /* 'Group' menu: */
3880 addMenu(m_mainMenus, action(UIActionIndexMN_M_Group));
3881 updateMenuGroup();
3882 /* 'Machine' menu: */
3883 addMenu(m_mainMenus, action(UIActionIndexMN_M_Machine));
3884 updateMenuMachine();
3885
3886 /* 'Machine' / 'Move to Group' menu: */
3887 updateMenuMachineMoveToGroup();
3888 /* 'Group' / 'Start or Show' menu: */
3889 updateMenuGroupStartOrShow();
3890 /* 'Machine' / 'Start or Show' menu: */
3891 updateMenuMachineStartOrShow();
3892 /* 'Group' / 'Close' menu: */
3893 updateMenuGroupClose();
3894 /* 'Machine' / 'Close' menu: */
3895 updateMenuMachineClose();
3896 /* 'Group' / 'Tools' menu: */
3897 updateMenuGroupTools();
3898 /* 'Machine' / 'Tools' menu: */
3899 updateMenuMachineTools();
3900
3901 /* 'Extension Pack Manager' menu: */
3902 addMenu(m_mainMenus, action(UIActionIndexMN_M_Extension));
3903 updateMenuExtensionWindow();
3904 updateMenuExtension();
3905 /* 'Virtual Media Manager' menu: */
3906 addMenu(m_mainMenus, action(UIActionIndexMN_M_Medium));
3907 updateMenuMediumWindow();
3908 updateMenuMedium();
3909 /* 'Network Manager' menu: */
3910 addMenu(m_mainMenus, action(UIActionIndexMN_M_Network));
3911 updateMenuNetworkWindow();
3912 updateMenuNetwork();
3913 /* 'Cloud Profile Manager' menu: */
3914 addMenu(m_mainMenus, action(UIActionIndexMN_M_Cloud));
3915 updateMenuCloudWindow();
3916 updateMenuCloud();
3917 /* 'VM Activity Overview' menu: */
3918 addMenu(m_mainMenus, action(UIActionIndexMN_M_VMActivityOverview));
3919 updateMenuVMActivityOverview();
3920
3921 /* 'Snapshot' menu: */
3922 addMenu(m_mainMenus, action(UIActionIndexMN_M_Snapshot));
3923 updateMenuSnapshot();
3924 /* 'Log' menu: */
3925 addMenu(m_mainMenus, action(UIActionIndex_M_Log));
3926 updateMenuLogViewerWindow();
3927 updateMenuLogViewer();
3928 /* 'Activity' menu: */
3929 addMenu(m_mainMenus, action(UIActionIndex_M_Activity));
3930 updateMenuVMActivityMonitor();
3931
3932 /* 'File Manager' menu*/
3933 addMenu(m_mainMenus, action(UIActionIndex_M_FileManager));
3934 updateMenuFileManager();
3935
3936 /* 'Help' menu: */
3937 addMenu(m_mainMenus, action(UIActionIndex_Menu_Help));
3938 updateMenuHelp();
3939}
3940
3941void UIActionPoolManager::setShortcutsVisible(int iIndex, bool fVisible)
3942{
3943 /* Prepare a list of actions: */
3944 QList<UIAction*> actions;
3945
3946 /* Handle known menus: */
3947 switch (iIndex)
3948 {
3949 case UIActionIndexMN_M_Welcome:
3950 {
3951 actions << action(UIActionIndexMN_M_Welcome_S_New)
3952 << action(UIActionIndexMN_M_Welcome_S_Add);
3953 break;
3954 }
3955 case UIActionIndexMN_M_Group:
3956 {
3957 actions << action(UIActionIndexMN_M_Group_S_New)
3958 << action(UIActionIndexMN_M_Group_S_Add)
3959 << action(UIActionIndexMN_M_Group_S_Rename)
3960 << action(UIActionIndexMN_M_Group_S_Remove)
3961 << action(UIActionIndexMN_M_Group_M_MoveToGroup)
3962 << action(UIActionIndexMN_M_Group_M_StartOrShow)
3963 << action(UIActionIndexMN_M_Group_T_Pause)
3964 << action(UIActionIndexMN_M_Group_S_Reset)
3965 // << action(UIActionIndexMN_M_Group_S_Detach)
3966 << action(UIActionIndexMN_M_Group_S_Discard)
3967 << action(UIActionIndexMN_M_Group_S_ShowLogDialog)
3968 << action(UIActionIndexMN_M_Group_S_Refresh)
3969 << action(UIActionIndexMN_M_Group_S_ShowInFileManager)
3970 << action(UIActionIndexMN_M_Group_S_CreateShortcut)
3971 << action(UIActionIndexMN_M_Group_S_Sort)
3972 << action(UIActionIndexMN_M_Group_M_StartOrShow_S_StartNormal)
3973 << action(UIActionIndexMN_M_Group_M_StartOrShow_S_StartHeadless)
3974 << action(UIActionIndexMN_M_Group_M_StartOrShow_S_StartDetachable)
3975 << action(UIActionIndexMN_M_Group_M_Console_S_CreateConnection)
3976 << action(UIActionIndexMN_M_Group_M_Console_S_DeleteConnection)
3977 << action(UIActionIndexMN_M_Group_M_Console_S_ConfigureApplications)
3978 << action(UIActionIndexMN_M_Group_M_Stop_S_SaveState)
3979 << action(UIActionIndexMN_M_Group_M_Stop_S_Terminate)
3980 << action(UIActionIndexMN_M_Group_M_Stop_S_Shutdown)
3981 << action(UIActionIndexMN_M_Group_M_Stop_S_PowerOff)
3982 << action(UIActionIndexMN_M_Group_M_Tools_T_Details)
3983 << action(UIActionIndexMN_M_Group_M_Tools_T_Snapshots)
3984 << action(UIActionIndexMN_M_Group_M_Tools_T_Logs)
3985 << action(UIActionIndexMN_M_Group_M_Tools_T_Activity);
3986 break;
3987 }
3988 case UIActionIndexMN_M_Machine:
3989 {
3990 actions << action(UIActionIndexMN_M_Machine_S_New)
3991 << action(UIActionIndexMN_M_Machine_S_Add)
3992 << action(UIActionIndexMN_M_Machine_S_Settings)
3993 << action(UIActionIndexMN_M_Machine_S_Clone)
3994 << action(UIActionIndexMN_M_Machine_S_Move)
3995 << action(UIActionIndexMN_M_Machine_S_ExportToOCI)
3996 << action(UIActionIndexMN_M_Machine_S_Remove)
3997 << action(UIActionIndexMN_M_Machine_M_MoveToGroup)
3998 << action(UIActionIndexMN_M_Machine_M_StartOrShow)
3999 << action(UIActionIndexMN_M_Machine_T_Pause)
4000 << action(UIActionIndexMN_M_Machine_S_Reset)
4001 // << action(UIActionIndexMN_M_Machine_S_Detach)
4002 << action(UIActionIndexMN_M_Machine_S_Discard)
4003 << action(UIActionIndexMN_M_Machine_S_ShowLogDialog)
4004 << action(UIActionIndexMN_M_Machine_S_Refresh)
4005 << action(UIActionIndexMN_M_Machine_S_ShowInFileManager)
4006 << action(UIActionIndexMN_M_Machine_S_CreateShortcut)
4007 << action(UIActionIndexMN_M_Machine_S_SortParent)
4008 << action(UIActionIndexMN_M_Machine_M_MoveToGroup_S_New)
4009 << action(UIActionIndexMN_M_Machine_M_StartOrShow_S_StartNormal)
4010 << action(UIActionIndexMN_M_Machine_M_StartOrShow_S_StartHeadless)
4011 << action(UIActionIndexMN_M_Machine_M_StartOrShow_S_StartDetachable)
4012 << action(UIActionIndexMN_M_Machine_M_Console_S_CreateConnection)
4013 << action(UIActionIndexMN_M_Machine_M_Console_S_DeleteConnection)
4014 << action(UIActionIndexMN_M_Machine_M_Console_S_CopyCommandSerialUnix)
4015 << action(UIActionIndexMN_M_Machine_M_Console_S_CopyCommandSerialWindows)
4016 << action(UIActionIndexMN_M_Machine_M_Console_S_CopyCommandVNCUnix)
4017 << action(UIActionIndexMN_M_Machine_M_Console_S_CopyCommandVNCWindows)
4018 << action(UIActionIndexMN_M_Machine_M_Console_S_ConfigureApplications)
4019 << action(UIActionIndexMN_M_Machine_M_Console_S_ShowLog)
4020 << action(UIActionIndexMN_M_Machine_M_Stop_S_SaveState)
4021 << action(UIActionIndexMN_M_Machine_M_Stop_S_Terminate)
4022 << action(UIActionIndexMN_M_Machine_M_Stop_S_Shutdown)
4023 << action(UIActionIndexMN_M_Machine_M_Stop_S_PowerOff)
4024 << action(UIActionIndexMN_M_Machine_M_Tools_T_Details)
4025 << action(UIActionIndexMN_M_Machine_M_Tools_T_Snapshots)
4026 << action(UIActionIndexMN_M_Machine_M_Tools_T_Logs)
4027 << action(UIActionIndexMN_M_Machine_M_Tools_T_Activity);
4028 break;
4029 }
4030 default:
4031 break;
4032 }
4033
4034 /* Update shortcut visibility: */
4035 foreach (UIAction *pAction, actions)
4036 fVisible ? pAction->showShortcut() : pAction->hideShortcut();
4037}
4038
4039QString UIActionPoolManager::shortcutsExtraDataID() const
4040{
4041 return GUI_Input_SelectorShortcuts;
4042}
4043
4044void UIActionPoolManager::updateShortcuts()
4045{
4046 /* Call to base-class: */
4047 UIActionPool::updateShortcuts();
4048 /* Create temporary Runtime UI pool to do the same: */
4049 if (!isTemporary())
4050 UIActionPool::createTemporary(UIActionPoolType_Runtime);
4051}
4052
4053void UIActionPoolManager::sltHandleSettingsExpertModeChange()
4054{
4055 /* Invalidate corresponding menus: */
4056 m_invalidations << UIActionIndexMN_M_File_M_Tools
4057 << UIActionIndexMN_M_Group_M_Tools
4058 << UIActionIndexMN_M_Machine_M_Tools
4059 << UIActionIndexMN_M_Snapshot;
4060}
4061
4062void UIActionPoolManager::updateMenuFile()
4063{
4064 /* Get corresponding menu: */
4065 UIMenu *pMenu = action(UIActionIndexMN_M_File)->menu();
4066 AssertPtrReturnVoid(pMenu);
4067 /* Clear contents: */
4068 pMenu->clear();
4069
4070 /* The Application / 'File' menu contents is very different depending on host type. */
4071
4072#ifdef VBOX_WS_MAC
4073
4074 /* 'About' action goes to Application menu: */
4075 pMenu->addAction(action(UIActionIndex_M_Application_S_About));
4076# ifdef VBOX_GUI_WITH_NETWORK_MANAGER
4077 /* 'Check for Updates' action goes to Application menu: */
4078 if (gEDataManager->applicationUpdateEnabled())
4079 pMenu->addAction(action(UIActionIndex_M_Application_S_CheckForUpdates));
4080# endif
4081 /* 'Reset Warnings' action goes to Application menu: */
4082 pMenu->addAction(action(UIActionIndex_M_Application_S_ResetWarnings));
4083 /* 'Preferences' action goes to Application menu: */
4084 pMenu->addAction(action(UIActionIndex_M_Application_S_Preferences));
4085 /* 'Close' action goes to Application menu: */
4086 pMenu->addAction(action(UIActionIndexMN_M_File_S_Close));
4087
4088 /* 'Import Appliance' action goes to 'File' menu: */
4089 pMenu->addAction(action(UIActionIndexMN_M_File_S_ImportAppliance));
4090 /* 'Export Appliance' action goes to 'File' menu: */
4091 pMenu->addAction(action(UIActionIndexMN_M_File_S_ExportAppliance));
4092# ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
4093 /* 'Show Extra-data Manager' action goes to 'File' menu for Debug build: */
4094 pMenu->addAction(action(UIActionIndexMN_M_File_S_ShowExtraDataManager));
4095# endif
4096 /* Separator after Import/Export actions of the 'File' menu: */
4097 pMenu->addSeparator();
4098 /* 'Tools' submenu goes to 'File' menu: */
4099 pMenu->addMenu(action(UIActionIndexMN_M_File_M_Tools)->menu());
4100#else /* !VBOX_WS_MAC */
4101
4102 /* 'Preferences' action goes to 'File' menu: */
4103 pMenu->addAction(action(UIActionIndex_M_Application_S_Preferences));
4104 /* Separator after 'Preferences' action of the 'File' menu: */
4105 pMenu->addSeparator();
4106 /* 'Import Appliance' action goes to 'File' menu: */
4107 pMenu->addAction(action(UIActionIndexMN_M_File_S_ImportAppliance));
4108 /* 'Export Appliance' action goes to 'File' menu: */
4109 pMenu->addAction(action(UIActionIndexMN_M_File_S_ExportAppliance));
4110 /* Separator after 'Export Appliance' action of the 'File' menu: */
4111 pMenu->addSeparator();
4112# ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
4113 /* 'Extra-data Manager' action goes to 'File' menu for Debug build: */
4114 pMenu->addAction(action(UIActionIndexMN_M_File_S_ShowExtraDataManager));
4115 /* Separator after 'Extra-data Manager' action of the 'File' menu: */
4116 pMenu->addSeparator();
4117# endif
4118 /* 'Tools' submenu goes to 'File' menu: */
4119 pMenu->addMenu(action(UIActionIndexMN_M_File_M_Tools)->menu());
4120 /* Separator after 'Tools' submenu of the 'File' menu: */
4121 pMenu->addSeparator();
4122# ifdef VBOX_GUI_WITH_NETWORK_MANAGER
4123 /* 'Check for Updates' action goes to 'File' menu: */
4124 if (gEDataManager->applicationUpdateEnabled())
4125 pMenu->addAction(action(UIActionIndex_M_Application_S_CheckForUpdates));
4126# endif
4127 /* 'Reset Warnings' action goes 'File' menu: */
4128 pMenu->addAction(action(UIActionIndex_M_Application_S_ResetWarnings));
4129 /* Separator after 'Reset Warnings' action of the 'File' menu: */
4130 pMenu->addSeparator();
4131 /* 'Close' action goes to 'File' menu: */
4132 pMenu->addAction(action(UIActionIndexMN_M_File_S_Close));
4133
4134#endif /* !VBOX_WS_MAC */
4135
4136 /* Mark menu as valid: */
4137 m_invalidations.remove(UIActionIndexMN_M_File);
4138}
4139
4140void UIActionPoolManager::updateMenuFileTools()
4141{
4142 /* Get corresponding menu: */
4143 UIMenu *pMenu = action(UIActionIndexMN_M_File_M_Tools)->menu();
4144 AssertPtrReturnVoid(pMenu);
4145 /* Clear contents: */
4146 pMenu->clear();
4147
4148 /* Populate 'File' / 'Tools' menu: */
4149 const bool fExpertMode = gEDataManager->isSettingsInExpertMode();
4150 pMenu->addAction(action(UIActionIndexMN_M_File_M_Tools_T_ExtensionPackManager));
4151 if (fExpertMode)
4152 {
4153 pMenu->addAction(action(UIActionIndexMN_M_File_M_Tools_T_VirtualMediaManager));
4154 pMenu->addAction(action(UIActionIndexMN_M_File_M_Tools_T_NetworkManager));
4155 }
4156 pMenu->addAction(action(UIActionIndexMN_M_File_M_Tools_T_CloudProfileManager));
4157 pMenu->addAction(action(UIActionIndexMN_M_File_M_Tools_T_VMActivityOverview));
4158
4159 /* Mark menu as valid: */
4160 m_invalidations.remove(UIActionIndexMN_M_File_M_Tools);
4161}
4162
4163void UIActionPoolManager::updateMenuWelcome()
4164{
4165 /* Get corresponding menu: */
4166 UIMenu *pMenu = action(UIActionIndexMN_M_Welcome)->menu();
4167 AssertPtrReturnVoid(pMenu);
4168 /* Clear contents: */
4169 pMenu->clear();
4170
4171 /* Populate 'Welcome' menu: */
4172 pMenu->addAction(action(UIActionIndexMN_M_Welcome_S_New));
4173 pMenu->addAction(action(UIActionIndexMN_M_Welcome_S_Add));
4174
4175 /* Mark menu as valid: */
4176 m_invalidations.remove(UIActionIndexMN_M_Welcome);
4177}
4178
4179void UIActionPoolManager::updateMenuGroup()
4180{
4181 /* Get corresponding menu: */
4182 UIMenu *pMenu = action(UIActionIndexMN_M_Group)->menu();
4183 AssertPtrReturnVoid(pMenu);
4184 /* Clear contents: */
4185 pMenu->clear();
4186
4187#ifdef VBOX_WS_MAC
4188 // WORKAROUND:
4189 // On macOS you can't leave menu empty and still have it in
4190 // the menu-bar, you have to leave there at least something.
4191 // Remaining stuff will be appended from UIVirtualBoxManager.
4192 pMenu->addAction(action(UIActionIndexMN_M_Group_S_New));
4193#endif
4194
4195 /* This menu always remains invalid.. */
4196}
4197
4198void UIActionPoolManager::updateMenuMachine()
4199{
4200 /* Get corresponding menu: */
4201 UIMenu *pMenu = action(UIActionIndexMN_M_Machine)->menu();
4202 AssertPtrReturnVoid(pMenu);
4203 /* Clear contents: */
4204 pMenu->clear();
4205
4206#ifdef VBOX_WS_MAC
4207 // WORKAROUND:
4208 // On macOS you can't leave menu empty and still have it in
4209 // the menu-bar, you have to leave there at least something.
4210 // Remaining stuff will be appended from UIVirtualBoxManager.
4211 pMenu->addAction(action(UIActionIndexMN_M_Machine_S_New));
4212#endif
4213
4214 /* This menu always remains invalid.. */
4215}
4216
4217void UIActionPoolManager::updateMenuGroupMoveToGroup()
4218{
4219 /* Get corresponding menu: */
4220 UIMenu *pMenu = action(UIActionIndexMN_M_Group_M_MoveToGroup)->menu();
4221 AssertPtrReturnVoid(pMenu);
4222 /* Clear contents: */
4223 pMenu->clear();
4224
4225 /* This menu always remains invalid.. */
4226}
4227
4228void UIActionPoolManager::updateMenuMachineMoveToGroup()
4229{
4230 /* Get corresponding menu: */
4231 UIMenu *pMenu = action(UIActionIndexMN_M_Machine_M_MoveToGroup)->menu();
4232 AssertPtrReturnVoid(pMenu);
4233 /* Clear contents: */
4234 pMenu->clear();
4235
4236 /* Populate 'Machine' / 'Move to Group' menu: */
4237 pMenu->addAction(action(UIActionIndexMN_M_Machine_M_MoveToGroup_S_New));
4238
4239 /* This menu always remains invalid.. */
4240}
4241
4242void UIActionPoolManager::updateMenuGroupStartOrShow()
4243{
4244 /* Get corresponding menu: */
4245 UIMenu *pMenu = action(UIActionIndexMN_M_Group_M_StartOrShow)->menu();
4246 AssertPtrReturnVoid(pMenu);
4247 /* Clear contents: */
4248 pMenu->clear();
4249
4250 /* Populate 'Group' / 'Start or Show' menu: */
4251 pMenu->addAction(action(UIActionIndexMN_M_Group_M_StartOrShow_S_StartNormal));
4252 pMenu->addAction(action(UIActionIndexMN_M_Group_M_StartOrShow_S_StartHeadless));
4253 pMenu->addAction(action(UIActionIndexMN_M_Group_M_StartOrShow_S_StartDetachable));
4254
4255 /* Mark menu as valid: */
4256 m_invalidations.remove(UIActionIndexMN_M_Group_M_StartOrShow);
4257}
4258
4259void UIActionPoolManager::updateMenuMachineStartOrShow()
4260{
4261 /* Get corresponding menu: */
4262 UIMenu *pMenu = action(UIActionIndexMN_M_Machine_M_StartOrShow)->menu();
4263 AssertPtrReturnVoid(pMenu);
4264 /* Clear contents: */
4265 pMenu->clear();
4266
4267 /* Populate 'Machine' / 'Start or Show' menu: */
4268 pMenu->addAction(action(UIActionIndexMN_M_Machine_M_StartOrShow_S_StartNormal));
4269 pMenu->addAction(action(UIActionIndexMN_M_Machine_M_StartOrShow_S_StartHeadless));
4270 pMenu->addAction(action(UIActionIndexMN_M_Machine_M_StartOrShow_S_StartDetachable));
4271
4272 /* Mark menu as valid: */
4273 m_invalidations.remove(UIActionIndexMN_M_Machine_M_StartOrShow);
4274}
4275
4276void UIActionPoolManager::updateMenuGroupConsole()
4277{
4278 /* Get corresponding menu: */
4279 UIMenu *pMenu = action(UIActionIndexMN_M_Group_M_Console)->menu();
4280 AssertPtrReturnVoid(pMenu);
4281 /* Clear contents: */
4282 pMenu->clear();
4283
4284 /* This menu always remains invalid.. */
4285}
4286
4287void UIActionPoolManager::updateMenuMachineConsole()
4288{
4289 /* Get corresponding menu: */
4290 UIMenu *pMenu = action(UIActionIndexMN_M_Machine_M_Console)->menu();
4291 AssertPtrReturnVoid(pMenu);
4292 /* Clear contents: */
4293 pMenu->clear();
4294
4295 /* This menu always remains invalid.. */
4296}
4297
4298void UIActionPoolManager::updateMenuGroupClose()
4299{
4300 /* Get corresponding menu: */
4301 UIMenu *pMenu = action(UIActionIndexMN_M_Group_M_Stop)->menu();
4302 AssertPtrReturnVoid(pMenu);
4303 /* Clear contents: */
4304 pMenu->clear();
4305
4306#ifdef VBOX_WS_MAC
4307 // WORKAROUND:
4308 // On macOS you can't leave menu empty and still have it in
4309 // the menu-bar, you have to leave there at least something.
4310 // Remaining stuff will be appended from UIVirtualBoxManager.
4311 pMenu->addAction(action(UIActionIndexMN_M_Group_M_Stop_S_PowerOff));
4312#endif
4313
4314 /* This menu always remains invalid.. */
4315}
4316
4317void UIActionPoolManager::updateMenuMachineClose()
4318{
4319 /* Get corresponding menu: */
4320 UIMenu *pMenu = action(UIActionIndexMN_M_Machine_M_Stop)->menu();
4321 AssertPtrReturnVoid(pMenu);
4322 /* Clear contents: */
4323 pMenu->clear();
4324
4325#ifdef VBOX_WS_MAC
4326 // WORKAROUND:
4327 // On macOS you can't leave menu empty and still have it in
4328 // the menu-bar, you have to leave there at least something.
4329 // Remaining stuff will be appended from UIVirtualBoxManager.
4330 pMenu->addAction(action(UIActionIndexMN_M_Machine_M_Stop_S_PowerOff));
4331#endif
4332
4333 /* This menu always remains invalid.. */
4334}
4335
4336void UIActionPoolManager::updateMenuGroupTools()
4337{
4338 /* Get corresponding menu: */
4339 UIMenu *pMenu = action(UIActionIndexMN_M_Group_M_Tools)->menu();
4340 AssertPtrReturnVoid(pMenu);
4341 /* Clear contents: */
4342 pMenu->clear();
4343
4344 /* Populate 'Group' / 'Tools' menu: */
4345 const bool fExpertMode = gEDataManager->isSettingsInExpertMode();
4346 pMenu->addAction(action(UIActionIndexMN_M_Group_M_Tools_T_Details));
4347 pMenu->addAction(action(UIActionIndexMN_M_Group_M_Tools_T_Snapshots));
4348 pMenu->addAction(action(UIActionIndexMN_M_Group_M_Tools_T_Logs));
4349 pMenu->addAction(action(UIActionIndexMN_M_Group_M_Tools_T_Activity));
4350 if (fExpertMode)
4351 pMenu->addAction(action(UIActionIndexMN_M_Group_M_Tools_T_FileManager));
4352
4353 /* Mark menu as valid: */
4354 m_invalidations.remove(UIActionIndexMN_M_Group_M_Tools);
4355}
4356
4357void UIActionPoolManager::updateMenuMachineTools()
4358{
4359 /* Get corresponding menu: */
4360 UIMenu *pMenu = action(UIActionIndexMN_M_Machine_M_Tools)->menu();
4361 AssertPtrReturnVoid(pMenu);
4362 /* Clear contents: */
4363 pMenu->clear();
4364
4365 /* Populate 'Machine' / 'Tools' menu: */
4366 const bool fExpertMode = gEDataManager->isSettingsInExpertMode();
4367 pMenu->addAction(action(UIActionIndexMN_M_Machine_M_Tools_T_Details));
4368 pMenu->addAction(action(UIActionIndexMN_M_Machine_M_Tools_T_Snapshots));
4369 pMenu->addAction(action(UIActionIndexMN_M_Machine_M_Tools_T_Logs));
4370 pMenu->addAction(action(UIActionIndexMN_M_Machine_M_Tools_T_Activity));
4371 if (fExpertMode)
4372 pMenu->addAction(action(UIActionIndexMN_M_Machine_M_Tools_T_FileManager));
4373
4374 /* Mark menu as valid: */
4375 m_invalidations.remove(UIActionIndexMN_M_Machine_M_Tools);
4376}
4377
4378void UIActionPoolManager::updateMenuExtensionWindow()
4379{
4380 /* Update corresponding menu: */
4381 updateMenuExtensionWrapper(action(UIActionIndexMN_M_ExtensionWindow)->menu());
4382
4383 /* Mark menu as valid: */
4384 m_invalidations.remove(UIActionIndexMN_M_ExtensionWindow);
4385}
4386
4387void UIActionPoolManager::updateMenuExtension()
4388{
4389 /* Update corresponding menu: */
4390 updateMenuExtensionWrapper(action(UIActionIndexMN_M_Extension)->menu());
4391
4392 /* Mark menu as valid: */
4393 m_invalidations.remove(UIActionIndexMN_M_Extension);
4394}
4395
4396void UIActionPoolManager::updateMenuExtensionWrapper(UIMenu *pMenu)
4397{
4398 /* Clear contents: */
4399 pMenu->clear();
4400
4401 /* 'Add' action: */
4402 addAction(pMenu, action(UIActionIndexMN_M_Extension_S_Install));
4403 /* 'Remove' action: */
4404 addAction(pMenu, action(UIActionIndexMN_M_Extension_S_Uninstall));
4405}
4406
4407void UIActionPoolManager::updateMenuMediumWindow()
4408{
4409 /* Update corresponding menu: */
4410 updateMenuMediumWrapper(action(UIActionIndexMN_M_MediumWindow)->menu());
4411
4412 /* Mark menu as valid: */
4413 m_invalidations.remove(UIActionIndexMN_M_MediumWindow);
4414}
4415
4416void UIActionPoolManager::updateMenuMedium()
4417{
4418 /* Update corresponding menu: */
4419 updateMenuMediumWrapper(action(UIActionIndexMN_M_Medium)->menu());
4420
4421 /* Mark menu as valid: */
4422 m_invalidations.remove(UIActionIndexMN_M_Medium);
4423}
4424
4425void UIActionPoolManager::updateMenuMediumWrapper(UIMenu *pMenu)
4426{
4427 /* Clear contents: */
4428 pMenu->clear();
4429
4430 /* Separator? */
4431 bool fSeparator = false;
4432
4433 /* 'Add' action: */
4434 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Add)) || fSeparator;
4435 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Create)) || fSeparator;
4436
4437 /* Separator? */
4438 if (fSeparator)
4439 {
4440 pMenu->addSeparator();
4441 fSeparator = false;
4442 }
4443
4444 /* 'Copy' action: */
4445 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Copy)) || fSeparator;
4446 /* 'Move' action: */
4447 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Move)) || fSeparator;
4448 /* 'Remove' action: */
4449 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Remove)) || fSeparator;
4450 /* 'Release' action: */
4451 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Release)) || fSeparator;
4452 /* 'Clear' action: */
4453 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Clear)) || fSeparator;
4454 /* 'Search' action: */
4455 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_T_Search)) || fSeparator;
4456 /* 'Properties' action: */
4457 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_T_Details)) || fSeparator;
4458
4459 /* Separator? */
4460 if (fSeparator)
4461 {
4462 pMenu->addSeparator();
4463 fSeparator = false;
4464 }
4465
4466 /* 'Refresh' action: */
4467 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Refresh)) || fSeparator;;
4468}
4469
4470void UIActionPoolManager::updateMenuNetworkWindow()
4471{
4472 /* Update corresponding menu: */
4473 updateMenuNetworkWrapper(action(UIActionIndexMN_M_NetworkWindow)->menu());
4474
4475 /* Mark menu as valid: */
4476 m_invalidations.remove(UIActionIndexMN_M_NetworkWindow);
4477}
4478
4479void UIActionPoolManager::updateMenuNetwork()
4480{
4481 /* Update corresponding menu: */
4482 updateMenuNetworkWrapper(action(UIActionIndexMN_M_Network)->menu());
4483
4484 /* Mark menu as valid: */
4485 m_invalidations.remove(UIActionIndexMN_M_Network);
4486}
4487
4488void UIActionPoolManager::updateMenuNetworkWrapper(UIMenu *pMenu)
4489{
4490 /* Clear contents: */
4491 pMenu->clear();
4492
4493 /* Separator? */
4494 bool fSeparator = false;
4495
4496 /* 'Create' action: */
4497 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Network_S_Create)) || fSeparator;
4498
4499 /* Separator? */
4500 if (fSeparator)
4501 {
4502 pMenu->addSeparator();
4503 fSeparator = false;
4504 }
4505
4506 /* 'Remove' action: */
4507 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Network_S_Remove)) || fSeparator;
4508 /* 'Properties' action: */
4509 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Network_T_Details)) || fSeparator;
4510
4511// /* Separator? */
4512// if (fSeparator)
4513// {
4514// pMenu->addSeparator();
4515// fSeparator = false;
4516// }
4517
4518// /* 'Refresh' action: */
4519// fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Network_S_Refresh)) || fSeparator;;
4520}
4521
4522void UIActionPoolManager::updateMenuCloudWindow()
4523{
4524 /* Update corresponding menu: */
4525 updateMenuCloudWrapper(action(UIActionIndexMN_M_CloudWindow)->menu());
4526
4527 /* Mark menu as valid: */
4528 m_invalidations.remove(UIActionIndexMN_M_CloudWindow);
4529}
4530
4531void UIActionPoolManager::updateMenuCloud()
4532{
4533 /* Update corresponding menu: */
4534 updateMenuCloudWrapper(action(UIActionIndexMN_M_Cloud)->menu());
4535
4536 /* Mark menu as valid: */
4537 m_invalidations.remove(UIActionIndexMN_M_Cloud);
4538}
4539
4540void UIActionPoolManager::updateMenuCloudWrapper(UIMenu *pMenu)
4541{
4542 /* Clear contents: */
4543 pMenu->clear();
4544
4545 /* Separator? */
4546 bool fSeparator = false;
4547
4548 /* 'Add' action: */
4549 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Cloud_S_Add)) || fSeparator;
4550 /* 'Import' action: */
4551 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Cloud_S_Import)) || fSeparator;
4552
4553 /* Separator? */
4554 if (fSeparator)
4555 {
4556 pMenu->addSeparator();
4557 fSeparator = false;
4558 }
4559
4560 /* 'Remove' action: */
4561 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Cloud_S_Remove)) || fSeparator;
4562 /* 'Properties' action: */
4563 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Cloud_T_Details)) || fSeparator;
4564
4565 /* Separator? */
4566 if (fSeparator)
4567 {
4568 pMenu->addSeparator();
4569 fSeparator = false;
4570 }
4571
4572 /* 'Try Page' action: */
4573 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Cloud_S_TryPage)) || fSeparator;
4574 /* 'Help' action: */
4575 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Cloud_S_Help)) || fSeparator;
4576}
4577
4578void UIActionPoolManager::updateMenuCloudConsoleWindow()
4579{
4580 /* Update corresponding menu: */
4581 updateMenuCloudConsoleWrapper(action(UIActionIndexMN_M_CloudConsoleWindow)->menu());
4582
4583 /* Mark menu as valid: */
4584 m_invalidations.remove(UIActionIndexMN_M_CloudConsoleWindow);
4585}
4586
4587void UIActionPoolManager::updateMenuCloudConsole()
4588{
4589 /* Update corresponding menu: */
4590 updateMenuCloudConsoleWrapper(action(UIActionIndexMN_M_CloudConsole)->menu());
4591
4592 /* Mark menu as valid: */
4593 m_invalidations.remove(UIActionIndexMN_M_CloudConsole);
4594}
4595
4596void UIActionPoolManager::updateMenuCloudConsoleWrapper(UIMenu *pMenu)
4597{
4598 /* Clear contents: */
4599 pMenu->clear();
4600
4601 /* Separator? */
4602 bool fSeparator = false;
4603
4604 /* 'Add Application' action: */
4605 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_CloudConsole_S_ApplicationAdd)) || fSeparator;
4606 /* 'Remove Application' action: */
4607 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_CloudConsole_S_ApplicationRemove)) || fSeparator;
4608
4609 /* Separator? */
4610 if (fSeparator)
4611 {
4612 pMenu->addSeparator();
4613 fSeparator = false;
4614 }
4615
4616 /* 'Add Profile' action: */
4617 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_CloudConsole_S_ProfileAdd)) || fSeparator;
4618 /* 'Remove Profile' action: */
4619 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_CloudConsole_S_ProfileRemove)) || fSeparator;
4620
4621 /* Separator? */
4622 if (fSeparator)
4623 {
4624 pMenu->addSeparator();
4625 fSeparator = false;
4626 }
4627
4628 /* 'Properties' action: */
4629 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_CloudConsole_T_Details)) || fSeparator;
4630}
4631
4632void UIActionPoolManager::updateMenuVMActivityOverview()
4633{
4634 /* Update corresponding menu: */
4635 updateMenuVMActivityOverviewWrapper(action(UIActionIndexMN_M_VMActivityOverview)->menu());
4636
4637 /* Mark menu as valid: */
4638 m_invalidations.remove(UIActionIndexMN_M_VMActivityOverview);
4639}
4640
4641void UIActionPoolManager::updateMenuVMActivityOverviewWrapper(UIMenu *pMenu)
4642{
4643 /* Clear contents: */
4644 pMenu->clear();
4645 addAction(pMenu, action(UIActionIndexMN_M_VMActivityOverview_M_Columns));
4646 addAction(pMenu, action(UIActionIndexMN_M_VMActivityOverview_S_SwitchToMachineActivity));
4647}
4648
4649void UIActionPoolManager::updateMenuSnapshot()
4650{
4651 /* Get corresponding menu: */
4652 UIMenu *pMenu = action(UIActionIndexMN_M_Snapshot)->menu();
4653 AssertPtrReturnVoid(pMenu);
4654 /* Clear contents: */
4655 pMenu->clear();
4656
4657 /* Populate Snapshot-menu: */
4658 const bool fExpertMode = gEDataManager->isSettingsInExpertMode();
4659 pMenu->addAction(action(UIActionIndexMN_M_Snapshot_S_Take));
4660 pMenu->addAction(action(UIActionIndexMN_M_Snapshot_S_Delete));
4661 pMenu->addAction(action(UIActionIndexMN_M_Snapshot_S_Restore));
4662 pMenu->addAction(action(UIActionIndexMN_M_Snapshot_T_Properties));
4663 if (fExpertMode)
4664 pMenu->addAction(action(UIActionIndexMN_M_Snapshot_S_Clone));
4665
4666 /* Mark menu as valid: */
4667 m_invalidations.remove(UIActionIndexMN_M_Snapshot);
4668}
4669
4670
4671#include "UIActionPoolManager.moc"
Note: See TracBrowser for help on using the repository browser.

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