VirtualBox

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

Last change on this file was 104393, checked in by vboxsync, 4 weeks ago

FE/Qt. bugref:10622. Using new UITranslationEventListener in the UIActionPool class.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 170.6 KB
Line 
1/* $Id: UIActionPoolManager.cpp 104393 2024-04-22 13:02:56Z 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 <QApplication>
30#include <QActionGroup>
31
32/* GUI includes: */
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(UIType) 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(UIType) 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(UIType) 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(UIType) 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(UIType) 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(UIType) 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(UIType) 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(UIType) 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(UIType) 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(UIType) 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(UIType) 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(UIType) 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(UIType) 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(UIType) 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 'Perform Refresh' action class. */
1278class UIActionSimpleManagerCommonPerformRefresh : public UIActionSimple
1279{
1280 Q_OBJECT;
1281
1282public:
1283
1284 /** Constructs action passing @a pParent to the base-class. */
1285 UIActionSimpleManagerCommonPerformRefresh(UIActionPool *pParent)
1286 : UIActionSimple(pParent,
1287 ":/refresh_32px.png", ":/refresh_16px.png",
1288 ":/refresh_disabled_32px.png", ":/refresh_disabled_16px.png")
1289 {}
1290
1291protected:
1292
1293 /** Returns shortcut extra-data ID. */
1294 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1295 {
1296 return QString("RefreshVM");
1297 }
1298
1299 /** Handles translation event. */
1300 virtual void retranslateUi() RT_OVERRIDE
1301 {
1302 setName(QApplication::translate("UIActionPool", "Re&fresh"));
1303 setStatusTip(QApplication::translate("UIActionPool", "Refresh accessibility state of selected virtual machines"));
1304 }
1305};
1306
1307/** Simple action extension, used as 'Show in File Manager' action class. */
1308class UIActionSimpleManagerCommonShowInFileManager : public UIActionSimple
1309{
1310 Q_OBJECT;
1311
1312public:
1313
1314 /** Constructs action passing @a pParent to the base-class. */
1315 UIActionSimpleManagerCommonShowInFileManager(UIActionPool *pParent)
1316 : UIActionSimple(pParent, ":/vm_open_filemanager_16px.png", ":/vm_open_filemanager_disabled_16px.png")
1317 {}
1318
1319protected:
1320
1321 /** Returns shortcut extra-data ID. */
1322 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1323 {
1324 return QString("ShowVMInFileManager");
1325 }
1326
1327 /** Handles translation event. */
1328 virtual void retranslateUi() RT_OVERRIDE
1329 {
1330#if defined(VBOX_WS_MAC)
1331 setName(QApplication::translate("UIActionPool", "S&how in Finder"));
1332 setStatusTip(QApplication::translate("UIActionPool", "Show the VirtualBox Machine Definition files in Finder"));
1333#elif defined(VBOX_WS_WIN)
1334 setName(QApplication::translate("UIActionPool", "S&how in Explorer"));
1335 setStatusTip(QApplication::translate("UIActionPool", "Show the VirtualBox Machine Definition files in Explorer"));
1336#else
1337 setName(QApplication::translate("UIActionPool", "S&how in File Manager"));
1338 setStatusTip(QApplication::translate("UIActionPool", "Show the VirtualBox Machine Definition files in the File Manager"));
1339#endif
1340 }
1341};
1342
1343/** Simple action extension, used as 'Perform Create Shortcut' action class. */
1344class UIActionSimpleManagerCommonPerformCreateShortcut : public UIActionSimple
1345{
1346 Q_OBJECT;
1347
1348public:
1349
1350 /** Constructs action passing @a pParent to the base-class. */
1351 UIActionSimpleManagerCommonPerformCreateShortcut(UIActionPool *pParent)
1352 : UIActionSimple(pParent, ":/vm_create_shortcut_16px.png", ":/vm_create_shortcut_disabled_16px.png")
1353 {}
1354
1355protected:
1356
1357 /** Returns shortcut extra-data ID. */
1358 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1359 {
1360 return QString("CreateVMAlias");
1361 }
1362
1363 /** Handles translation event. */
1364 virtual void retranslateUi() RT_OVERRIDE
1365 {
1366#if defined(VBOX_WS_MAC)
1367 setName(QApplication::translate("UIActionPool", "Cr&eate Alias on Desktop"));
1368 setStatusTip(QApplication::translate("UIActionPool", "Create alias files to the VirtualBox Machine Definition files on your desktop"));
1369#else
1370 setName(QApplication::translate("UIActionPool", "Cr&eate Shortcut on Desktop"));
1371 setStatusTip(QApplication::translate("UIActionPool", "Create shortcut files to the VirtualBox Machine Definition files on your desktop"));
1372#endif
1373 }
1374};
1375
1376/** Toggle action extension, used as 'Search' action class. */
1377class UIActionToggleManagerCommonToggleSearch : public UIActionToggle
1378{
1379 Q_OBJECT;
1380
1381public:
1382
1383 /** Constructs action passing @a pParent to the base-class. */
1384 UIActionToggleManagerCommonToggleSearch(UIActionPool *pParent)
1385 : UIActionToggle(pParent,
1386 ":/search_16px.png", ":/search_16px.png",
1387 ":/search_16px.png", ":/search_16px.png") /// @todo use icons with check-boxes
1388 {}
1389
1390protected:
1391
1392 /** Returns shortcut extra-data ID. */
1393 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1394 {
1395 return QString("SearchVM");
1396 }
1397
1398 /** Returns default shortcut. */
1399 virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
1400 {
1401 return QKeySequence("Ctrl+F");
1402 }
1403
1404 /** Handles translation event. */
1405 virtual void retranslateUi() RT_OVERRIDE
1406 {
1407 setName(QApplication::translate("UIActionPool", "S&earch"));
1408 setStatusTip(QApplication::translate("UIActionPool", "Search virtual machines with respect to a search term"));
1409 }
1410};
1411
1412
1413/** Menu action extension, used as 'Console' menu class. */
1414class UIActionMenuManagerConsole : public UIActionMenu
1415{
1416 Q_OBJECT;
1417
1418public:
1419
1420 /** Constructs action passing @a pParent to the base-class. */
1421 UIActionMenuManagerConsole(UIActionPool *pParent)
1422 : UIActionMenu(pParent, ":/cloud_machine_console_16px.png")
1423 {}
1424
1425protected:
1426
1427 /** Handles translation event. */
1428 virtual void retranslateUi() RT_OVERRIDE
1429 {
1430 setName(QApplication::translate("UIActionPool", "C&onsole"));
1431 }
1432};
1433
1434/** Simple action extension, used as 'Perform Create Console Connection' action class. */
1435class UIActionSimpleManagerConsolePerformCreateConnection : public UIActionSimple
1436{
1437 Q_OBJECT;
1438
1439public:
1440
1441 /** Constructs action passing @a pParent to the base-class. */
1442 UIActionSimpleManagerConsolePerformCreateConnection(UIActionPool *pParent)
1443 : UIActionSimple(pParent,
1444 ":/cloud_machine_console_create_connection_16px.png",
1445 ":/cloud_machine_console_create_connection_disabled_16px.png")
1446 {}
1447
1448protected:
1449
1450 /** Returns shortcut extra-data ID. */
1451 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1452 {
1453 return QString("CreateConsoleConnection");
1454 }
1455
1456 /** Handles translation event. */
1457 virtual void retranslateUi() RT_OVERRIDE
1458 {
1459 setName(QApplication::translate("UIActionPool", "&Create Connection"));
1460 setStatusTip(QApplication::translate("UIActionPool", "Create console connection to be able to use ssh/vnc clients"));
1461 }
1462};
1463
1464/** Simple action extension, used as 'Perform Delete Console Connection' action class. */
1465class UIActionSimpleManagerConsolePerformDeleteConnection : public UIActionSimple
1466{
1467 Q_OBJECT;
1468
1469public:
1470
1471 /** Constructs action passing @a pParent to the base-class. */
1472 UIActionSimpleManagerConsolePerformDeleteConnection(UIActionPool *pParent)
1473 : UIActionSimple(pParent,
1474 ":/cloud_machine_console_delete_connection_16px.png",
1475 ":/cloud_machine_console_delete_connection_disabled_16px.png")
1476 {}
1477
1478protected:
1479
1480 /** Returns shortcut extra-data ID. */
1481 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1482 {
1483 return QString("DeleteConsoleConnection");
1484 }
1485
1486 /** Handles translation event. */
1487 virtual void retranslateUi() RT_OVERRIDE
1488 {
1489 setName(QApplication::translate("UIActionPool", "&Delete Connection"));
1490 setStatusTip(QApplication::translate("UIActionPool", "Delete console connection to disconnect ssh/vnc clients"));
1491 }
1492};
1493
1494/** Simple action extension, used as 'Perform Configure Applications' action class. */
1495class UIActionSimpleManagerConsolePerformConfigureApplications : public UIActionSimple
1496{
1497 Q_OBJECT;
1498
1499public:
1500
1501 /** Constructs action passing @a pParent to the base-class. */
1502 UIActionSimpleManagerConsolePerformConfigureApplications(UIActionPool *pParent)
1503 : UIActionSimple(pParent,
1504 ":/cloud_machine_console_configure_external_terminal_16px.png",
1505 ":/cloud_machine_console_configure_external_terminal_disabled_16px.png")
1506 {
1507 setProperty("UIToolType", QVariant::fromValue(UIToolType_CloudConsole));
1508 }
1509
1510protected:
1511
1512 /** Returns shortcut extra-data ID. */
1513 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1514 {
1515 return QString("ConfigureConsoleApplications");
1516 }
1517
1518 /** Handles translation event. */
1519 virtual void retranslateUi() RT_OVERRIDE
1520 {
1521 setName(QApplication::translate("UIActionPool", "&Configure Console Applications"));
1522 setStatusTip(QApplication::translate("UIActionPool", "Open configuration dialog to edit console application settings"));
1523 }
1524};
1525
1526/** Simple action extension, used as 'Copy Command' action class. */
1527class UIActionSimpleManagerConsolePerformCopyCommand : public UIActionSimple
1528{
1529 Q_OBJECT;
1530
1531public:
1532
1533 /** Constructs action passing @a pParent to the base-class. */
1534 UIActionSimpleManagerConsolePerformCopyCommand(UIActionPool *pParent, bool fSerial, bool fUnix)
1535 : UIActionSimple(pParent)
1536 , m_fSerial(fSerial)
1537 , m_fUnix(fUnix)
1538 {
1539 if (m_fSerial)
1540 setIcon(UIIconPool::iconSet(":/cloud_machine_console_get_serial_console_command_16px.png",
1541 ":/cloud_machine_console_get_serial_console_command_disabled_16px.png"));
1542 else
1543 setIcon(UIIconPool::iconSet(":/cloud_machine_console_get_vnc_console_command_16px.png",
1544 ":/cloud_machine_console_get_vnc_console_command_disabled_16px.png"));
1545 }
1546
1547protected:
1548
1549 /** Returns shortcut extra-data ID. */
1550 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1551 {
1552 return m_fSerial
1553 ? QString("CopyConsoleCommandSerial")
1554 : QString("CopyConsoleCommandVNC");
1555 }
1556
1557 /** Handles translation event. */
1558 virtual void retranslateUi() RT_OVERRIDE
1559 {
1560 if (m_fSerial)
1561 {
1562 if (m_fUnix)
1563 setName(QApplication::translate("UIActionPool", "&Copy Command (serial) for Unix"));
1564 else
1565 setName(QApplication::translate("UIActionPool", "&Copy Command (serial) for Windows"));
1566 setStatusTip(QApplication::translate("UIActionPool", "Copy console command for serial connection"));
1567 }
1568 else
1569 {
1570 if (m_fUnix)
1571 setName(QApplication::translate("UIActionPool", "&Copy Command (VNC) for Unix"));
1572 else
1573 setName(QApplication::translate("UIActionPool", "&Copy Command (VNC) for Windows"));
1574 setStatusTip(QApplication::translate("UIActionPool", "Copy console command for VNC connection"));
1575 }
1576 }
1577
1578private:
1579
1580 /** Holds whether this command is of serial type. */
1581 bool m_fSerial;
1582 /** Holds whether this command is for unix. */
1583 bool m_fUnix;
1584};
1585
1586/** Simple action extension, used as 'Show Log' action class. */
1587class UIActionSimpleManagerConsolePerformShowLog : public UIActionSimple
1588{
1589 Q_OBJECT;
1590
1591public:
1592
1593 /** Constructs action passing @a pParent to the base-class. */
1594 UIActionSimpleManagerConsolePerformShowLog(UIActionPool *pParent)
1595 : UIActionSimple(pParent,
1596 ":/vm_show_logs_16px.png",
1597 ":/vm_show_logs_disabled_16px.png")
1598 {}
1599
1600protected:
1601
1602 /** Returns shortcut extra-data ID. */
1603 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1604 {
1605 return QString("ShowConsoleLog");
1606 }
1607
1608 /** Handles translation event. */
1609 virtual void retranslateUi() RT_OVERRIDE
1610 {
1611 setName(QApplication::translate("UIActionPool", "Show &Log"));
1612 setStatusTip(QApplication::translate("UIActionPool", "Show cloud console log"));
1613 }
1614};
1615
1616
1617/** Menu action extension, used as 'Stop' menu class. */
1618class UIActionMenuManagerStop : public UIActionMenu
1619{
1620 Q_OBJECT;
1621
1622public:
1623
1624 /** Constructs action passing @a pParent to the base-class. */
1625 UIActionMenuManagerStop(UIActionPool *pParent)
1626 : UIActionMenu(pParent, ":/exit_16px.png")
1627 {}
1628
1629protected:
1630
1631 /** Handles translation event. */
1632 virtual void retranslateUi() RT_OVERRIDE
1633 {
1634 setName(QApplication::translate("UIActionPool", "&Stop"));
1635 }
1636};
1637
1638/** Simple action extension, used as 'Perform Save' action class. */
1639class UIActionSimpleManagerStopPerformSave : public UIActionSimple
1640{
1641 Q_OBJECT;
1642
1643public:
1644
1645 /** Constructs action passing @a pParent to the base-class. */
1646 UIActionSimpleManagerStopPerformSave(UIActionPool *pParent)
1647 : UIActionSimple(pParent, ":/vm_save_state_16px.png", ":/vm_save_state_disabled_16px.png")
1648 {}
1649
1650protected:
1651
1652 /** Returns shortcut extra-data ID. */
1653 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1654 {
1655 return QString("SaveVM");
1656 }
1657
1658 /** Handles translation event. */
1659 virtual void retranslateUi() RT_OVERRIDE
1660 {
1661 setName(QApplication::translate("UIActionPool", "&Save State"));
1662 setStatusTip(QApplication::translate("UIActionPool", "Save state of selected virtual machines"));
1663 }
1664};
1665
1666/** Simple action extension, used as 'Perform Terminate' action class. */
1667class UIActionSimpleManagerStopPerformTerminate : public UIActionSimple
1668{
1669 Q_OBJECT;
1670
1671public:
1672
1673 /** Constructs action passing @a pParent to the base-class. */
1674 UIActionSimpleManagerStopPerformTerminate(UIActionPool *pParent)
1675 : UIActionSimple(pParent, ":/vm_discard_16px.png", ":/vm_discard_disabled_16px.png")
1676 {}
1677
1678protected:
1679
1680 /** Returns shortcut extra-data ID. */
1681 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1682 {
1683 return QString("TerminateVM");
1684 }
1685
1686 /** Handles translation event. */
1687 virtual void retranslateUi() RT_OVERRIDE
1688 {
1689 setIconText(QApplication::translate("UIActionPool", "Terminate"));
1690 setName(QApplication::translate("UIActionPool", "&Terminate Cloud Instance..."));
1691 setStatusTip(QApplication::translate("UIActionPool", "Terminate cloud instance of selected virtual machines"));
1692 setToolTip(simplifyText(text()) + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
1693 }
1694};
1695
1696/** Simple action extension, used as 'Perform Shutdown' action class. */
1697class UIActionSimpleManagerStopPerformShutdown : public UIActionSimple
1698{
1699 Q_OBJECT;
1700
1701public:
1702
1703 /** Constructs action passing @a pParent to the base-class. */
1704 UIActionSimpleManagerStopPerformShutdown(UIActionPool *pParent)
1705 : UIActionSimple(pParent, ":/vm_shutdown_16px.png", ":/vm_shutdown_disabled_16px.png")
1706 {}
1707
1708protected:
1709
1710 /** Returns shortcut extra-data ID. */
1711 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1712 {
1713 return QString("ACPIShutdownVM");
1714 }
1715
1716 /** Handles translation event. */
1717 virtual void retranslateUi() RT_OVERRIDE
1718 {
1719 setName(QApplication::translate("UIActionPool", "ACPI Sh&utdown"));
1720 setStatusTip(QApplication::translate("UIActionPool", "Send ACPI Shutdown signal to selected virtual machines"));
1721 }
1722};
1723
1724/** Simple action extension, used as 'Perform PowerOff' action class. */
1725class UIActionSimpleManagerStopPerformPowerOff : public UIActionSimple
1726{
1727 Q_OBJECT;
1728
1729public:
1730
1731 /** Constructs action passing @a pParent to the base-class. */
1732 UIActionSimpleManagerStopPerformPowerOff(UIActionPool *pParent)
1733 : UIActionSimple(pParent, ":/vm_poweroff_16px.png", ":/vm_poweroff_disabled_16px.png")
1734 {}
1735
1736protected:
1737
1738 /** Returns shortcut extra-data ID. */
1739 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1740 {
1741 return QString("PowerOffVM");
1742 }
1743
1744 /** Handles translation event. */
1745 virtual void retranslateUi() RT_OVERRIDE
1746 {
1747 setName(QApplication::translate("UIActionPool", "Po&wer Off"));
1748 setStatusTip(QApplication::translate("UIActionPool", "Power off selected virtual machines"));
1749 }
1750};
1751
1752
1753/** Menu action extension, used as 'Machine Tools' menu class. */
1754class UIActionMenuManagerToolsMachine : public UIActionMenu
1755{
1756 Q_OBJECT;
1757
1758public:
1759
1760 /** Constructs action passing @a pParent to the base-class. */
1761 UIActionMenuManagerToolsMachine(UIActionPool *pParent)
1762 : UIActionMenu(pParent, ":/tools_menu_24px.png") /// @todo replace with 16px icon
1763 {}
1764
1765protected:
1766
1767 /** Returns shortcut extra-data ID. */
1768 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1769 {
1770 return QString("ToolsMachineMenu");
1771 }
1772
1773 /** Handles translation event. */
1774 virtual void retranslateUi() RT_OVERRIDE
1775 {
1776 setName(QApplication::translate("UIActionPool", "Tools"));
1777 }
1778};
1779
1780/** Simple action extension, used as 'Show Machine Details' action class. */
1781class UIActionToggleManagerToolsMachineShowDetails : public UIActionToggle
1782{
1783 Q_OBJECT;
1784
1785public:
1786
1787 /** Constructs action passing @a pParent to the base-class. */
1788 UIActionToggleManagerToolsMachineShowDetails(UIActionPool *pParent)
1789 : UIActionToggle(pParent)
1790 {
1791 setProperty("UIToolType", QVariant::fromValue(UIToolType_Details));
1792 /// @todo use icons with check-boxes
1793 setIcon(UIIconPool::iconSetFull(":/machine_details_manager_24px.png", ":/machine_details_manager_16px.png",
1794 ":/machine_details_manager_disabled_24px.png", ":/machine_details_manager_disabled_16px.png"));
1795 }
1796
1797protected:
1798
1799 /** Returns shortcut extra-data ID. */
1800 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1801 {
1802 return QString("ToolsMachineDetails");
1803 }
1804
1805 /** Handles translation event. */
1806 virtual void retranslateUi() RT_OVERRIDE
1807 {
1808 setName(QApplication::translate("UIActionPool", "&Details"));
1809 setStatusTip(QApplication::translate("UIActionPool", "Open the machine details pane"));
1810 }
1811};
1812
1813/** Simple action extension, used as 'Show Machine Snapshots' action class. */
1814class UIActionToggleManagerToolsMachineShowSnapshots : public UIActionToggle
1815{
1816 Q_OBJECT;
1817
1818public:
1819
1820 /** Constructs action passing @a pParent to the base-class. */
1821 UIActionToggleManagerToolsMachineShowSnapshots(UIActionPool *pParent)
1822 : UIActionToggle(pParent)
1823 {
1824 setProperty("UIToolType", QVariant::fromValue(UIToolType_Snapshots));
1825 /// @todo use icons with check-boxes
1826 setIcon(UIIconPool::iconSetFull(":/snapshot_manager_24px.png", ":/snapshot_manager_16px.png",
1827 ":/snapshot_manager_disabled_24px.png", ":/snapshot_manager_disabled_16px.png"));
1828 }
1829
1830protected:
1831
1832 /** Returns shortcut extra-data ID. */
1833 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1834 {
1835 return QString("ToolsMachineSnapshots");
1836 }
1837
1838 /** Handles translation event. */
1839 virtual void retranslateUi() RT_OVERRIDE
1840 {
1841 setName(QApplication::translate("UIActionPool", "&Snapshots"));
1842 setStatusTip(QApplication::translate("UIActionPool", "Open the machine snapshots pane"));
1843 }
1844};
1845
1846/** Simple action extension, used as 'Show Machine Logs' action class. */
1847class UIActionToggleManagerToolsMachineShowLogs : public UIActionToggle
1848{
1849 Q_OBJECT;
1850
1851public:
1852
1853 /** Constructs action passing @a pParent to the base-class. */
1854 UIActionToggleManagerToolsMachineShowLogs(UIActionPool *pParent)
1855 : UIActionToggle(pParent)
1856 {
1857 setProperty("UIToolType", QVariant::fromValue(UIToolType_Logs));
1858 /// @todo use icons with check-boxes
1859 setIcon(UIIconPool::iconSetFull(":/vm_show_logs_32px.png", ":/vm_show_logs_16px.png",
1860 ":/vm_show_logs_disabled_32px.png", ":/vm_show_logs_disabled_16px.png"));
1861 }
1862
1863protected:
1864
1865 /** Returns shortcut extra-data ID. */
1866 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1867 {
1868 return QString("ToolsMachineLogViewer");
1869 }
1870
1871 /** Returns default shortcut. */
1872 virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
1873 {
1874 return QKeySequence("Ctrl+L");
1875 }
1876
1877 /** Handles translation event. */
1878 virtual void retranslateUi() RT_OVERRIDE
1879 {
1880 setName(QApplication::translate("UIActionPool", "&Logs"));
1881 setStatusTip(QApplication::translate("UIActionPool", "Open the machine logs pane"));
1882 }
1883};
1884
1885/** Simple action extension, used as 'Show VM Activity Monitor' action class. */
1886class UIActionToggleManagerToolsMachineShowActivity : public UIActionToggle
1887{
1888 Q_OBJECT;
1889
1890public:
1891
1892 /** Constructs action passing @a pParent to the base-class. */
1893 UIActionToggleManagerToolsMachineShowActivity(UIActionPool *pParent)
1894 : UIActionToggle(pParent)
1895 {
1896 setProperty("UIToolType", QVariant::fromValue(UIToolType_VMActivity));
1897 /// @todo use icons with check-boxes
1898 setIcon(UIIconPool::iconSetFull(":/performance_monitor_32px.png", ":/performance_monitor_16px.png",
1899 ":/performance_monitor_disabled_32px.png", ":/performance_monitor_disabled_16px.png"));
1900 }
1901
1902protected:
1903
1904 /** Returns shortcut extra-data ID. */
1905 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1906 {
1907 return QString("ToolsMachineVMActivityMonitor");
1908 }
1909
1910 /** Handles translation event. */
1911 virtual void retranslateUi() RT_OVERRIDE
1912 {
1913 setName(QApplication::translate("UIActionPool", "&Activity"));
1914 setStatusTip(QApplication::translate("UIActionPool", "Open the machine activity monitor pane"));
1915 }
1916};
1917
1918/** Simple action extension, used as 'Show File Manager' action class. */
1919class UIActionToggleManagerToolsMachineShowFileManager : public UIActionToggle
1920{
1921 Q_OBJECT;
1922
1923public:
1924
1925 /** Constructs action passing @a pParent to the base-class. */
1926 UIActionToggleManagerToolsMachineShowFileManager(UIActionPool *pParent)
1927 : UIActionToggle(pParent)
1928 {
1929 setProperty("UIToolType", QVariant::fromValue(UIToolType_FileManager));
1930 /// @todo use icons with check-boxes
1931 setIcon(UIIconPool::iconSetFull(":/file_manager_24px.png", ":/file_manager_16px.png",
1932 ":/file_manager_disabled_24px.png", ":/file_manager_disabled_16px.png"));
1933 }
1934
1935protected:
1936
1937 /** Returns shortcut extra-data ID. */
1938 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1939 {
1940 return QString("ToolsMachineFileManager");
1941 }
1942
1943 /** Handles translation event. */
1944 virtual void retranslateUi() RT_OVERRIDE
1945 {
1946 setName(QApplication::translate("UIActionPool", "&File Manager"));
1947 setStatusTip(QApplication::translate("UIActionPool", "Open the File Manager"));
1948 }
1949};
1950
1951
1952/** Menu action extension, used as 'Snapshot' menu class. */
1953class UIActionMenuManagerSnapshot : public UIActionMenu
1954{
1955 Q_OBJECT;
1956
1957public:
1958
1959 /** Constructs action passing @a pParent to the base-class. */
1960 UIActionMenuManagerSnapshot(UIActionPool *pParent)
1961 : UIActionMenu(pParent)
1962 {}
1963
1964protected:
1965
1966 /** Returns shortcut extra-data ID. */
1967 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1968 {
1969 return QString("SnapshotMenu");
1970 }
1971
1972 /** Handles translation event. */
1973 virtual void retranslateUi() RT_OVERRIDE
1974 {
1975 setName(QApplication::translate("UIActionPool", "&Snapshot"));
1976 }
1977};
1978
1979/** Simple action extension, used as 'Perform Take' action class. */
1980class UIActionMenuManagerSnapshotPerformTake : public UIActionSimple
1981{
1982 Q_OBJECT;
1983
1984public:
1985
1986 /** Constructs action passing @a pParent to the base-class. */
1987 UIActionMenuManagerSnapshotPerformTake(UIActionPool *pParent)
1988 : UIActionSimple(pParent,
1989 ":/snapshot_take_32px.png", ":/snapshot_take_16px.png",
1990 ":/snapshot_take_disabled_32px.png", ":/snapshot_take_disabled_16px.png")
1991 {
1992 setShortcutContext(Qt::WidgetWithChildrenShortcut);
1993 }
1994
1995protected:
1996
1997 /** Returns shortcut extra-data ID. */
1998 virtual QString shortcutExtraDataID() const RT_OVERRIDE
1999 {
2000 return QString("TakeSnapshot");
2001 }
2002
2003 /** Returns default shortcut. */
2004 virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
2005 {
2006 return QKeySequence("Ctrl+Shift+T");
2007 }
2008
2009 /** Handles translation event. */
2010 virtual void retranslateUi() RT_OVERRIDE
2011 {
2012 setName(QApplication::translate("UIActionPool", "&Take..."));
2013 setShortcutScope(QApplication::translate("UIActionPool", "Snapshot Pane"));
2014 setStatusTip(QApplication::translate("UIActionPool", "Take a snapshot of the current virtual machine state"));
2015 setToolTip( QApplication::translate("UIActionPool", "Take Snapshot")
2016 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2017 }
2018};
2019
2020/** Simple action extension, used as 'Perform Delete' action class. */
2021class UIActionMenuManagerSnapshotPerformDelete : public UIActionSimple
2022{
2023 Q_OBJECT;
2024
2025public:
2026
2027 /** Constructs action passing @a pParent to the base-class. */
2028 UIActionMenuManagerSnapshotPerformDelete(UIActionPool *pParent)
2029 : UIActionSimple(pParent,
2030 ":/snapshot_delete_32px.png", ":/snapshot_delete_16px.png",
2031 ":/snapshot_delete_disabled_32px.png", ":/snapshot_delete_disabled_16px.png")
2032 {
2033 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2034 }
2035
2036protected:
2037
2038 /** Returns shortcut extra-data ID. */
2039 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2040 {
2041 return QString("DeleteSnapshot");
2042 }
2043
2044 /** Returns default shortcut. */
2045 virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
2046 {
2047 return QKeySequence("Ctrl+Shift+D");
2048 }
2049
2050 /** Handles translation event. */
2051 virtual void retranslateUi() RT_OVERRIDE
2052 {
2053 setName(QApplication::translate("UIActionPool", "&Delete..."));
2054 setShortcutScope(QApplication::translate("UIActionPool", "Snapshot Pane"));
2055 setStatusTip(QApplication::translate("UIActionPool", "Delete selected snapshot of the virtual machine"));
2056 setToolTip( QApplication::translate("UIActionPool", "Delete Snapshot")
2057 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2058 }
2059};
2060
2061/** Simple action extension, used as 'Perform Restore' action class. */
2062class UIActionMenuManagerSnapshotPerformRestore : public UIActionSimple
2063{
2064 Q_OBJECT;
2065
2066public:
2067
2068 /** Constructs action passing @a pParent to the base-class. */
2069 UIActionMenuManagerSnapshotPerformRestore(UIActionPool *pParent)
2070 : UIActionSimple(pParent,
2071 ":/snapshot_restore_32px.png", ":/snapshot_restore_16px.png",
2072 ":/snapshot_restore_disabled_32px.png", ":/snapshot_restore_disabled_16px.png")
2073 {
2074 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2075 }
2076
2077protected:
2078
2079 /** Returns shortcut extra-data ID. */
2080 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2081 {
2082 return QString("RestoreSnapshot");
2083 }
2084
2085 /** Returns default shortcut. */
2086 virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
2087 {
2088 return QKeySequence("Ctrl+Shift+R");
2089 }
2090
2091 /** Handles translation event. */
2092 virtual void retranslateUi() RT_OVERRIDE
2093 {
2094 setName(QApplication::translate("UIActionPool", "&Restore..."));
2095 setShortcutScope(QApplication::translate("UIActionPool", "Snapshot Pane"));
2096 setStatusTip(QApplication::translate("UIActionPool", "Restore selected snapshot of the virtual machine"));
2097 setToolTip( QApplication::translate("UIActionPool", "Restore Snapshot")
2098 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2099 }
2100};
2101
2102/** Toggle action extension, used as 'Toggle Snapshot Properties' action class. */
2103class UIActionMenuManagerSnapshotToggleProperties : public UIActionToggle
2104{
2105 Q_OBJECT;
2106
2107public:
2108
2109 /** Constructs action passing @a pParent to the base-class. */
2110 UIActionMenuManagerSnapshotToggleProperties(UIActionPool *pParent)
2111 : UIActionToggle(pParent)
2112 {
2113 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2114 /// @todo use icons with check-boxes
2115 setIcon(UIIconPool::iconSetFull(":/snapshot_show_details_32px.png", ":/snapshot_show_details_16px.png",
2116 ":/snapshot_show_details_disabled_32px.png", ":/snapshot_show_details_disabled_16px.png"));
2117 }
2118
2119protected:
2120
2121 /** Returns shortcut extra-data ID. */
2122 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2123 {
2124 return QString("ToggleSnapshotProperties");
2125 }
2126
2127 /** Returns default shortcut. */
2128 virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
2129 {
2130 return QKeySequence("Ctrl+Shift+P");
2131 }
2132
2133 /** Handles translation event. */
2134 virtual void retranslateUi() RT_OVERRIDE
2135 {
2136 setName(QApplication::translate("UIActionPool", "&Properties"));
2137 setShortcutScope(QApplication::translate("UIActionPool", "Snapshot Pane"));
2138 setStatusTip(QApplication::translate("UIActionPool", "Open pane with the selected snapshot properties"));
2139 setToolTip( QApplication::translate("UIActionPool", "Open Snapshot Properties")
2140 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2141 }
2142};
2143
2144/** Simple action extension, used as 'Perform Clone' action class. */
2145class UIActionMenuManagerSnapshotPerformClone : public UIActionSimple
2146{
2147 Q_OBJECT;
2148
2149public:
2150
2151 /** Constructs action passing @a pParent to the base-class. */
2152 UIActionMenuManagerSnapshotPerformClone(UIActionPool *pParent)
2153 : UIActionSimple(pParent,
2154 ":/vm_clone_32px.png", ":/vm_clone_16px.png",
2155 ":/vm_clone_disabled_32px.png", ":/vm_clone_disabled_16px.png")
2156 {
2157 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2158 }
2159
2160protected:
2161
2162 /** Returns shortcut extra-data ID. */
2163 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2164 {
2165 return QString("CloneSnapshot");
2166 }
2167
2168 /** Returns default shortcut. */
2169 virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
2170 {
2171 return QKeySequence("Ctrl+Shift+C");
2172 }
2173
2174 /** Handles translation event. */
2175 virtual void retranslateUi() RT_OVERRIDE
2176 {
2177 setName(QApplication::translate("UIActionPool", "&Clone..."));
2178 setShortcutScope(QApplication::translate("UIActionPool", "Snapshot Pane"));
2179 setStatusTip(QApplication::translate("UIActionPool", "Clone selected virtual machine"));
2180 setToolTip( QApplication::translate("UIActionPool", "Clone Virtual Machine")
2181 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2182 }
2183};
2184
2185
2186/** Menu action extension, used as 'Extension' menu class. */
2187class UIActionMenuManagerExtension : public UIActionMenu
2188{
2189 Q_OBJECT;
2190
2191public:
2192
2193 /** Constructs action passing @a pParent to the base-class. */
2194 UIActionMenuManagerExtension(UIActionPool *pParent)
2195 : UIActionMenu(pParent)
2196 {}
2197
2198protected:
2199
2200 /** Returns shortcut extra-data ID. */
2201 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2202 {
2203 return QString("ExtensionMenu");
2204 }
2205
2206 /** Handles translation event. */
2207 virtual void retranslateUi() RT_OVERRIDE
2208 {
2209 setName(QApplication::translate("UIActionPool", "&Extension"));
2210 }
2211};
2212
2213/** Simple action extension, used as 'Perform Install' action class. */
2214class UIActionSimpleManagerExtensionPerformInstall : public UIActionSimple
2215{
2216 Q_OBJECT;
2217
2218public:
2219
2220 /** Constructs action passing @a pParent to the base-class. */
2221 UIActionSimpleManagerExtensionPerformInstall(UIActionPool *pParent)
2222 : UIActionSimple(pParent,
2223 ":/extension_pack_install_32px.png", ":/extension_pack_install_16px.png",
2224 ":/extension_pack_install_disabled_32px.png", ":/extension_pack_install_disabled_16px.png")
2225 {
2226 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2227 }
2228
2229protected:
2230
2231 /** Returns shortcut extra-data ID. */
2232 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2233 {
2234 return QString("InstallExtension");
2235 }
2236
2237 /** Returns default shortcut. */
2238 virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
2239 {
2240 return QKeySequence("Ctrl+Shift+I");
2241 }
2242
2243 /** Handles translation event. */
2244 virtual void retranslateUi() RT_OVERRIDE
2245 {
2246 setName(QApplication::translate("UIActionPool", "&Install..."));
2247 setShortcutScope(QApplication::translate("UIActionPool", "Extension Pack Manager"));
2248 setStatusTip(QApplication::translate("UIActionPool", "Install extension pack"));
2249 setToolTip( QApplication::translate("UIActionPool", "Install Extension Pack")
2250 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2251 }
2252};
2253
2254/** Simple action extension, used as 'Perform Uninstall' action class. */
2255class UIActionSimpleManagerExtensionPerformUninstall : public UIActionSimple
2256{
2257 Q_OBJECT;
2258
2259public:
2260
2261 /** Constructs action passing @a pParent to the base-class. */
2262 UIActionSimpleManagerExtensionPerformUninstall(UIActionPool *pParent)
2263 : UIActionSimple(pParent,
2264 ":/extension_pack_uninstall_32px.png", ":/extension_pack_uninstall_16px.png",
2265 ":/extension_pack_uninstall_disabled_32px.png", ":/extension_pack_uninstall_disabled_16px.png")
2266 {
2267 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2268 }
2269
2270protected:
2271
2272 /** Returns shortcut extra-data ID. */
2273 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2274 {
2275 return QString("UninstallExtension");
2276 }
2277
2278 /** Returns default shortcut. */
2279 virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
2280 {
2281 return QKeySequence("Ctrl+Shift+U");
2282 }
2283
2284 /** Handles translation event. */
2285 virtual void retranslateUi() RT_OVERRIDE
2286 {
2287 setName(QApplication::translate("UIActionPool", "&Uninstall..."));
2288 setShortcutScope(QApplication::translate("UIActionPool", "Extension Pack Manager"));
2289 setStatusTip(QApplication::translate("UIActionPool", "Uninstall selected extension pack"));
2290 setToolTip( QApplication::translate("UIActionPool", "Uninstall Extension Pack")
2291 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2292 }
2293};
2294
2295
2296/** Menu action extension, used as 'Medium' menu class. */
2297class UIActionMenuManagerMedium : public UIActionMenu
2298{
2299 Q_OBJECT;
2300
2301public:
2302
2303 /** Constructs action passing @a pParent to the base-class. */
2304 UIActionMenuManagerMedium(UIActionPool *pParent)
2305 : UIActionMenu(pParent)
2306 {}
2307
2308protected:
2309
2310 /** Returns shortcut extra-data ID. */
2311 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2312 {
2313 return QString("MediumMenu");
2314 }
2315
2316 /** Handles translation event. */
2317 virtual void retranslateUi() RT_OVERRIDE
2318 {
2319 setName(QApplication::translate("UIActionPool", "&Medium"));
2320 }
2321};
2322
2323/** Simple action extension, used as 'Perform Add' action class. */
2324class UIActionMenuManagerMediumPerformAdd : public UIActionSimple
2325{
2326 Q_OBJECT;
2327
2328public:
2329
2330 /** Constructs action passing @a pParent to the base-class. */
2331 UIActionMenuManagerMediumPerformAdd(UIActionPool *pParent)
2332 : UIActionSimple(pParent)
2333 {
2334 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2335 setIcon(0, UIIconPool::iconSetFull(":/hd_add_32px.png", ":/hd_add_16px.png",
2336 ":/hd_add_disabled_32px.png", ":/hd_add_disabled_16px.png"));
2337 setIcon(1, UIIconPool::iconSetFull(":/cd_add_32px.png", ":/cd_add_16px.png",
2338 ":/cd_add_disabled_32px.png", ":/cd_add_disabled_16px.png"));
2339 setIcon(2, UIIconPool::iconSetFull(":/fd_add_32px.png", ":/fd_add_16px.png",
2340 ":/fd_add_disabled_32px.png", ":/fd_add_disabled_16px.png"));
2341 }
2342
2343protected:
2344
2345 /** Returns shortcut extra-data ID. */
2346 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2347 {
2348 return QString("AddMedium");
2349 }
2350
2351 /** Returns default shortcut. */
2352 virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
2353 {
2354 return QKeySequence("Ctrl+Shift+A");
2355 }
2356
2357 /** Handles translation event. */
2358 virtual void retranslateUi() RT_OVERRIDE
2359 {
2360 setName(QApplication::translate("UIActionPool", "&Add..."));
2361 setShortcutScope(QApplication::translate("UIActionPool", "Media Manager"));
2362 setStatusTip(QApplication::translate("UIActionPool", "Add a disk image"));
2363 setToolTip( QApplication::translate("UIActionPool", "Add Disk Image")
2364 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2365 }
2366};
2367
2368/** Simple action extension, used as 'Perform Create' action class. */
2369class UIActionMenuManagerMediumPerformCreate : public UIActionSimple
2370{
2371 Q_OBJECT;
2372
2373public:
2374
2375 /** Constructs action passing @a pParent to the base-class. */
2376 UIActionMenuManagerMediumPerformCreate(UIActionPool *pParent)
2377 : UIActionSimple(pParent)
2378 {
2379 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2380 setIcon(0, UIIconPool::iconSetFull(":/hd_create_32px.png", ":/hd_create_16px.png",
2381 ":/hd_create_disabled_32px.png", ":/hd_create_disabled_16px.png"));
2382 setIcon(1, UIIconPool::iconSetFull(":/cd_create_32px.png", ":/cd_create_16px.png",
2383 ":/cd_create_disabled_32px.png", ":/cd_create_disabled_16px.png"));
2384 setIcon(2, UIIconPool::iconSetFull(":/fd_create_32px.png", ":/fd_create_16px.png",
2385 ":/fd_create_disabled_32px.png", ":/fd_create_disabled_16px.png"));
2386 }
2387
2388protected:
2389
2390 /** Returns shortcut extra-data ID. */
2391 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2392 {
2393 return QString("CreateMedium");
2394 }
2395
2396 /** Returns default shortcut. */
2397 virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
2398 {
2399 return QKeySequence("");
2400 }
2401
2402 /** Handles translation event. */
2403 virtual void retranslateUi() RT_OVERRIDE
2404 {
2405 setName(QApplication::translate("UIActionPool", "&Create..."));
2406 setShortcutScope(QApplication::translate("UIActionPool", "Media Manager"));
2407 setStatusTip(QApplication::translate("UIActionPool", "Create a new disk image"));
2408 setToolTip( QApplication::translate("UIActionPool", "Create Disk Image")
2409 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2410 }
2411};
2412
2413/** Simple action extension, used as 'Perform Copy' action class. */
2414class UIActionMenuManagerMediumPerformCopy : public UIActionSimple
2415{
2416 Q_OBJECT;
2417
2418public:
2419
2420 /** Constructs action passing @a pParent to the base-class. */
2421 UIActionMenuManagerMediumPerformCopy(UIActionPool *pParent)
2422 : UIActionSimple(pParent)
2423 {
2424 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2425 setIcon(0, UIIconPool::iconSetFull(":/hd_copy_32px.png", ":/hd_copy_16px.png",
2426 ":/hd_copy_disabled_32px.png", ":/hd_copy_disabled_16px.png"));
2427 setIcon(1, UIIconPool::iconSetFull(":/cd_copy_32px.png", ":/cd_copy_16px.png",
2428 ":/cd_copy_disabled_32px.png", ":/cd_copy_disabled_16px.png"));
2429 setIcon(2, UIIconPool::iconSetFull(":/fd_copy_32px.png", ":/fd_copy_16px.png",
2430 ":/fd_copy_disabled_32px.png", ":/fd_copy_disabled_16px.png"));
2431 }
2432
2433protected:
2434
2435 /** Returns shortcut extra-data ID. */
2436 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2437 {
2438 return QString("CopyMedium");
2439 }
2440
2441 /** Returns default shortcut. */
2442 virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
2443 {
2444 return QKeySequence("Ctrl+Shift+C");
2445 }
2446
2447 /** Handles translation event. */
2448 virtual void retranslateUi() RT_OVERRIDE
2449 {
2450 setName(QApplication::translate("UIActionPool", "&Copy..."));
2451 setShortcutScope(QApplication::translate("UIActionPool", "Media Manager"));
2452 setStatusTip(QApplication::translate("UIActionPool", "Copy selected disk image"));
2453 setToolTip( QApplication::translate("UIActionPool", "Copy Disk Image")
2454 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2455 }
2456};
2457
2458/** Simple action extension, used as 'Perform Move' action class. */
2459class UIActionMenuManagerMediumPerformMove : public UIActionSimple
2460{
2461 Q_OBJECT;
2462
2463public:
2464
2465 /** Constructs action passing @a pParent to the base-class. */
2466 UIActionMenuManagerMediumPerformMove(UIActionPool *pParent)
2467 : UIActionSimple(pParent)
2468 {
2469 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2470 setIcon(0, UIIconPool::iconSetFull(":/hd_move_32px.png", ":/hd_move_16px.png",
2471 ":/hd_move_disabled_32px.png", ":/hd_move_disabled_16px.png"));
2472 setIcon(1, UIIconPool::iconSetFull(":/cd_move_32px.png", ":/cd_move_16px.png",
2473 ":/cd_move_disabled_32px.png", ":/cd_move_disabled_16px.png"));
2474 setIcon(2, UIIconPool::iconSetFull(":/fd_move_32px.png", ":/fd_move_16px.png",
2475 ":/fd_move_disabled_32px.png", ":/fd_move_disabled_16px.png"));
2476 }
2477
2478protected:
2479
2480 /** Returns shortcut extra-data ID. */
2481 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2482 {
2483 return QString("MoveMedium");
2484 }
2485
2486 /** Returns default shortcut. */
2487 virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
2488 {
2489 return QKeySequence("Ctrl+Shift+M");
2490 }
2491
2492 /** Handles translation event. */
2493 virtual void retranslateUi() RT_OVERRIDE
2494 {
2495 setName(QApplication::translate("UIActionPool", "&Move..."));
2496 setShortcutScope(QApplication::translate("UIActionPool", "Media Manager"));
2497 setStatusTip(QApplication::translate("UIActionPool", "Move selected disk image"));
2498 setToolTip( QApplication::translate("UIActionPool", "Move Disk Image")
2499 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2500 }
2501};
2502
2503/** Simple action extension, used as 'Perform Remove' action class. */
2504class UIActionMenuManagerMediumPerformRemove : public UIActionSimple
2505{
2506 Q_OBJECT;
2507
2508public:
2509
2510 /** Constructs action passing @a pParent to the base-class. */
2511 UIActionMenuManagerMediumPerformRemove(UIActionPool *pParent)
2512 : UIActionSimple(pParent)
2513 {
2514 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2515 setIcon(0, UIIconPool::iconSetFull(":/hd_remove_32px.png", ":/hd_remove_16px.png",
2516 ":/hd_remove_disabled_32px.png", ":/hd_remove_disabled_16px.png"));
2517 setIcon(1, UIIconPool::iconSetFull(":/cd_remove_32px.png", ":/cd_remove_16px.png",
2518 ":/cd_remove_disabled_32px.png", ":/cd_remove_disabled_16px.png"));
2519 setIcon(2, UIIconPool::iconSetFull(":/fd_remove_32px.png", ":/fd_remove_16px.png",
2520 ":/fd_remove_disabled_32px.png", ":/fd_remove_disabled_16px.png"));
2521 }
2522
2523protected:
2524
2525 /** Returns shortcut extra-data ID. */
2526 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2527 {
2528 return QString("RemoveMedium");
2529 }
2530
2531 /** Returns default shortcut. */
2532 virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
2533 {
2534 return QKeySequence("Ctrl+Shift+R");
2535 }
2536
2537 /** Handles translation event. */
2538 virtual void retranslateUi() RT_OVERRIDE
2539 {
2540 setName(QApplication::translate("UIActionPool", "&Remove..."));
2541 setShortcutScope(QApplication::translate("UIActionPool", "Media Manager"));
2542 setStatusTip(QApplication::translate("UIActionPool", "Remove selected disk image"));
2543 setToolTip( QApplication::translate("UIActionPool", "Remove Disk Image")
2544 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2545 }
2546};
2547
2548/** Simple action extension, used as 'Perform Release' action class. */
2549class UIActionMenuManagerMediumPerformRelease : public UIActionSimple
2550{
2551 Q_OBJECT;
2552
2553public:
2554
2555 /** Constructs action passing @a pParent to the base-class. */
2556 UIActionMenuManagerMediumPerformRelease(UIActionPool *pParent)
2557 : UIActionSimple(pParent)
2558 {
2559 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2560 setIcon(0, UIIconPool::iconSetFull(":/hd_release_32px.png", ":/hd_release_16px.png",
2561 ":/hd_release_disabled_32px.png", ":/hd_release_disabled_16px.png"));
2562 setIcon(1, UIIconPool::iconSetFull(":/cd_release_32px.png", ":/cd_release_16px.png",
2563 ":/cd_release_disabled_32px.png", ":/cd_release_disabled_16px.png"));
2564 setIcon(2, UIIconPool::iconSetFull(":/fd_release_32px.png", ":/fd_release_16px.png",
2565 ":/fd_release_disabled_32px.png", ":/fd_release_disabled_16px.png"));
2566 }
2567
2568protected:
2569
2570 /** Returns shortcut extra-data ID. */
2571 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2572 {
2573 return QString("ReleaseMedium");
2574 }
2575
2576 /** Returns default shortcut. */
2577 virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
2578 {
2579 return QKeySequence("Ctrl+Shift+L");
2580 }
2581
2582 /** Handles translation event. */
2583 virtual void retranslateUi() RT_OVERRIDE
2584 {
2585 setName(QApplication::translate("UIActionPool", "Re&lease..."));
2586 setShortcutScope(QApplication::translate("UIActionPool", "Media Manager"));
2587 setStatusTip(QApplication::translate("UIActionPool", "Release selected disk image"));
2588 setToolTip( QApplication::translate("UIActionPool", "Release Disk Image")
2589 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2590 }
2591};
2592
2593/** Toggle action extension, used as 'Toggle Medium Properties' action class. */
2594class UIActionMenuManagerMediumToggleProperties : public UIActionToggle
2595{
2596 Q_OBJECT;
2597
2598public:
2599
2600 /** Constructs action passing @a pParent to the base-class. */
2601 UIActionMenuManagerMediumToggleProperties(UIActionPool *pParent)
2602 : UIActionToggle(pParent)
2603 {
2604 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2605 /// @todo use icons with check-boxes
2606 setIcon(0, UIIconPool::iconSetFull(":/hd_modify_32px.png", ":/hd_modify_16px.png",
2607 ":/hd_modify_disabled_32px.png", ":/hd_modify_disabled_16px.png"));
2608 setIcon(1, UIIconPool::iconSetFull(":/cd_modify_32px.png", ":/cd_modify_16px.png",
2609 ":/cd_modify_disabled_32px.png", ":/cd_modify_disabled_16px.png"));
2610 setIcon(2, UIIconPool::iconSetFull(":/fd_modify_32px.png", ":/fd_modify_16px.png",
2611 ":/fd_modify_disabled_32px.png", ":/fd_modify_disabled_16px.png"));
2612 }
2613
2614protected:
2615
2616 /** Returns shortcut extra-data ID. */
2617 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2618 {
2619 return QString("ToggleMediumProperties");
2620 }
2621
2622 /** Returns default shortcut. */
2623 virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
2624 {
2625 return QKeySequence("Ctrl+Shift+P");
2626 }
2627
2628 /** Handles translation event. */
2629 virtual void retranslateUi() RT_OVERRIDE
2630 {
2631 setName(QApplication::translate("UIActionPool", "&Properties"));
2632 setShortcutScope(QApplication::translate("UIActionPool", "Media Manager"));
2633 setStatusTip(QApplication::translate("UIActionPool", "Open pane with selected disk image properties"));
2634 setToolTip( QApplication::translate("UIActionPool", "Open Disk Image Properties")
2635 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2636 }
2637};
2638
2639/** Toggle action extension, used as 'Toggle Search Pane' action class. */
2640class UIActionMenuManagerMediumToggleSearch : public UIActionToggle
2641{
2642 Q_OBJECT;
2643
2644public:
2645
2646 /** Constructs action passing @a pParent to the base-class. */
2647 UIActionMenuManagerMediumToggleSearch(UIActionPool *pParent)
2648 : UIActionToggle(pParent)
2649 {
2650 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2651 /// @todo use icons with check-boxes
2652 setIcon(0, UIIconPool::iconSetFull(":/hd_search_32px.png", ":/hd_search_16px.png",
2653 ":/hd_search_disabled_32px.png", ":/hd_search_disabled_16px.png"));
2654 setIcon(1, UIIconPool::iconSetFull(":/cd_search_32px.png", ":/cd_search_16px.png",
2655 ":/cd_search_disabled_32px.png", ":/cd_search_disabled_16px.png"));
2656 setIcon(2, UIIconPool::iconSetFull(":/fd_search_32px.png", ":/fd_search_16px.png",
2657 ":/fd_search_disabled_32px.png", ":/fd_search_disabled_16px.png"));
2658 }
2659
2660protected:
2661
2662 /** Returns shortcut extra-data ID. */
2663 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2664 {
2665 return QString("ToggleMediumSearch");
2666 }
2667
2668 /** Returns standard shortcut. */
2669 virtual QKeySequence standardShortcut(UIType) const RT_OVERRIDE
2670 {
2671 return actionPool()->isTemporary() ? QKeySequence() : QKeySequence(QKeySequence::Find);
2672 }
2673
2674 /** Handles translation event. */
2675 virtual void retranslateUi() RT_OVERRIDE
2676 {
2677 setName(QApplication::translate("UIActionPool", "&Search"));
2678 setShortcutScope(QApplication::translate("UIActionPool", "Media Manager"));
2679 setStatusTip(QApplication::translate("UIActionPool", "Open the disk image search pane"));
2680 setToolTip( QApplication::translate("UIActionPool", "Open Disk Image Search Pane")
2681 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2682 }
2683};
2684
2685/** Simple action extension, used as 'Perform Refresh' action class. */
2686class UIActionMenuManagerMediumPerformRefresh : public UIActionSimple
2687{
2688 Q_OBJECT;
2689
2690public:
2691
2692 /** Constructs action passing @a pParent to the base-class. */
2693 UIActionMenuManagerMediumPerformRefresh(UIActionPool *pParent)
2694 : UIActionSimple(pParent,
2695 ":/refresh_32px.png", ":/refresh_16px.png",
2696 ":/refresh_disabled_32px.png", ":/refresh_disabled_16px.png")
2697 {
2698 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2699 }
2700
2701protected:
2702
2703 /** Returns shortcut extra-data ID. */
2704 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2705 {
2706 return QString("RefreshMedia");
2707 }
2708
2709 /** Returns default shortcut. */
2710 virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
2711 {
2712 return QKeySequence("Ctrl+Shift+F");
2713 }
2714
2715 /** Returns standard shortcut. */
2716 virtual QKeySequence standardShortcut(UIType) const RT_OVERRIDE
2717 {
2718 return actionPool()->isTemporary() ? QKeySequence() : QKeySequence(QKeySequence::Refresh);
2719 }
2720
2721 /** Handles translation event. */
2722 virtual void retranslateUi() RT_OVERRIDE
2723 {
2724 setName(QApplication::translate("UIActionPool", "Re&fresh..."));
2725 setShortcutScope(QApplication::translate("UIActionPool", "Media Manager"));
2726 setStatusTip(QApplication::translate("UIActionPool", "Refresh the list of disk images"));
2727 setToolTip( QApplication::translate("UIActionPool", "Refresh Disk Images")
2728 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2729 }
2730};
2731
2732/** Simple action extension, used as 'Perform Clear' action class. */
2733class UIActionMenuManagerMediumPerformClear : public UIActionSimple
2734{
2735 Q_OBJECT;
2736
2737public:
2738
2739 /** Constructs action passing @a pParent to the base-class. */
2740 UIActionMenuManagerMediumPerformClear(UIActionPool *pParent)
2741 : UIActionSimple(pParent)
2742 {
2743 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2744 setIcon(1, UIIconPool::iconSetFull(":/cd_clear_32px.png", ":/cd_clear_16px.png",
2745 ":/cd_clear_disabled_32px.png", ":/cd_clear_disabled_16px.png"));
2746 setIcon(2, UIIconPool::iconSetFull(":/fd_clear_32px.png", ":/fd_clear_16px.png",
2747 ":/fd_clear_disabled_32px.png", ":/fd_clear_disabled_16px.png"));
2748 }
2749
2750protected:
2751
2752 /** Returns shortcut extra-data ID. */
2753 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2754 {
2755 return QString("Clear");
2756 }
2757
2758 /** Returns default shortcut. */
2759 virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
2760 {
2761 return QKeySequence();
2762 }
2763
2764 /** Handles translation event. */
2765 virtual void retranslateUi() RT_OVERRIDE
2766 {
2767 setName(QApplication::translate("UIActionPool", "&Clear"));
2768 setShortcutScope(QApplication::translate("UIActionPool", "Media Manager"));
2769 setStatusTip(QApplication::translate("UIActionPool", "Remove all inaccessible media"));
2770 setToolTip( QApplication::translate("UIActionPool", "Remove Inaccessible Media")
2771 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2772 }
2773};
2774
2775/** Menu action extension, used as 'Network' menu class. */
2776class UIActionMenuManagerNetwork : public UIActionMenu
2777{
2778 Q_OBJECT;
2779
2780public:
2781
2782 /** Constructs action passing @a pParent to the base-class. */
2783 UIActionMenuManagerNetwork(UIActionPool *pParent)
2784 : UIActionMenu(pParent)
2785 {}
2786
2787protected:
2788
2789 /** Returns shortcut extra-data ID. */
2790 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2791 {
2792 return QString("NetworkMenu");
2793 }
2794
2795 /** Handles translation event. */
2796 virtual void retranslateUi() RT_OVERRIDE
2797 {
2798 setName(QApplication::translate("UIActionPool", "&Network"));
2799 }
2800};
2801
2802/** Simple action extension, used as 'Perform Create' action class. */
2803class UIActionMenuManagerNetworkPerformCreate : public UIActionSimple
2804{
2805 Q_OBJECT;
2806
2807public:
2808
2809 /** Constructs action passing @a pParent to the base-class. */
2810 UIActionMenuManagerNetworkPerformCreate(UIActionPool *pParent)
2811 : UIActionSimple(pParent,
2812 ":/host_iface_add_32px.png", ":/host_iface_add_16px.png",
2813 ":/host_iface_add_disabled_32px.png", ":/host_iface_add_disabled_16px.png")
2814 {
2815 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2816 }
2817
2818protected:
2819
2820 /** Returns shortcut extra-data ID. */
2821 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2822 {
2823 return QString("CreateNetwork");
2824 }
2825
2826 /** Returns default shortcut. */
2827 virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
2828 {
2829 return QKeySequence("Ctrl+Shift+C");
2830 }
2831
2832 /** Handles translation event. */
2833 virtual void retranslateUi() RT_OVERRIDE
2834 {
2835 setName(QApplication::translate("UIActionPool", "&Create..."));
2836 setShortcutScope(QApplication::translate("UIActionPool", "Network Manager"));
2837 setStatusTip(QApplication::translate("UIActionPool", "Create new host-only network"));
2838 setToolTip( QApplication::translate("UIActionPool", "Create Host-only Network")
2839 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2840 }
2841};
2842
2843/** Simple action extension, used as 'Perform Remove' action class. */
2844class UIActionMenuManagerNetworkPerformRemove : public UIActionSimple
2845{
2846 Q_OBJECT;
2847
2848public:
2849
2850 /** Constructs action passing @a pParent to the base-class. */
2851 UIActionMenuManagerNetworkPerformRemove(UIActionPool *pParent)
2852 : UIActionSimple(pParent,
2853 ":/host_iface_remove_32px.png", ":/host_iface_remove_16px.png",
2854 ":/host_iface_remove_disabled_32px.png", ":/host_iface_remove_disabled_16px.png")
2855 {
2856 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2857 }
2858
2859protected:
2860
2861 /** Returns shortcut extra-data ID. */
2862 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2863 {
2864 return QString("RemoveNetwork");
2865 }
2866
2867 /** Returns default shortcut. */
2868 virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
2869 {
2870 return QKeySequence("Ctrl+Shift+R");
2871 }
2872
2873 /** Handles translation event. */
2874 virtual void retranslateUi() RT_OVERRIDE
2875 {
2876 setName(QApplication::translate("UIActionPool", "&Remove..."));
2877 setShortcutScope(QApplication::translate("UIActionPool", "Network Manager"));
2878 setStatusTip(QApplication::translate("UIActionPool", "Remove selected host-only network"));
2879 setToolTip( QApplication::translate("UIActionPool", "Remove Host-only Network")
2880 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2881 }
2882};
2883
2884/** Toggle action extension, used as 'Toggle Network Properties' action class. */
2885class UIActionMenuManagerNetworkToggleProperties : public UIActionToggle
2886{
2887 Q_OBJECT;
2888
2889public:
2890
2891 /** Constructs action passing @a pParent to the base-class. */
2892 UIActionMenuManagerNetworkToggleProperties(UIActionPool *pParent)
2893 : UIActionToggle(pParent)
2894 {
2895 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2896 /// @todo use icons with check-boxes
2897 setIcon(UIIconPool::iconSetFull(":/host_iface_edit_32px.png", ":/host_iface_edit_16px.png",
2898 ":/host_iface_edit_disabled_32px.png", ":/host_iface_edit_disabled_16px.png"));
2899 }
2900
2901protected:
2902
2903 /** Returns shortcut extra-data ID. */
2904 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2905 {
2906 return QString("ToggleNetworkProperties");
2907 }
2908
2909 /** Returns default shortcut. */
2910 virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
2911 {
2912 return QKeySequence("Ctrl+Shift+P");
2913 }
2914
2915 /** Handles translation event. */
2916 virtual void retranslateUi() RT_OVERRIDE
2917 {
2918 setName(QApplication::translate("UIActionPool", "&Properties"));
2919 setShortcutScope(QApplication::translate("UIActionPool", "Network Manager"));
2920 setStatusTip(QApplication::translate("UIActionPool", "Open pane with selected host-only network properties"));
2921 setToolTip( QApplication::translate("UIActionPool", "Open Host-only Network Properties")
2922 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2923 }
2924};
2925
2926/** Simple action extension, used as 'Perform Refresh' action class. */
2927class UIActionMenuManagerNetworkPerformRefresh : public UIActionSimple
2928{
2929 Q_OBJECT;
2930
2931public:
2932
2933 /** Constructs action passing @a pParent to the base-class. */
2934 UIActionMenuManagerNetworkPerformRefresh(UIActionPool *pParent)
2935 : UIActionSimple(pParent,
2936 ":/refresh_32px.png", ":/refresh_16px.png",
2937 ":/refresh_disabled_32px.png", ":/refresh_disabled_16px.png")
2938 {
2939 setShortcutContext(Qt::WidgetWithChildrenShortcut);
2940 }
2941
2942protected:
2943
2944 /** Returns shortcut extra-data ID. */
2945 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2946 {
2947 return QString("RefreshNetworks");
2948 }
2949
2950 /** Returns default shortcut. */
2951 virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
2952 {
2953 return QKeySequence("Ctrl+Shift+F");
2954 }
2955
2956 /** Returns standard shortcut. */
2957 virtual QKeySequence standardShortcut(UIType) const RT_OVERRIDE
2958 {
2959 return actionPool()->isTemporary() ? QKeySequence() : QKeySequence(QKeySequence::Refresh);
2960 }
2961
2962 /** Handles translation event. */
2963 virtual void retranslateUi() RT_OVERRIDE
2964 {
2965 setName(QApplication::translate("UIActionPool", "Re&fresh..."));
2966 setShortcutScope(QApplication::translate("UIActionPool", "Network Manager"));
2967 setStatusTip(QApplication::translate("UIActionPool", "Refresh the list of host-only networks"));
2968 setToolTip( QApplication::translate("UIActionPool", "Refresh Host-only Networks")
2969 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
2970 }
2971};
2972
2973
2974/** Menu action extension, used as 'Cloud' menu class. */
2975class UIActionMenuManagerCloud : public UIActionMenu
2976{
2977 Q_OBJECT;
2978
2979public:
2980
2981 /** Constructs action passing @a pParent to the base-class. */
2982 UIActionMenuManagerCloud(UIActionPool *pParent)
2983 : UIActionMenu(pParent)
2984 {}
2985
2986protected:
2987
2988 /** Returns shortcut extra-data ID. */
2989 virtual QString shortcutExtraDataID() const RT_OVERRIDE
2990 {
2991 return QString("CloudProfileMenu");
2992 }
2993
2994 /** Handles translation event. */
2995 virtual void retranslateUi() RT_OVERRIDE
2996 {
2997 setName(QApplication::translate("UIActionPool", "&Cloud"));
2998 }
2999};
3000
3001/** Simple action extension, used as 'Perform Add' action class. */
3002class UIActionMenuManagerCloudPerformAdd : public UIActionSimple
3003{
3004 Q_OBJECT;
3005
3006public:
3007
3008 /** Constructs action passing @a pParent to the base-class. */
3009 UIActionMenuManagerCloudPerformAdd(UIActionPool *pParent)
3010 : UIActionSimple(pParent,
3011 ":/cloud_profile_add_32px.png", ":/cloud_profile_add_16px.png",
3012 ":/cloud_profile_add_disabled_32px.png", ":/cloud_profile_add_disabled_16px.png")
3013 {
3014 setShortcutContext(Qt::WidgetWithChildrenShortcut);
3015 }
3016
3017protected:
3018
3019 /** Returns shortcut extra-data ID. */
3020 virtual QString shortcutExtraDataID() const RT_OVERRIDE
3021 {
3022 return QString("AddCloudProfile");
3023 }
3024
3025 /** Returns default shortcut. */
3026 virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
3027 {
3028 return QKeySequence("Ctrl+Shift+A");
3029 }
3030
3031 /** Handles translation event. */
3032 virtual void retranslateUi() RT_OVERRIDE
3033 {
3034 setIconText(QApplication::translate("UIActionPool", "Add"));
3035 setName(QApplication::translate("UIActionPool", "&Add Profile..."));
3036 setShortcutScope(QApplication::translate("UIActionPool", "Cloud Profile Manager"));
3037 setStatusTip(QApplication::translate("UIActionPool", "Add new cloud profile"));
3038 setToolTip( QApplication::translate("UIActionPool", "Add Cloud Profile")
3039 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
3040 }
3041};
3042
3043/** Simple action extension, used as 'Perform Import' action class. */
3044class UIActionMenuManagerCloudPerformImport : public UIActionSimple
3045{
3046 Q_OBJECT;
3047
3048public:
3049
3050 /** Constructs action passing @a pParent to the base-class. */
3051 UIActionMenuManagerCloudPerformImport(UIActionPool *pParent)
3052 : UIActionSimple(pParent,
3053 ":/cloud_profile_restore_32px.png", ":/cloud_profile_restore_16px.png",
3054 ":/cloud_profile_restore_disabled_32px.png", ":/cloud_profile_restore_disabled_16px.png")
3055 {
3056 setShortcutContext(Qt::WidgetWithChildrenShortcut);
3057 }
3058
3059protected:
3060
3061 /** Returns shortcut extra-data ID. */
3062 virtual QString shortcutExtraDataID() const RT_OVERRIDE
3063 {
3064 return QString("ImportCloudProfiles");
3065 }
3066
3067 /** Returns default shortcut. */
3068 virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
3069 {
3070 return QKeySequence("Ctrl+Shift+I");
3071 }
3072
3073 /** Handles translation event. */
3074 virtual void retranslateUi() RT_OVERRIDE
3075 {
3076 setIconText(QApplication::translate("UIActionPool", "Import"));
3077 setName(QApplication::translate("UIActionPool", "&Import Profiles..."));
3078 setShortcutScope(QApplication::translate("UIActionPool", "Cloud Profile Manager"));
3079 setStatusTip(QApplication::translate("UIActionPool", "Import the list of cloud profiles from external files"));
3080 setToolTip( QApplication::translate("UIActionPool", "Import Cloud Profiles")
3081 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
3082 }
3083};
3084
3085/** Simple action extension, used as 'Perform Remove' action class. */
3086class UIActionMenuManagerCloudPerformRemove : public UIActionSimple
3087{
3088 Q_OBJECT;
3089
3090public:
3091
3092 /** Constructs action passing @a pParent to the base-class. */
3093 UIActionMenuManagerCloudPerformRemove(UIActionPool *pParent)
3094 : UIActionSimple(pParent,
3095 ":/cloud_profile_remove_32px.png", ":/cloud_profile_remove_16px.png",
3096 ":/cloud_profile_remove_disabled_32px.png", ":/cloud_profile_remove_disabled_16px.png")
3097 {
3098 setShortcutContext(Qt::WidgetWithChildrenShortcut);
3099 }
3100
3101protected:
3102
3103 /** Returns shortcut extra-data ID. */
3104 virtual QString shortcutExtraDataID() const RT_OVERRIDE
3105 {
3106 return QString("RemoveCloudProfile");
3107 }
3108
3109 /** Returns default shortcut. */
3110 virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
3111 {
3112 return QKeySequence("Ctrl+Shift+R");
3113 }
3114
3115 /** Handles translation event. */
3116 virtual void retranslateUi() RT_OVERRIDE
3117 {
3118 setIconText(QApplication::translate("UIActionPool", "Remove"));
3119 setName(QApplication::translate("UIActionPool", "&Remove Profile..."));
3120 setShortcutScope(QApplication::translate("UIActionPool", "Cloud Profile Manager"));
3121 setStatusTip(QApplication::translate("UIActionPool", "Remove selected cloud profile"));
3122 setToolTip( QApplication::translate("UIActionPool", "Remove Cloud Profile")
3123 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
3124 }
3125};
3126
3127/** Toggle action extension, used as 'Toggle Properties' action class. */
3128class UIActionMenuManagerCloudToggleProperties : public UIActionToggle
3129{
3130 Q_OBJECT;
3131
3132public:
3133
3134 /** Constructs action passing @a pParent to the base-class. */
3135 UIActionMenuManagerCloudToggleProperties(UIActionPool *pParent)
3136 : UIActionToggle(pParent)
3137 {
3138 setShortcutContext(Qt::WidgetWithChildrenShortcut);
3139 /// @todo use icons with check-boxes
3140 setIcon(UIIconPool::iconSetFull(":/cloud_profile_edit_32px.png", ":/cloud_profile_edit_16px.png",
3141 ":/cloud_profile_edit_disabled_32px.png", ":/cloud_profile_edit_disabled_16px.png"));
3142 }
3143
3144protected:
3145
3146 /** Returns shortcut extra-data ID. */
3147 virtual QString shortcutExtraDataID() const RT_OVERRIDE
3148 {
3149 return QString("ToggleCloudProfileProperties");
3150 }
3151
3152 /** Returns default shortcut. */
3153 virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
3154 {
3155 return QKeySequence("Ctrl+Shift+P");
3156 }
3157
3158 /** Handles translation event. */
3159 virtual void retranslateUi() RT_OVERRIDE
3160 {
3161 setIconText(QApplication::translate("UIActionPool", "Properties"));
3162 setName(QApplication::translate("UIActionPool", "Profile &Properties"));
3163 setShortcutScope(QApplication::translate("UIActionPool", "Cloud Profile Manager"));
3164 setStatusTip(QApplication::translate("UIActionPool", "Open pane with selected cloud profile properties"));
3165 setToolTip( QApplication::translate("UIActionPool", "Open Cloud Profile Properties")
3166 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
3167 }
3168};
3169
3170/** Simple action extension, used as 'Try Page' action class. */
3171class UIActionMenuManagerCloudShowTryPage : public UIActionSimple
3172{
3173 Q_OBJECT;
3174
3175public:
3176
3177 /** Constructs action passing @a pParent to the base-class. */
3178 UIActionMenuManagerCloudShowTryPage(UIActionPool *pParent)
3179 : UIActionSimple(pParent,
3180 ":/cloud_profile_try_32px.png", ":/cloud_profile_try_16px.png",
3181 ":/cloud_profile_try_disabled_32px.png", ":/cloud_profile_try_disabled_16px.png")
3182 {
3183 setShortcutContext(Qt::WidgetWithChildrenShortcut);
3184 }
3185
3186protected:
3187
3188 /** Returns shortcut extra-data ID. */
3189 virtual QString shortcutExtraDataID() const RT_OVERRIDE
3190 {
3191 return QString("ShowCloudProfileTryPage");
3192 }
3193
3194 /** Returns default shortcut. */
3195 virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
3196 {
3197 return QKeySequence("Ctrl+Shift+T");
3198 }
3199
3200 /** Handles translation event. */
3201 virtual void retranslateUi() RT_OVERRIDE
3202 {
3203 setIconText(QApplication::translate("UIActionPool", "Try"));
3204 setName(QApplication::translate("UIActionPool", "&Try Oracle Cloud for Free..."));
3205 setShortcutScope(QApplication::translate("UIActionPool", "Cloud Profile Manager"));
3206 setStatusTip(QApplication::translate("UIActionPool", "Try Oracle cloud for free"));
3207 setToolTip( QApplication::translate("UIActionPool", "Try Oracle Cloud for Free")
3208 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
3209 }
3210};
3211
3212/** Simple action extension, used as 'Show Help' action class. */
3213class UIActionMenuManagerCloudShowHelp : public UIActionSimple
3214{
3215 Q_OBJECT;
3216
3217public:
3218
3219 /** Constructs action passing @a pParent to the base-class. */
3220 UIActionMenuManagerCloudShowHelp(UIActionPool *pParent)
3221 : UIActionSimple(pParent,
3222 ":/cloud_profile_help_32px.png", ":/cloud_profile_help_16px.png",
3223 ":/cloud_profile_help_disabled_32px.png", ":/cloud_profile_help_disabled_16px.png")
3224 {
3225 setShortcutContext(Qt::WidgetWithChildrenShortcut);
3226 }
3227
3228protected:
3229
3230 /** Returns shortcut extra-data ID. */
3231 virtual QString shortcutExtraDataID() const RT_OVERRIDE
3232 {
3233 return QString("ShowCloudProfileHelp");
3234 }
3235
3236 /** Returns default shortcut. */
3237 virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
3238 {
3239 return QKeySequence("Ctrl+Shift+H");
3240 }
3241
3242 /** Returns standard shortcut. */
3243 virtual QKeySequence standardShortcut(UIType) const RT_OVERRIDE
3244 {
3245 return actionPool()->isTemporary()
3246 ? QKeySequence()
3247 : UIShortcutPool::standardSequence(QKeySequence::HelpContents);
3248 }
3249
3250 /** Handles translation event. */
3251 virtual void retranslateUi() RT_OVERRIDE
3252 {
3253 setIconText(QApplication::translate("UIActionPool", "Help"));
3254 setName(QApplication::translate("UIActionPool", "&Show Help..."));
3255 setShortcutScope(QApplication::translate("UIActionPool", "Cloud Profile Manager"));
3256 setStatusTip(QApplication::translate("UIActionPool", "Show cloud profile help"));
3257 setToolTip( QApplication::translate("UIActionPool", "Show Cloud Profile Help")
3258 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
3259 }
3260};
3261
3262
3263/** Menu action extension, used as 'Cloud Console' menu class. */
3264class UIActionMenuManagerCloudConsole : public UIActionMenu
3265{
3266 Q_OBJECT;
3267
3268public:
3269
3270 /** Constructs action passing @a pParent to the base-class. */
3271 UIActionMenuManagerCloudConsole(UIActionPool *pParent)
3272 : UIActionMenu(pParent)
3273 {}
3274
3275protected:
3276
3277 /** Returns shortcut extra-data ID. */
3278 virtual QString shortcutExtraDataID() const RT_OVERRIDE
3279 {
3280 return QString("CloudConsoleMenu");
3281 }
3282
3283 /** Handles translation event. */
3284 virtual void retranslateUi() RT_OVERRIDE
3285 {
3286 setName(QApplication::translate("UIActionPool", "&Console"));
3287 }
3288};
3289
3290/** Simple action extension, used as 'Perform Console Application Add' action class. */
3291class UIActionMenuManagerCloudConsolePerformApplicationAdd : public UIActionSimple
3292{
3293 Q_OBJECT;
3294
3295public:
3296
3297 /** Constructs action passing @a pParent to the base-class. */
3298 UIActionMenuManagerCloudConsolePerformApplicationAdd(UIActionPool *pParent)
3299 : UIActionSimple(pParent,
3300 ":/cloud_console_application_add_32px.png", ":/cloud_console_application_add_16px.png",
3301 ":/cloud_console_application_add_disabled_32px.png", ":/cloud_console_application_add_disabled_16px.png")
3302 {
3303 setShortcutContext(Qt::WidgetWithChildrenShortcut);
3304 }
3305
3306protected:
3307
3308 /** Returns shortcut extra-data ID. */
3309 virtual QString shortcutExtraDataID() const RT_OVERRIDE
3310 {
3311 return QString("AddCloudConsoleApplication");
3312 }
3313
3314 /** Handles translation event. */
3315 virtual void retranslateUi() RT_OVERRIDE
3316 {
3317 setName(QApplication::translate("UIActionPool", "&Add Application..."));
3318 setShortcutScope(QApplication::translate("UIActionPool", "Cloud Console Manager"));
3319 setStatusTip(QApplication::translate("UIActionPool", "Add new cloud console application"));
3320 setToolTip( QApplication::translate("UIActionPool", "Add Cloud Console Application")
3321 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
3322 }
3323};
3324
3325/** Simple action extension, used as 'Perform Console Application Remove' action class. */
3326class UIActionMenuManagerCloudConsolePerformApplicationRemove : public UIActionSimple
3327{
3328 Q_OBJECT;
3329
3330public:
3331
3332 /** Constructs action passing @a pParent to the base-class. */
3333 UIActionMenuManagerCloudConsolePerformApplicationRemove(UIActionPool *pParent)
3334 : UIActionSimple(pParent,
3335 ":/cloud_console_application_remove_32px.png", ":/cloud_console_application_remove_16px.png",
3336 ":/cloud_console_application_remove_disabled_32px.png", ":/cloud_console_application_remove_disabled_16px.png")
3337 {
3338 setShortcutContext(Qt::WidgetWithChildrenShortcut);
3339 }
3340
3341protected:
3342
3343 /** Returns shortcut extra-data ID. */
3344 virtual QString shortcutExtraDataID() const RT_OVERRIDE
3345 {
3346 return QString("RemoveCloudConsoleApplication");
3347 }
3348
3349 /** Handles translation event. */
3350 virtual void retranslateUi() RT_OVERRIDE
3351 {
3352 setName(QApplication::translate("UIActionPool", "&Remove Application..."));
3353 setShortcutScope(QApplication::translate("UIActionPool", "Cloud Console Manager"));
3354 setStatusTip(QApplication::translate("UIActionPool", "Remove selected cloud console application"));
3355 setToolTip( QApplication::translate("UIActionPool", "Remove Cloud Console Application")
3356 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
3357 }
3358};
3359
3360/** Simple action extension, used as 'Perform Console Profile Add' action class. */
3361class UIActionMenuManagerCloudConsolePerformProfileAdd : public UIActionSimple
3362{
3363 Q_OBJECT;
3364
3365public:
3366
3367 /** Constructs action passing @a pParent to the base-class. */
3368 UIActionMenuManagerCloudConsolePerformProfileAdd(UIActionPool *pParent)
3369 : UIActionSimple(pParent,
3370 ":/cloud_console_profile_add_32px.png", ":/cloud_console_profile_add_16px.png",
3371 ":/cloud_console_profile_add_disabled_32px.png", ":/cloud_console_profile_add_disabled_16px.png")
3372 {
3373 setShortcutContext(Qt::WidgetWithChildrenShortcut);
3374 }
3375
3376protected:
3377
3378 /** Returns shortcut extra-data ID. */
3379 virtual QString shortcutExtraDataID() const RT_OVERRIDE
3380 {
3381 return QString("AddCloudConsoleProfile");
3382 }
3383
3384 /** Handles translation event. */
3385 virtual void retranslateUi() RT_OVERRIDE
3386 {
3387 setName(QApplication::translate("UIActionPool", "&Add Profile..."));
3388 setShortcutScope(QApplication::translate("UIActionPool", "Cloud Console Manager"));
3389 setStatusTip(QApplication::translate("UIActionPool", "Add new cloud console profile"));
3390 setToolTip( QApplication::translate("UIActionPool", "Add Cloud Console Profile")
3391 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
3392 }
3393};
3394
3395/** Simple action extension, used as 'Perform Console Profile Remove' action class. */
3396class UIActionMenuManagerCloudConsolePerformProfileRemove : public UIActionSimple
3397{
3398 Q_OBJECT;
3399
3400public:
3401
3402 /** Constructs action passing @a pParent to the base-class. */
3403 UIActionMenuManagerCloudConsolePerformProfileRemove(UIActionPool *pParent)
3404 : UIActionSimple(pParent,
3405 ":/cloud_console_profile_remove_32px.png", ":/cloud_console_profile_remove_16px.png",
3406 ":/cloud_console_profile_remove_disabled_32px.png", ":/cloud_console_profile_remove_disabled_16px.png")
3407 {
3408 setShortcutContext(Qt::WidgetWithChildrenShortcut);
3409 }
3410
3411protected:
3412
3413 /** Returns shortcut extra-data ID. */
3414 virtual QString shortcutExtraDataID() const RT_OVERRIDE
3415 {
3416 return QString("RemoveCloudConsoleProfile");
3417 }
3418
3419 /** Handles translation event. */
3420 virtual void retranslateUi() RT_OVERRIDE
3421 {
3422 setName(QApplication::translate("UIActionPool", "&Remove Profile..."));
3423 setShortcutScope(QApplication::translate("UIActionPool", "Cloud Console Manager"));
3424 setStatusTip(QApplication::translate("UIActionPool", "Remove selected cloud console profile"));
3425 setToolTip( QApplication::translate("UIActionPool", "Remove Cloud Console Profile")
3426 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
3427 }
3428};
3429
3430/** Toggle action extension, used as 'Toggle Cloud Console Properties' action class. */
3431class UIActionMenuManagerCloudConsoleToggleProperties : public UIActionToggle
3432{
3433 Q_OBJECT;
3434
3435public:
3436
3437 /** Constructs action passing @a pParent to the base-class. */
3438 UIActionMenuManagerCloudConsoleToggleProperties(UIActionPool *pParent)
3439 : UIActionToggle(pParent)
3440 {
3441 setShortcutContext(Qt::WidgetWithChildrenShortcut);
3442 /// @todo use icons with check-boxes
3443 setIcon(UIIconPool::iconSetFull(":/cloud_console_edit_32px.png", ":/cloud_console_edit_16px.png",
3444 ":/cloud_console_edit_disabled_32px.png", ":/cloud_console_edit_disabled_16px.png"));
3445 }
3446
3447protected:
3448
3449 /** Returns shortcut extra-data ID. */
3450 virtual QString shortcutExtraDataID() const RT_OVERRIDE
3451 {
3452 return QString("ToggleCloudConsoleProperties");
3453 }
3454
3455 /** Returns default shortcut. */
3456 virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
3457 {
3458 return QKeySequence("Ctrl+Shift+P");
3459 }
3460
3461 /** Handles translation event. */
3462 virtual void retranslateUi() RT_OVERRIDE
3463 {
3464 setIconText(QApplication::translate("UIActionPool", "Properties"));
3465 setName(QApplication::translate("UIActionPool", "Console &Properties"));
3466 setShortcutScope(QApplication::translate("UIActionPool", "Cloud Console Manager"));
3467 setStatusTip(QApplication::translate("UIActionPool", "Open pane with selected cloud console properties"));
3468 setToolTip( QApplication::translate("UIActionPool", "Open Cloud Console Properties")
3469 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
3470 }
3471};
3472
3473
3474/** Menu action extension, used as 'Resources' menu class. */
3475class UIActionMenuVMActivityOverview : public UIActionMenu
3476{
3477 Q_OBJECT;
3478
3479public:
3480
3481 /** Constructs action passing @a pParent to the base-class. */
3482 UIActionMenuVMActivityOverview(UIActionPool *pParent)
3483 : UIActionMenu(pParent)
3484 {}
3485
3486protected:
3487
3488 /** Returns shortcut extra-data ID. */
3489 virtual QString shortcutExtraDataID() const RT_OVERRIDE
3490 {
3491 return QString("VMActivityOverviewMenu");
3492 }
3493
3494 /** Handles translation event. */
3495 virtual void retranslateUi() RT_OVERRIDE
3496 {
3497 setName(QApplication::translate("UIActionPool", "&Resources"));
3498 }
3499};
3500
3501/** Menu action extension, used as 'Columns' menu class. */
3502class UIActionMenuManagerVMActivityOverviewColumns : public UIActionMenu
3503{
3504 Q_OBJECT;
3505
3506public:
3507
3508 /** Constructs action passing @a pParent to the base-class. */
3509 UIActionMenuManagerVMActivityOverviewColumns(UIActionPool *pParent)
3510 : UIActionMenu(pParent,
3511 ":/resources_monitor_columns_32px.png", ":/resources_monitor_columns_16px.png",
3512 ":/resources_monitor_columns_disabled_32px.png", ":/resources_monitor_columns_disabled_16px.png")
3513 {
3514 setShortcutContext(Qt::WidgetWithChildrenShortcut);
3515 }
3516
3517protected:
3518
3519 /** Returns shortcut extra-data ID. */
3520 virtual QString shortcutExtraDataID() const RT_OVERRIDE
3521 {
3522 return QString("VMActivityOverviewColumns");
3523 }
3524
3525 /** Handles translation event. */
3526 virtual void retranslateUi() RT_OVERRIDE
3527 {
3528 setName(QApplication::translate("UIActionPool", "Columns"));
3529 setShortcutScope(QApplication::translate("UIActionPool", "VM Activity Overview"));
3530 setStatusTip(QApplication::translate("UIActionPool", "Show/Hide Columns"));
3531 setToolTip( QApplication::translate("UIActionPool", "Show/Hide Columns")
3532 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
3533 }
3534};
3535
3536/** Simple action extension, used as 'Switch to Machine Activity' action class. */
3537class UIActionMenuManagerVMActivityOverviewSwitchToMachineActivity : public UIActionSimple
3538{
3539 Q_OBJECT;
3540
3541public:
3542
3543 /** Constructs action passing @a pParent to the base-class. */
3544 UIActionMenuManagerVMActivityOverviewSwitchToMachineActivity(UIActionPool *pParent)
3545 : UIActionSimple(pParent,
3546 ":/resources_monitor_jump_to_vm_32px.png", ":/resources_monitor_jump_to_vm_16px.png",
3547 ":/resources_monitor_jump_to_vm_disabled_32px.png", ":/resources_monitor_jump_to_vm_disabled_16px.png")
3548 {
3549 setShortcutContext(Qt::WidgetWithChildrenShortcut);
3550 }
3551
3552protected:
3553
3554 /** Returns shortcut extra-data ID. */
3555 virtual QString shortcutExtraDataID() const RT_OVERRIDE
3556 {
3557 return QString("VMActivityOverviewSwitchToMachineActivity");
3558 }
3559
3560 /** Handles translation event. */
3561 virtual void retranslateUi() RT_OVERRIDE
3562 {
3563 setName(QApplication::translate("UIActionPool", "VM Activity"));
3564 setShortcutScope(QApplication::translate("UIActionPool", "VM Activity Overview"));
3565 setStatusTip(QApplication::translate("UIActionPool", "Switch to selected virtual machine's activity monitor pane"));
3566 setToolTip( QApplication::translate("UIActionPool", "Switch to selected virtual machine's activity monitor pane")
3567 + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
3568 }
3569};
3570
3571
3572/*********************************************************************************************************************************
3573* Class UIActionPoolManager implementation. *
3574*********************************************************************************************************************************/
3575
3576UIActionPoolManager::UIActionPoolManager(bool fTemporary /* = false */)
3577 : UIActionPool(UIType_ManagerUI, fTemporary)
3578{
3579}
3580
3581void UIActionPoolManager::preparePool()
3582{
3583 /* 'File' actions: */
3584 m_pool[UIActionIndexMN_M_File] = new UIActionMenuManagerFile(this);
3585 m_pool[UIActionIndexMN_M_File_S_ImportAppliance] = new UIActionSimpleManagerFileShowImportApplianceWizard(this);
3586 m_pool[UIActionIndexMN_M_File_S_ExportAppliance] = new UIActionSimpleManagerFileShowExportApplianceWizard(this);
3587 m_pool[UIActionIndexMN_M_File_M_Tools] = new UIActionMenuManagerToolsGlobal(this);
3588 m_pool[UIActionIndexMN_M_File_M_Tools_T_WelcomeScreen] = new UIActionToggleManagerToolsGlobalShowWelcomeScreen(this);
3589 m_pool[UIActionIndexMN_M_File_M_Tools_T_ExtensionPackManager] = new UIActionToggleManagerToolsGlobalShowExtensionPackManager(this);
3590 m_pool[UIActionIndexMN_M_File_M_Tools_T_VirtualMediaManager] = new UIActionToggleManagerToolsGlobalShowVirtualMediaManager(this);
3591 m_pool[UIActionIndexMN_M_File_M_Tools_T_NetworkManager] = new UIActionToggleManagerToolsGlobalShowNetworkManager(this);
3592 m_pool[UIActionIndexMN_M_File_M_Tools_T_CloudProfileManager] = new UIActionToggleManagerToolsGlobalShowCloudProfileManager(this);
3593 m_pool[UIActionIndexMN_M_File_M_Tools_T_VMActivityOverview] = new UIActionToggleManagerToolsGlobalShowVMActivityOverview(this);
3594#ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
3595 m_pool[UIActionIndexMN_M_File_S_ShowExtraDataManager] = new UIActionSimpleManagerFileShowExtraDataManager(this);
3596#endif
3597 m_pool[UIActionIndexMN_M_File_S_Close] = new UIActionSimpleManagerFilePerformExit(this);
3598
3599 /* 'Welcome' actions: */
3600 m_pool[UIActionIndexMN_M_Welcome] = new UIActionMenuManagerMachine(this);
3601 m_pool[UIActionIndexMN_M_Welcome_S_New] = new UIActionSimpleManagerMachinePerformCreate(this);
3602 m_pool[UIActionIndexMN_M_Welcome_S_Add] = new UIActionSimpleManagerMachinePerformAdd(this);
3603
3604 /* 'Group' actions: */
3605 m_pool[UIActionIndexMN_M_Group] = new UIActionMenuManagerGroup(this);
3606 m_pool[UIActionIndexMN_M_Group_S_New] = new UIActionSimpleManagerGroupPerformCreateMachine(this);
3607 m_pool[UIActionIndexMN_M_Group_S_Add] = new UIActionSimpleManagerGroupPerformAddMachine(this);
3608 m_pool[UIActionIndexMN_M_Group_S_Rename] = new UIActionSimpleManagerGroupPerformRename(this);
3609 m_pool[UIActionIndexMN_M_Group_S_Remove] = new UIActionSimpleManagerGroupPerformRemove(this);
3610 m_pool[UIActionIndexMN_M_Group_M_MoveToGroup] = new UIActionMenuManagerCommonMoveToGroup(this);
3611 m_pool[UIActionIndexMN_M_Group_M_StartOrShow] = new UIActionStateManagerCommonStartOrShow(this);
3612 m_pool[UIActionIndexMN_M_Group_M_StartOrShow_S_StartNormal] = new UIActionSimpleManagerCommonPerformStartNormal(this);
3613 m_pool[UIActionIndexMN_M_Group_M_StartOrShow_S_StartHeadless] = new UIActionSimpleManagerCommonPerformStartHeadless(this);
3614 m_pool[UIActionIndexMN_M_Group_M_StartOrShow_S_StartDetachable] = new UIActionSimpleManagerCommonPerformStartDetachable(this);
3615 m_pool[UIActionIndexMN_M_Group_T_Pause] = new UIActionToggleManagerCommonPauseAndResume(this);
3616 m_pool[UIActionIndexMN_M_Group_S_Reset] = new UIActionSimpleManagerCommonPerformReset(this);
3617 m_pool[UIActionIndexMN_M_Group_S_Detach] = new UIActionSimpleManagerCommonPerformDetach(this);
3618 m_pool[UIActionIndexMN_M_Group_M_Console] = new UIActionMenuManagerConsole(this);
3619 m_pool[UIActionIndexMN_M_Group_M_Console_S_CreateConnection] = new UIActionSimpleManagerConsolePerformCreateConnection(this);
3620 m_pool[UIActionIndexMN_M_Group_M_Console_S_DeleteConnection] = new UIActionSimpleManagerConsolePerformDeleteConnection(this);
3621 m_pool[UIActionIndexMN_M_Group_M_Console_S_ConfigureApplications] = new UIActionSimpleManagerConsolePerformConfigureApplications(this);
3622 m_pool[UIActionIndexMN_M_Group_M_Stop] = new UIActionMenuManagerStop(this);
3623 m_pool[UIActionIndexMN_M_Group_M_Stop_S_SaveState] = new UIActionSimpleManagerStopPerformSave(this);
3624 m_pool[UIActionIndexMN_M_Group_M_Stop_S_Terminate] = new UIActionSimpleManagerStopPerformTerminate(this);
3625 m_pool[UIActionIndexMN_M_Group_M_Stop_S_Shutdown] = new UIActionSimpleManagerStopPerformShutdown(this);
3626 m_pool[UIActionIndexMN_M_Group_M_Stop_S_PowerOff] = new UIActionSimpleManagerStopPerformPowerOff(this);
3627 m_pool[UIActionIndexMN_M_Group_M_Tools] = new UIActionMenuManagerToolsMachine(this);
3628 m_pool[UIActionIndexMN_M_Group_M_Tools_T_Details] = new UIActionToggleManagerToolsMachineShowDetails(this);
3629 m_pool[UIActionIndexMN_M_Group_M_Tools_T_Snapshots] = new UIActionToggleManagerToolsMachineShowSnapshots(this);
3630 m_pool[UIActionIndexMN_M_Group_M_Tools_T_Logs] = new UIActionToggleManagerToolsMachineShowLogs(this);
3631 m_pool[UIActionIndexMN_M_Group_M_Tools_T_Activity] = new UIActionToggleManagerToolsMachineShowActivity(this);
3632 m_pool[UIActionIndexMN_M_Group_M_Tools_T_FileManager] = new UIActionToggleManagerToolsMachineShowFileManager(this);
3633 m_pool[UIActionIndexMN_M_Group_S_Discard] = new UIActionSimpleManagerCommonPerformDiscard(this);
3634 m_pool[UIActionIndexMN_M_Group_S_Refresh] = new UIActionSimpleManagerCommonPerformRefresh(this);
3635 m_pool[UIActionIndexMN_M_Group_S_ShowInFileManager] = new UIActionSimpleManagerCommonShowInFileManager(this);
3636 m_pool[UIActionIndexMN_M_Group_S_CreateShortcut] = new UIActionSimpleManagerCommonPerformCreateShortcut(this);
3637 m_pool[UIActionIndexMN_M_Group_S_Sort] = new UIActionSimpleManagerGroupPerformSort(this);
3638 m_pool[UIActionIndexMN_M_Group_T_Search] = new UIActionToggleManagerCommonToggleSearch(this);
3639
3640 /* 'Machine' actions: */
3641 m_pool[UIActionIndexMN_M_Machine] = new UIActionMenuManagerMachine(this);
3642 m_pool[UIActionIndexMN_M_Machine_S_New] = new UIActionSimpleManagerMachinePerformCreate(this);
3643 m_pool[UIActionIndexMN_M_Machine_S_Add] = new UIActionSimpleManagerMachinePerformAdd(this);
3644 m_pool[UIActionIndexMN_M_Machine_S_Settings] = new UIActionSimpleManagerMachineShowSettings(this);
3645 m_pool[UIActionIndexMN_M_Machine_S_Clone] = new UIActionSimpleManagerMachinePerformClone(this);
3646 m_pool[UIActionIndexMN_M_Machine_S_Move] = new UIActionSimpleManagerMachinePerformMove(this);
3647 m_pool[UIActionIndexMN_M_Machine_S_ExportToOCI] = new UIActionSimpleManagerMachinePerformExportToOCI(this);
3648 m_pool[UIActionIndexMN_M_Machine_S_Remove] = new UIActionSimpleManagerMachinePerformRemove(this);
3649 m_pool[UIActionIndexMN_M_Machine_M_MoveToGroup] = new UIActionMenuManagerCommonMoveToGroup(this);
3650 m_pool[UIActionIndexMN_M_Machine_M_MoveToGroup_S_New] = new UIActionSimpleManagerMachineMoveToGroupNew(this);
3651 m_pool[UIActionIndexMN_M_Machine_M_StartOrShow] = new UIActionStateManagerCommonStartOrShow(this);
3652 m_pool[UIActionIndexMN_M_Machine_M_StartOrShow_S_StartNormal] = new UIActionSimpleManagerCommonPerformStartNormal(this);
3653 m_pool[UIActionIndexMN_M_Machine_M_StartOrShow_S_StartHeadless] = new UIActionSimpleManagerCommonPerformStartHeadless(this);
3654 m_pool[UIActionIndexMN_M_Machine_M_StartOrShow_S_StartDetachable] = new UIActionSimpleManagerCommonPerformStartDetachable(this);
3655 m_pool[UIActionIndexMN_M_Machine_T_Pause] = new UIActionToggleManagerCommonPauseAndResume(this);
3656 m_pool[UIActionIndexMN_M_Machine_S_Reset] = new UIActionSimpleManagerCommonPerformReset(this);
3657 m_pool[UIActionIndexMN_M_Machine_S_Detach] = new UIActionSimpleManagerCommonPerformDetach(this);
3658 m_pool[UIActionIndexMN_M_Machine_M_Console] = new UIActionMenuManagerConsole(this);
3659 m_pool[UIActionIndexMN_M_Machine_M_Console_S_CreateConnection] = new UIActionSimpleManagerConsolePerformCreateConnection(this);
3660 m_pool[UIActionIndexMN_M_Machine_M_Console_S_DeleteConnection] = new UIActionSimpleManagerConsolePerformDeleteConnection(this);
3661 m_pool[UIActionIndexMN_M_Machine_M_Console_S_CopyCommandSerialUnix] = new UIActionSimpleManagerConsolePerformCopyCommand(this, true, true);
3662 m_pool[UIActionIndexMN_M_Machine_M_Console_S_CopyCommandSerialWindows] = new UIActionSimpleManagerConsolePerformCopyCommand(this, true, false);
3663 m_pool[UIActionIndexMN_M_Machine_M_Console_S_CopyCommandVNCUnix] = new UIActionSimpleManagerConsolePerformCopyCommand(this, false, true);
3664 m_pool[UIActionIndexMN_M_Machine_M_Console_S_CopyCommandVNCWindows] = new UIActionSimpleManagerConsolePerformCopyCommand(this, false, false);
3665 m_pool[UIActionIndexMN_M_Machine_M_Console_S_ConfigureApplications] = new UIActionSimpleManagerConsolePerformConfigureApplications(this);
3666 m_pool[UIActionIndexMN_M_Machine_M_Console_S_ShowLog] = new UIActionSimpleManagerConsolePerformShowLog(this);
3667 m_pool[UIActionIndexMN_M_Machine_M_Stop] = new UIActionMenuManagerStop(this);
3668 m_pool[UIActionIndexMN_M_Machine_M_Stop_S_SaveState] = new UIActionSimpleManagerStopPerformSave(this);
3669 m_pool[UIActionIndexMN_M_Machine_M_Stop_S_Terminate] = new UIActionSimpleManagerStopPerformTerminate(this);
3670 m_pool[UIActionIndexMN_M_Machine_M_Stop_S_Shutdown] = new UIActionSimpleManagerStopPerformShutdown(this);
3671 m_pool[UIActionIndexMN_M_Machine_M_Stop_S_PowerOff] = new UIActionSimpleManagerStopPerformPowerOff(this);
3672 m_pool[UIActionIndexMN_M_Machine_M_Tools] = new UIActionMenuManagerToolsMachine(this);
3673 m_pool[UIActionIndexMN_M_Machine_M_Tools_T_Details] = new UIActionToggleManagerToolsMachineShowDetails(this);
3674 m_pool[UIActionIndexMN_M_Machine_M_Tools_T_Snapshots] = new UIActionToggleManagerToolsMachineShowSnapshots(this);
3675 m_pool[UIActionIndexMN_M_Machine_M_Tools_T_Logs] = new UIActionToggleManagerToolsMachineShowLogs(this);
3676 m_pool[UIActionIndexMN_M_Machine_M_Tools_T_Activity] = new UIActionToggleManagerToolsMachineShowActivity(this);
3677 m_pool[UIActionIndexMN_M_Machine_M_Tools_T_FileManager] = new UIActionToggleManagerToolsMachineShowFileManager(this);
3678 m_pool[UIActionIndexMN_M_Machine_S_Discard] = new UIActionSimpleManagerCommonPerformDiscard(this);
3679 m_pool[UIActionIndexMN_M_Machine_S_Refresh] = new UIActionSimpleManagerCommonPerformRefresh(this);
3680 m_pool[UIActionIndexMN_M_Machine_S_ShowInFileManager] = new UIActionSimpleManagerCommonShowInFileManager(this);
3681 m_pool[UIActionIndexMN_M_Machine_S_CreateShortcut] = new UIActionSimpleManagerCommonPerformCreateShortcut(this);
3682 m_pool[UIActionIndexMN_M_Machine_S_SortParent] = new UIActionSimpleManagerMachinePerformSortParent(this);
3683 m_pool[UIActionIndexMN_M_Machine_T_Search] = new UIActionToggleManagerCommonToggleSearch(this);
3684
3685 /* Snapshot Pane actions: */
3686 m_pool[UIActionIndexMN_M_Snapshot] = new UIActionMenuManagerSnapshot(this);
3687 m_pool[UIActionIndexMN_M_Snapshot_S_Take] = new UIActionMenuManagerSnapshotPerformTake(this);
3688 m_pool[UIActionIndexMN_M_Snapshot_S_Delete] = new UIActionMenuManagerSnapshotPerformDelete(this);
3689 m_pool[UIActionIndexMN_M_Snapshot_S_Restore] = new UIActionMenuManagerSnapshotPerformRestore(this);
3690 m_pool[UIActionIndexMN_M_Snapshot_T_Properties] = new UIActionMenuManagerSnapshotToggleProperties(this);
3691 m_pool[UIActionIndexMN_M_Snapshot_S_Clone] = new UIActionMenuManagerSnapshotPerformClone(this);
3692
3693 /* Extension Pack Manager actions: */
3694 m_pool[UIActionIndexMN_M_ExtensionWindow] = new UIActionMenuManagerExtension(this);
3695 m_pool[UIActionIndexMN_M_Extension] = new UIActionMenuManagerExtension(this);
3696 m_pool[UIActionIndexMN_M_Extension_S_Install] = new UIActionSimpleManagerExtensionPerformInstall(this);
3697 m_pool[UIActionIndexMN_M_Extension_S_Uninstall] = new UIActionSimpleManagerExtensionPerformUninstall(this);
3698
3699 /* Virtual Medium Manager actions: */
3700 m_pool[UIActionIndexMN_M_MediumWindow] = new UIActionMenuManagerMedium(this);
3701 m_pool[UIActionIndexMN_M_Medium] = new UIActionMenuManagerMedium(this);
3702 m_pool[UIActionIndexMN_M_Medium_S_Add] = new UIActionMenuManagerMediumPerformAdd(this);
3703 m_pool[UIActionIndexMN_M_Medium_S_Create] = new UIActionMenuManagerMediumPerformCreate(this);
3704 m_pool[UIActionIndexMN_M_Medium_S_Copy] = new UIActionMenuManagerMediumPerformCopy(this);
3705 m_pool[UIActionIndexMN_M_Medium_S_Move] = new UIActionMenuManagerMediumPerformMove(this);
3706 m_pool[UIActionIndexMN_M_Medium_S_Remove] = new UIActionMenuManagerMediumPerformRemove(this);
3707 m_pool[UIActionIndexMN_M_Medium_S_Release] = new UIActionMenuManagerMediumPerformRelease(this);
3708 m_pool[UIActionIndexMN_M_Medium_T_Details] = new UIActionMenuManagerMediumToggleProperties(this);
3709 m_pool[UIActionIndexMN_M_Medium_T_Search] = new UIActionMenuManagerMediumToggleSearch(this);
3710 m_pool[UIActionIndexMN_M_Medium_S_Refresh] = new UIActionMenuManagerMediumPerformRefresh(this);
3711 m_pool[UIActionIndexMN_M_Medium_S_Clear] = new UIActionMenuManagerMediumPerformClear(this);
3712
3713 /* Network Manager actions: */
3714 m_pool[UIActionIndexMN_M_NetworkWindow] = new UIActionMenuManagerNetwork(this);
3715 m_pool[UIActionIndexMN_M_Network] = new UIActionMenuManagerNetwork(this);
3716 m_pool[UIActionIndexMN_M_Network_S_Create] = new UIActionMenuManagerNetworkPerformCreate(this);
3717 m_pool[UIActionIndexMN_M_Network_S_Remove] = new UIActionMenuManagerNetworkPerformRemove(this);
3718 m_pool[UIActionIndexMN_M_Network_T_Details] = new UIActionMenuManagerNetworkToggleProperties(this);
3719 m_pool[UIActionIndexMN_M_Network_S_Refresh] = new UIActionMenuManagerNetworkPerformRefresh(this);
3720
3721 /* Cloud Profile Manager actions: */
3722 m_pool[UIActionIndexMN_M_CloudWindow] = new UIActionMenuManagerCloud(this);
3723 m_pool[UIActionIndexMN_M_Cloud] = new UIActionMenuManagerCloud(this);
3724 m_pool[UIActionIndexMN_M_Cloud_S_Add] = new UIActionMenuManagerCloudPerformAdd(this);
3725 m_pool[UIActionIndexMN_M_Cloud_S_Import] = new UIActionMenuManagerCloudPerformImport(this);
3726 m_pool[UIActionIndexMN_M_Cloud_S_Remove] = new UIActionMenuManagerCloudPerformRemove(this);
3727 m_pool[UIActionIndexMN_M_Cloud_T_Details] = new UIActionMenuManagerCloudToggleProperties(this);
3728 m_pool[UIActionIndexMN_M_Cloud_S_TryPage] = new UIActionMenuManagerCloudShowTryPage(this);
3729 m_pool[UIActionIndexMN_M_Cloud_S_Help] = new UIActionMenuManagerCloudShowHelp(this);
3730
3731 /* Cloud Console Manager actions: */
3732 m_pool[UIActionIndexMN_M_CloudConsoleWindow] = new UIActionMenuManagerCloudConsole(this);
3733 m_pool[UIActionIndexMN_M_CloudConsole] = new UIActionMenuManagerCloudConsole(this);
3734 m_pool[UIActionIndexMN_M_CloudConsole_S_ApplicationAdd] = new UIActionMenuManagerCloudConsolePerformApplicationAdd(this);
3735 m_pool[UIActionIndexMN_M_CloudConsole_S_ApplicationRemove] = new UIActionMenuManagerCloudConsolePerformApplicationRemove(this);
3736 m_pool[UIActionIndexMN_M_CloudConsole_S_ProfileAdd] = new UIActionMenuManagerCloudConsolePerformProfileAdd(this);
3737 m_pool[UIActionIndexMN_M_CloudConsole_S_ProfileRemove] = new UIActionMenuManagerCloudConsolePerformProfileRemove(this);
3738 m_pool[UIActionIndexMN_M_CloudConsole_T_Details] = new UIActionMenuManagerCloudConsoleToggleProperties(this);
3739
3740 /* VM Activity Overview actions: */
3741 m_pool[UIActionIndexMN_M_VMActivityOverview] = new UIActionMenuVMActivityOverview(this);
3742 m_pool[UIActionIndexMN_M_VMActivityOverview_M_Columns] = new UIActionMenuManagerVMActivityOverviewColumns(this);
3743 m_pool[UIActionIndexMN_M_VMActivityOverview_S_SwitchToMachineActivity] = new UIActionMenuManagerVMActivityOverviewSwitchToMachineActivity(this);
3744
3745 /* 'File' action groups: */
3746 m_groupPool[UIActionIndexMN_M_File_M_Tools] = new QActionGroup(m_pool.value(UIActionIndexMN_M_File_M_Tools));
3747 m_groupPool[UIActionIndexMN_M_File_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_File_M_Tools_T_WelcomeScreen));
3748 m_groupPool[UIActionIndexMN_M_File_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_File_M_Tools_T_ExtensionPackManager));
3749 m_groupPool[UIActionIndexMN_M_File_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_File_M_Tools_T_VirtualMediaManager));
3750 m_groupPool[UIActionIndexMN_M_File_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_File_M_Tools_T_NetworkManager));
3751 m_groupPool[UIActionIndexMN_M_File_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_File_M_Tools_T_CloudProfileManager));
3752 m_groupPool[UIActionIndexMN_M_File_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_File_M_Tools_T_VMActivityOverview));
3753
3754 /* 'Group' action groups: */
3755 m_groupPool[UIActionIndexMN_M_Group_M_Tools] = new QActionGroup(m_pool.value(UIActionIndexMN_M_Group_M_Tools));
3756 m_groupPool[UIActionIndexMN_M_Group_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_Group_M_Tools_T_Details));
3757 m_groupPool[UIActionIndexMN_M_Group_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_Group_M_Tools_T_Snapshots));
3758 m_groupPool[UIActionIndexMN_M_Group_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_Group_M_Tools_T_Logs));
3759 m_groupPool[UIActionIndexMN_M_Group_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_Group_M_Tools_T_Activity));
3760 m_groupPool[UIActionIndexMN_M_Group_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_Group_M_Tools_T_FileManager));
3761
3762 /* 'Machine' action groups: */
3763 m_groupPool[UIActionIndexMN_M_Machine_M_Tools] = new QActionGroup(m_pool.value(UIActionIndexMN_M_Machine_M_Tools));
3764 m_groupPool[UIActionIndexMN_M_Machine_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_Machine_M_Tools_T_Details));
3765 m_groupPool[UIActionIndexMN_M_Machine_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_Machine_M_Tools_T_Snapshots));
3766 m_groupPool[UIActionIndexMN_M_Machine_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_Machine_M_Tools_T_Logs));
3767 m_groupPool[UIActionIndexMN_M_Machine_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_Machine_M_Tools_T_Activity));
3768 m_groupPool[UIActionIndexMN_M_Machine_M_Tools]->addAction(m_pool.value(UIActionIndexMN_M_Machine_M_Tools_T_FileManager));
3769
3770 /* Prepare update-handlers for known menus: */
3771 m_menuUpdateHandlers[UIActionIndexMN_M_File].ptfm = &UIActionPoolManager::updateMenuFile;
3772 m_menuUpdateHandlers[UIActionIndexMN_M_File_M_Tools].ptfm = &UIActionPoolManager::updateMenuFileTools;
3773 m_menuUpdateHandlers[UIActionIndexMN_M_Welcome].ptfm = &UIActionPoolManager::updateMenuWelcome;
3774 m_menuUpdateHandlers[UIActionIndexMN_M_Group].ptfm = &UIActionPoolManager::updateMenuGroup;
3775 m_menuUpdateHandlers[UIActionIndexMN_M_Machine].ptfm = &UIActionPoolManager::updateMenuMachine;
3776 m_menuUpdateHandlers[UIActionIndexMN_M_Group_M_MoveToGroup].ptfm = &UIActionPoolManager::updateMenuGroupMoveToGroup;
3777 m_menuUpdateHandlers[UIActionIndexMN_M_Machine_M_MoveToGroup].ptfm = &UIActionPoolManager::updateMenuMachineMoveToGroup;
3778 m_menuUpdateHandlers[UIActionIndexMN_M_Group_M_StartOrShow].ptfm = &UIActionPoolManager::updateMenuGroupStartOrShow;
3779 m_menuUpdateHandlers[UIActionIndexMN_M_Machine_M_StartOrShow].ptfm = &UIActionPoolManager::updateMenuMachineStartOrShow;
3780 m_menuUpdateHandlers[UIActionIndexMN_M_Group_M_Console].ptfm = &UIActionPoolManager::updateMenuGroupConsole;
3781 m_menuUpdateHandlers[UIActionIndexMN_M_Machine_M_Console].ptfm = &UIActionPoolManager::updateMenuMachineConsole;
3782 m_menuUpdateHandlers[UIActionIndexMN_M_Group_M_Stop].ptfm = &UIActionPoolManager::updateMenuGroupClose;
3783 m_menuUpdateHandlers[UIActionIndexMN_M_Machine_M_Stop].ptfm = &UIActionPoolManager::updateMenuMachineClose;
3784 m_menuUpdateHandlers[UIActionIndexMN_M_Group_M_Tools].ptfm = &UIActionPoolManager::updateMenuGroupTools;
3785 m_menuUpdateHandlers[UIActionIndexMN_M_Machine_M_Tools].ptfm = &UIActionPoolManager::updateMenuMachineTools;
3786 m_menuUpdateHandlers[UIActionIndexMN_M_ExtensionWindow].ptfm = &UIActionPoolManager::updateMenuExtensionWindow;
3787 m_menuUpdateHandlers[UIActionIndexMN_M_Extension].ptfm = &UIActionPoolManager::updateMenuExtension;
3788 m_menuUpdateHandlers[UIActionIndexMN_M_MediumWindow].ptfm = &UIActionPoolManager::updateMenuMediumWindow;
3789 m_menuUpdateHandlers[UIActionIndexMN_M_Medium].ptfm = &UIActionPoolManager::updateMenuMedium;
3790 m_menuUpdateHandlers[UIActionIndexMN_M_NetworkWindow].ptfm = &UIActionPoolManager::updateMenuNetworkWindow;
3791 m_menuUpdateHandlers[UIActionIndexMN_M_Network].ptfm = &UIActionPoolManager::updateMenuNetwork;
3792 m_menuUpdateHandlers[UIActionIndexMN_M_CloudWindow].ptfm = &UIActionPoolManager::updateMenuCloudWindow;
3793 m_menuUpdateHandlers[UIActionIndexMN_M_Cloud].ptfm = &UIActionPoolManager::updateMenuCloud;
3794 m_menuUpdateHandlers[UIActionIndexMN_M_CloudConsoleWindow].ptfm = &UIActionPoolManager::updateMenuCloudConsoleWindow;
3795 m_menuUpdateHandlers[UIActionIndexMN_M_CloudConsole].ptfm = &UIActionPoolManager::updateMenuCloudConsole;
3796 m_menuUpdateHandlers[UIActionIndexMN_M_VMActivityOverview].ptfm = &UIActionPoolManager::updateMenuVMActivityOverview;
3797 m_menuUpdateHandlers[UIActionIndexMN_M_Snapshot].ptfm = &UIActionPoolManager::updateMenuSnapshot;
3798
3799 /* Call to base-class: */
3800 UIActionPool::preparePool();
3801}
3802
3803void UIActionPoolManager::prepareConnections()
3804{
3805 /* Prepare connections: */
3806 connect(gShortcutPool, &UIShortcutPool::sigManagerShortcutsReloaded,
3807 this, &UIActionPoolManager::sltApplyShortcuts);
3808 connect(gShortcutPool, &UIShortcutPool::sigRuntimeShortcutsReloaded,
3809 this, &UIActionPoolManager::sltApplyShortcuts);
3810 connect(gEDataManager, &UIExtraDataManager::sigSettingsExpertModeChange,
3811 this, &UIActionPoolManager::sltHandleSettingsExpertModeChange);
3812
3813 /* Call to base-class: */
3814 UIActionPool::prepareConnections();
3815}
3816
3817void UIActionPoolManager::updateMenu(int iIndex)
3818{
3819 /* If index belongs to base-class => delegate to base-class: */
3820 if (iIndex < UIActionIndex_Max)
3821 UIActionPool::updateMenu(iIndex);
3822 /* Otherwise,
3823 * if menu with such index is invalidated
3824 * and there is update-handler => handle it here: */
3825 else if ( iIndex > UIActionIndex_Max
3826 && m_invalidations.contains(iIndex)
3827 && m_menuUpdateHandlers.contains(iIndex))
3828 (this->*(m_menuUpdateHandlers.value(iIndex).ptfm))();
3829}
3830
3831void UIActionPoolManager::updateMenus()
3832{
3833 /* Clear menu list: */
3834 m_mainMenus.clear();
3835
3836 /* 'File' menu: */
3837 addMenu(m_mainMenus, action(UIActionIndexMN_M_File));
3838 updateMenuFile();
3839
3840 /* 'File' / 'Tools' menu: */
3841 updateMenuFileTools();
3842
3843 /* 'Welcome' menu: */
3844 addMenu(m_mainMenus, action(UIActionIndexMN_M_Welcome));
3845 updateMenuWelcome();
3846 /* 'Group' menu: */
3847 addMenu(m_mainMenus, action(UIActionIndexMN_M_Group));
3848 updateMenuGroup();
3849 /* 'Machine' menu: */
3850 addMenu(m_mainMenus, action(UIActionIndexMN_M_Machine));
3851 updateMenuMachine();
3852
3853 /* 'Machine' / 'Move to Group' menu: */
3854 updateMenuMachineMoveToGroup();
3855 /* 'Group' / 'Start or Show' menu: */
3856 updateMenuGroupStartOrShow();
3857 /* 'Machine' / 'Start or Show' menu: */
3858 updateMenuMachineStartOrShow();
3859 /* 'Group' / 'Close' menu: */
3860 updateMenuGroupClose();
3861 /* 'Machine' / 'Close' menu: */
3862 updateMenuMachineClose();
3863 /* 'Group' / 'Tools' menu: */
3864 updateMenuGroupTools();
3865 /* 'Machine' / 'Tools' menu: */
3866 updateMenuMachineTools();
3867
3868 /* 'Extension Pack Manager' menu: */
3869 addMenu(m_mainMenus, action(UIActionIndexMN_M_Extension));
3870 updateMenuExtensionWindow();
3871 updateMenuExtension();
3872 /* 'Virtual Media Manager' menu: */
3873 addMenu(m_mainMenus, action(UIActionIndexMN_M_Medium));
3874 updateMenuMediumWindow();
3875 updateMenuMedium();
3876 /* 'Network Manager' menu: */
3877 addMenu(m_mainMenus, action(UIActionIndexMN_M_Network));
3878 updateMenuNetworkWindow();
3879 updateMenuNetwork();
3880 /* 'Cloud Profile Manager' menu: */
3881 addMenu(m_mainMenus, action(UIActionIndexMN_M_Cloud));
3882 updateMenuCloudWindow();
3883 updateMenuCloud();
3884 /* 'VM Activity Overview' menu: */
3885 addMenu(m_mainMenus, action(UIActionIndexMN_M_VMActivityOverview));
3886 updateMenuVMActivityOverview();
3887
3888 /* 'Snapshot' menu: */
3889 addMenu(m_mainMenus, action(UIActionIndexMN_M_Snapshot));
3890 updateMenuSnapshot();
3891 /* 'Log' menu: */
3892 addMenu(m_mainMenus, action(UIActionIndex_M_Log));
3893 updateMenuLogViewerWindow();
3894 updateMenuLogViewer();
3895 /* 'Activity' menu: */
3896 addMenu(m_mainMenus, action(UIActionIndex_M_Activity));
3897 updateMenuVMActivityMonitor();
3898
3899 /* 'File Manager' menu*/
3900 addMenu(m_mainMenus, action(UIActionIndex_M_FileManager));
3901 updateMenuFileManager();
3902
3903 /* 'Help' menu: */
3904 addMenu(m_mainMenus, action(UIActionIndex_Menu_Help));
3905 updateMenuHelp();
3906}
3907
3908void UIActionPoolManager::setShortcutsVisible(int iIndex, bool fVisible)
3909{
3910 /* Prepare a list of actions: */
3911 QList<UIAction*> actions;
3912
3913 /* Handle known menus: */
3914 switch (iIndex)
3915 {
3916 case UIActionIndexMN_M_Welcome:
3917 {
3918 actions << action(UIActionIndexMN_M_Welcome_S_New)
3919 << action(UIActionIndexMN_M_Welcome_S_Add);
3920 break;
3921 }
3922 case UIActionIndexMN_M_Group:
3923 {
3924 actions << action(UIActionIndexMN_M_Group_S_New)
3925 << action(UIActionIndexMN_M_Group_S_Add)
3926 << action(UIActionIndexMN_M_Group_S_Rename)
3927 << action(UIActionIndexMN_M_Group_S_Remove)
3928 << action(UIActionIndexMN_M_Group_M_MoveToGroup)
3929 << action(UIActionIndexMN_M_Group_M_StartOrShow)
3930 << action(UIActionIndexMN_M_Group_T_Pause)
3931 << action(UIActionIndexMN_M_Group_S_Reset)
3932 // << action(UIActionIndexMN_M_Group_S_Detach)
3933 << action(UIActionIndexMN_M_Group_S_Discard)
3934 << action(UIActionIndexMN_M_Group_S_Refresh)
3935 << action(UIActionIndexMN_M_Group_S_ShowInFileManager)
3936 << action(UIActionIndexMN_M_Group_S_CreateShortcut)
3937 << action(UIActionIndexMN_M_Group_S_Sort)
3938 << action(UIActionIndexMN_M_Group_M_StartOrShow_S_StartNormal)
3939 << action(UIActionIndexMN_M_Group_M_StartOrShow_S_StartHeadless)
3940 << action(UIActionIndexMN_M_Group_M_StartOrShow_S_StartDetachable)
3941 << action(UIActionIndexMN_M_Group_M_Console_S_CreateConnection)
3942 << action(UIActionIndexMN_M_Group_M_Console_S_DeleteConnection)
3943 << action(UIActionIndexMN_M_Group_M_Console_S_ConfigureApplications)
3944 << action(UIActionIndexMN_M_Group_M_Stop_S_SaveState)
3945 << action(UIActionIndexMN_M_Group_M_Stop_S_Terminate)
3946 << action(UIActionIndexMN_M_Group_M_Stop_S_Shutdown)
3947 << action(UIActionIndexMN_M_Group_M_Stop_S_PowerOff)
3948 << action(UIActionIndexMN_M_Group_M_Tools_T_Details)
3949 << action(UIActionIndexMN_M_Group_M_Tools_T_Snapshots)
3950 << action(UIActionIndexMN_M_Group_M_Tools_T_Logs)
3951 << action(UIActionIndexMN_M_Group_M_Tools_T_Activity);
3952 break;
3953 }
3954 case UIActionIndexMN_M_Machine:
3955 {
3956 actions << action(UIActionIndexMN_M_Machine_S_New)
3957 << action(UIActionIndexMN_M_Machine_S_Add)
3958 << action(UIActionIndexMN_M_Machine_S_Settings)
3959 << action(UIActionIndexMN_M_Machine_S_Clone)
3960 << action(UIActionIndexMN_M_Machine_S_Move)
3961 << action(UIActionIndexMN_M_Machine_S_ExportToOCI)
3962 << action(UIActionIndexMN_M_Machine_S_Remove)
3963 << action(UIActionIndexMN_M_Machine_M_MoveToGroup)
3964 << action(UIActionIndexMN_M_Machine_M_StartOrShow)
3965 << action(UIActionIndexMN_M_Machine_T_Pause)
3966 << action(UIActionIndexMN_M_Machine_S_Reset)
3967 // << action(UIActionIndexMN_M_Machine_S_Detach)
3968 << action(UIActionIndexMN_M_Machine_S_Discard)
3969 << action(UIActionIndexMN_M_Machine_S_Refresh)
3970 << action(UIActionIndexMN_M_Machine_S_ShowInFileManager)
3971 << action(UIActionIndexMN_M_Machine_S_CreateShortcut)
3972 << action(UIActionIndexMN_M_Machine_S_SortParent)
3973 << action(UIActionIndexMN_M_Machine_M_MoveToGroup_S_New)
3974 << action(UIActionIndexMN_M_Machine_M_StartOrShow_S_StartNormal)
3975 << action(UIActionIndexMN_M_Machine_M_StartOrShow_S_StartHeadless)
3976 << action(UIActionIndexMN_M_Machine_M_StartOrShow_S_StartDetachable)
3977 << action(UIActionIndexMN_M_Machine_M_Console_S_CreateConnection)
3978 << action(UIActionIndexMN_M_Machine_M_Console_S_DeleteConnection)
3979 << action(UIActionIndexMN_M_Machine_M_Console_S_CopyCommandSerialUnix)
3980 << action(UIActionIndexMN_M_Machine_M_Console_S_CopyCommandSerialWindows)
3981 << action(UIActionIndexMN_M_Machine_M_Console_S_CopyCommandVNCUnix)
3982 << action(UIActionIndexMN_M_Machine_M_Console_S_CopyCommandVNCWindows)
3983 << action(UIActionIndexMN_M_Machine_M_Console_S_ConfigureApplications)
3984 << action(UIActionIndexMN_M_Machine_M_Console_S_ShowLog)
3985 << action(UIActionIndexMN_M_Machine_M_Stop_S_SaveState)
3986 << action(UIActionIndexMN_M_Machine_M_Stop_S_Terminate)
3987 << action(UIActionIndexMN_M_Machine_M_Stop_S_Shutdown)
3988 << action(UIActionIndexMN_M_Machine_M_Stop_S_PowerOff)
3989 << action(UIActionIndexMN_M_Machine_M_Tools_T_Details)
3990 << action(UIActionIndexMN_M_Machine_M_Tools_T_Snapshots)
3991 << action(UIActionIndexMN_M_Machine_M_Tools_T_Logs)
3992 << action(UIActionIndexMN_M_Machine_M_Tools_T_Activity);
3993 break;
3994 }
3995 default:
3996 break;
3997 }
3998
3999 /* Update shortcut visibility: */
4000 foreach (UIAction *pAction, actions)
4001 fVisible ? pAction->showShortcut() : pAction->hideShortcut();
4002}
4003
4004QString UIActionPoolManager::shortcutsExtraDataID() const
4005{
4006 return GUI_Input_SelectorShortcuts;
4007}
4008
4009void UIActionPoolManager::updateShortcuts()
4010{
4011 /* Call to base-class: */
4012 UIActionPool::updateShortcuts();
4013 /* Create temporary Runtime UI pool to do the same: */
4014 if (!isTemporary())
4015 UIActionPool::createTemporary(UIType_RuntimeUI);
4016}
4017
4018void UIActionPoolManager::sltHandleSettingsExpertModeChange()
4019{
4020 /* Invalidate corresponding menus: */
4021 m_invalidations << UIActionIndexMN_M_File_M_Tools
4022 << UIActionIndexMN_M_Group_M_Tools
4023 << UIActionIndexMN_M_Machine_M_Tools
4024 << UIActionIndexMN_M_Snapshot;
4025}
4026
4027void UIActionPoolManager::updateMenuFile()
4028{
4029 /* Get corresponding menu: */
4030 UIMenu *pMenu = action(UIActionIndexMN_M_File)->menu();
4031 AssertPtrReturnVoid(pMenu);
4032 /* Clear contents: */
4033 pMenu->clear();
4034
4035 /* The Application / 'File' menu contents is very different depending on host type. */
4036
4037#ifdef VBOX_WS_MAC
4038
4039 /* 'About' action goes to Application menu: */
4040 pMenu->addAction(action(UIActionIndex_M_Application_S_About));
4041# ifdef VBOX_GUI_WITH_NETWORK_MANAGER
4042 /* 'Check for Updates' action goes to Application menu: */
4043 if (gEDataManager->applicationUpdateEnabled())
4044 pMenu->addAction(action(UIActionIndex_M_Application_S_CheckForUpdates));
4045# endif
4046 /* 'Reset Warnings' action goes to Application menu: */
4047 pMenu->addAction(action(UIActionIndex_M_Application_S_ResetWarnings));
4048 /* 'Preferences' action goes to Application menu: */
4049 pMenu->addAction(action(UIActionIndex_M_Application_S_Preferences));
4050 /* 'Close' action goes to Application menu: */
4051 pMenu->addAction(action(UIActionIndexMN_M_File_S_Close));
4052
4053 /* 'Import Appliance' action goes to 'File' menu: */
4054 pMenu->addAction(action(UIActionIndexMN_M_File_S_ImportAppliance));
4055 /* 'Export Appliance' action goes to 'File' menu: */
4056 pMenu->addAction(action(UIActionIndexMN_M_File_S_ExportAppliance));
4057# ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
4058 /* 'Show Extra-data Manager' action goes to 'File' menu for Debug build: */
4059 pMenu->addAction(action(UIActionIndexMN_M_File_S_ShowExtraDataManager));
4060# endif
4061 /* Separator after Import/Export actions of the 'File' menu: */
4062 pMenu->addSeparator();
4063 /* 'Tools' submenu goes to 'File' menu: */
4064 pMenu->addMenu(action(UIActionIndexMN_M_File_M_Tools)->menu());
4065#else /* !VBOX_WS_MAC */
4066
4067 /* 'Preferences' action goes to 'File' menu: */
4068 pMenu->addAction(action(UIActionIndex_M_Application_S_Preferences));
4069 /* Separator after 'Preferences' action of the 'File' menu: */
4070 pMenu->addSeparator();
4071 /* 'Import Appliance' action goes to 'File' menu: */
4072 pMenu->addAction(action(UIActionIndexMN_M_File_S_ImportAppliance));
4073 /* 'Export Appliance' action goes to 'File' menu: */
4074 pMenu->addAction(action(UIActionIndexMN_M_File_S_ExportAppliance));
4075 /* Separator after 'Export Appliance' action of the 'File' menu: */
4076 pMenu->addSeparator();
4077# ifdef VBOX_GUI_WITH_EXTRADATA_MANAGER_UI
4078 /* 'Extra-data Manager' action goes to 'File' menu for Debug build: */
4079 pMenu->addAction(action(UIActionIndexMN_M_File_S_ShowExtraDataManager));
4080 /* Separator after 'Extra-data Manager' action of the 'File' menu: */
4081 pMenu->addSeparator();
4082# endif
4083 /* 'Tools' submenu goes to 'File' menu: */
4084 pMenu->addMenu(action(UIActionIndexMN_M_File_M_Tools)->menu());
4085 /* Separator after 'Tools' submenu of the 'File' menu: */
4086 pMenu->addSeparator();
4087# ifdef VBOX_GUI_WITH_NETWORK_MANAGER
4088 /* 'Check for Updates' action goes to 'File' menu: */
4089 if (gEDataManager->applicationUpdateEnabled())
4090 pMenu->addAction(action(UIActionIndex_M_Application_S_CheckForUpdates));
4091# endif
4092 /* 'Reset Warnings' action goes 'File' menu: */
4093 pMenu->addAction(action(UIActionIndex_M_Application_S_ResetWarnings));
4094 /* Separator after 'Reset Warnings' action of the 'File' menu: */
4095 pMenu->addSeparator();
4096 /* 'Close' action goes to 'File' menu: */
4097 pMenu->addAction(action(UIActionIndexMN_M_File_S_Close));
4098
4099#endif /* !VBOX_WS_MAC */
4100
4101 /* Mark menu as valid: */
4102 m_invalidations.remove(UIActionIndexMN_M_File);
4103}
4104
4105void UIActionPoolManager::updateMenuFileTools()
4106{
4107 /* Get corresponding menu: */
4108 UIMenu *pMenu = action(UIActionIndexMN_M_File_M_Tools)->menu();
4109 AssertPtrReturnVoid(pMenu);
4110 /* Clear contents: */
4111 pMenu->clear();
4112
4113 /* Populate 'File' / 'Tools' menu: */
4114 const bool fExpertMode = gEDataManager->isSettingsInExpertMode();
4115 pMenu->addAction(action(UIActionIndexMN_M_File_M_Tools_T_ExtensionPackManager));
4116 if (fExpertMode)
4117 {
4118 pMenu->addAction(action(UIActionIndexMN_M_File_M_Tools_T_VirtualMediaManager));
4119 pMenu->addAction(action(UIActionIndexMN_M_File_M_Tools_T_NetworkManager));
4120 }
4121 pMenu->addAction(action(UIActionIndexMN_M_File_M_Tools_T_CloudProfileManager));
4122 pMenu->addAction(action(UIActionIndexMN_M_File_M_Tools_T_VMActivityOverview));
4123
4124 /* Mark menu as valid: */
4125 m_invalidations.remove(UIActionIndexMN_M_File_M_Tools);
4126}
4127
4128void UIActionPoolManager::updateMenuWelcome()
4129{
4130 /* Get corresponding menu: */
4131 UIMenu *pMenu = action(UIActionIndexMN_M_Welcome)->menu();
4132 AssertPtrReturnVoid(pMenu);
4133 /* Clear contents: */
4134 pMenu->clear();
4135
4136 /* Populate 'Welcome' menu: */
4137 pMenu->addAction(action(UIActionIndexMN_M_Welcome_S_New));
4138 pMenu->addAction(action(UIActionIndexMN_M_Welcome_S_Add));
4139
4140 /* Mark menu as valid: */
4141 m_invalidations.remove(UIActionIndexMN_M_Welcome);
4142}
4143
4144void UIActionPoolManager::updateMenuGroup()
4145{
4146 /* Get corresponding menu: */
4147 UIMenu *pMenu = action(UIActionIndexMN_M_Group)->menu();
4148 AssertPtrReturnVoid(pMenu);
4149 /* Clear contents: */
4150 pMenu->clear();
4151
4152#ifdef VBOX_WS_MAC
4153 // WORKAROUND:
4154 // On macOS you can't leave menu empty and still have it in
4155 // the menu-bar, you have to leave there at least something.
4156 // Remaining stuff will be appended from UIVirtualBoxManager.
4157 pMenu->addAction(action(UIActionIndexMN_M_Group_S_New));
4158#endif
4159
4160 /* This menu always remains invalid.. */
4161}
4162
4163void UIActionPoolManager::updateMenuMachine()
4164{
4165 /* Get corresponding menu: */
4166 UIMenu *pMenu = action(UIActionIndexMN_M_Machine)->menu();
4167 AssertPtrReturnVoid(pMenu);
4168 /* Clear contents: */
4169 pMenu->clear();
4170
4171#ifdef VBOX_WS_MAC
4172 // WORKAROUND:
4173 // On macOS you can't leave menu empty and still have it in
4174 // the menu-bar, you have to leave there at least something.
4175 // Remaining stuff will be appended from UIVirtualBoxManager.
4176 pMenu->addAction(action(UIActionIndexMN_M_Machine_S_New));
4177#endif
4178
4179 /* This menu always remains invalid.. */
4180}
4181
4182void UIActionPoolManager::updateMenuGroupMoveToGroup()
4183{
4184 /* Get corresponding menu: */
4185 UIMenu *pMenu = action(UIActionIndexMN_M_Group_M_MoveToGroup)->menu();
4186 AssertPtrReturnVoid(pMenu);
4187 /* Clear contents: */
4188 pMenu->clear();
4189
4190 /* This menu always remains invalid.. */
4191}
4192
4193void UIActionPoolManager::updateMenuMachineMoveToGroup()
4194{
4195 /* Get corresponding menu: */
4196 UIMenu *pMenu = action(UIActionIndexMN_M_Machine_M_MoveToGroup)->menu();
4197 AssertPtrReturnVoid(pMenu);
4198 /* Clear contents: */
4199 pMenu->clear();
4200
4201 /* Populate 'Machine' / 'Move to Group' menu: */
4202 pMenu->addAction(action(UIActionIndexMN_M_Machine_M_MoveToGroup_S_New));
4203
4204 /* This menu always remains invalid.. */
4205}
4206
4207void UIActionPoolManager::updateMenuGroupStartOrShow()
4208{
4209 /* Get corresponding menu: */
4210 UIMenu *pMenu = action(UIActionIndexMN_M_Group_M_StartOrShow)->menu();
4211 AssertPtrReturnVoid(pMenu);
4212 /* Clear contents: */
4213 pMenu->clear();
4214
4215 /* Populate 'Group' / 'Start or Show' menu: */
4216 pMenu->addAction(action(UIActionIndexMN_M_Group_M_StartOrShow_S_StartNormal));
4217 pMenu->addAction(action(UIActionIndexMN_M_Group_M_StartOrShow_S_StartHeadless));
4218 pMenu->addAction(action(UIActionIndexMN_M_Group_M_StartOrShow_S_StartDetachable));
4219
4220 /* Mark menu as valid: */
4221 m_invalidations.remove(UIActionIndexMN_M_Group_M_StartOrShow);
4222}
4223
4224void UIActionPoolManager::updateMenuMachineStartOrShow()
4225{
4226 /* Get corresponding menu: */
4227 UIMenu *pMenu = action(UIActionIndexMN_M_Machine_M_StartOrShow)->menu();
4228 AssertPtrReturnVoid(pMenu);
4229 /* Clear contents: */
4230 pMenu->clear();
4231
4232 /* Populate 'Machine' / 'Start or Show' menu: */
4233 pMenu->addAction(action(UIActionIndexMN_M_Machine_M_StartOrShow_S_StartNormal));
4234 pMenu->addAction(action(UIActionIndexMN_M_Machine_M_StartOrShow_S_StartHeadless));
4235 pMenu->addAction(action(UIActionIndexMN_M_Machine_M_StartOrShow_S_StartDetachable));
4236
4237 /* Mark menu as valid: */
4238 m_invalidations.remove(UIActionIndexMN_M_Machine_M_StartOrShow);
4239}
4240
4241void UIActionPoolManager::updateMenuGroupConsole()
4242{
4243 /* Get corresponding menu: */
4244 UIMenu *pMenu = action(UIActionIndexMN_M_Group_M_Console)->menu();
4245 AssertPtrReturnVoid(pMenu);
4246 /* Clear contents: */
4247 pMenu->clear();
4248
4249 /* This menu always remains invalid.. */
4250}
4251
4252void UIActionPoolManager::updateMenuMachineConsole()
4253{
4254 /* Get corresponding menu: */
4255 UIMenu *pMenu = action(UIActionIndexMN_M_Machine_M_Console)->menu();
4256 AssertPtrReturnVoid(pMenu);
4257 /* Clear contents: */
4258 pMenu->clear();
4259
4260 /* This menu always remains invalid.. */
4261}
4262
4263void UIActionPoolManager::updateMenuGroupClose()
4264{
4265 /* Get corresponding menu: */
4266 UIMenu *pMenu = action(UIActionIndexMN_M_Group_M_Stop)->menu();
4267 AssertPtrReturnVoid(pMenu);
4268 /* Clear contents: */
4269 pMenu->clear();
4270
4271#ifdef VBOX_WS_MAC
4272 // WORKAROUND:
4273 // On macOS you can't leave menu empty and still have it in
4274 // the menu-bar, you have to leave there at least something.
4275 // Remaining stuff will be appended from UIVirtualBoxManager.
4276 pMenu->addAction(action(UIActionIndexMN_M_Group_M_Stop_S_PowerOff));
4277#endif
4278
4279 /* This menu always remains invalid.. */
4280}
4281
4282void UIActionPoolManager::updateMenuMachineClose()
4283{
4284 /* Get corresponding menu: */
4285 UIMenu *pMenu = action(UIActionIndexMN_M_Machine_M_Stop)->menu();
4286 AssertPtrReturnVoid(pMenu);
4287 /* Clear contents: */
4288 pMenu->clear();
4289
4290#ifdef VBOX_WS_MAC
4291 // WORKAROUND:
4292 // On macOS you can't leave menu empty and still have it in
4293 // the menu-bar, you have to leave there at least something.
4294 // Remaining stuff will be appended from UIVirtualBoxManager.
4295 pMenu->addAction(action(UIActionIndexMN_M_Machine_M_Stop_S_PowerOff));
4296#endif
4297
4298 /* This menu always remains invalid.. */
4299}
4300
4301void UIActionPoolManager::updateMenuGroupTools()
4302{
4303 /* Get corresponding menu: */
4304 UIMenu *pMenu = action(UIActionIndexMN_M_Group_M_Tools)->menu();
4305 AssertPtrReturnVoid(pMenu);
4306 /* Clear contents: */
4307 pMenu->clear();
4308
4309 /* Populate 'Group' / 'Tools' menu: */
4310 const bool fExpertMode = gEDataManager->isSettingsInExpertMode();
4311 pMenu->addAction(action(UIActionIndexMN_M_Group_M_Tools_T_Details));
4312 pMenu->addAction(action(UIActionIndexMN_M_Group_M_Tools_T_Snapshots));
4313 pMenu->addAction(action(UIActionIndexMN_M_Group_M_Tools_T_Logs));
4314 pMenu->addAction(action(UIActionIndexMN_M_Group_M_Tools_T_Activity));
4315 if (fExpertMode)
4316 pMenu->addAction(action(UIActionIndexMN_M_Group_M_Tools_T_FileManager));
4317
4318 /* Mark menu as valid: */
4319 m_invalidations.remove(UIActionIndexMN_M_Group_M_Tools);
4320}
4321
4322void UIActionPoolManager::updateMenuMachineTools()
4323{
4324 /* Get corresponding menu: */
4325 UIMenu *pMenu = action(UIActionIndexMN_M_Machine_M_Tools)->menu();
4326 AssertPtrReturnVoid(pMenu);
4327 /* Clear contents: */
4328 pMenu->clear();
4329
4330 /* Populate 'Machine' / 'Tools' menu: */
4331 const bool fExpertMode = gEDataManager->isSettingsInExpertMode();
4332 pMenu->addAction(action(UIActionIndexMN_M_Machine_M_Tools_T_Details));
4333 pMenu->addAction(action(UIActionIndexMN_M_Machine_M_Tools_T_Snapshots));
4334 pMenu->addAction(action(UIActionIndexMN_M_Machine_M_Tools_T_Logs));
4335 pMenu->addAction(action(UIActionIndexMN_M_Machine_M_Tools_T_Activity));
4336 if (fExpertMode)
4337 pMenu->addAction(action(UIActionIndexMN_M_Machine_M_Tools_T_FileManager));
4338
4339 /* Mark menu as valid: */
4340 m_invalidations.remove(UIActionIndexMN_M_Machine_M_Tools);
4341}
4342
4343void UIActionPoolManager::updateMenuExtensionWindow()
4344{
4345 /* Update corresponding menu: */
4346 updateMenuExtensionWrapper(action(UIActionIndexMN_M_ExtensionWindow)->menu());
4347
4348 /* Mark menu as valid: */
4349 m_invalidations.remove(UIActionIndexMN_M_ExtensionWindow);
4350}
4351
4352void UIActionPoolManager::updateMenuExtension()
4353{
4354 /* Update corresponding menu: */
4355 updateMenuExtensionWrapper(action(UIActionIndexMN_M_Extension)->menu());
4356
4357 /* Mark menu as valid: */
4358 m_invalidations.remove(UIActionIndexMN_M_Extension);
4359}
4360
4361void UIActionPoolManager::updateMenuExtensionWrapper(UIMenu *pMenu)
4362{
4363 /* Clear contents: */
4364 pMenu->clear();
4365
4366 /* 'Add' action: */
4367 addAction(pMenu, action(UIActionIndexMN_M_Extension_S_Install));
4368 /* 'Remove' action: */
4369 addAction(pMenu, action(UIActionIndexMN_M_Extension_S_Uninstall));
4370}
4371
4372void UIActionPoolManager::updateMenuMediumWindow()
4373{
4374 /* Update corresponding menu: */
4375 updateMenuMediumWrapper(action(UIActionIndexMN_M_MediumWindow)->menu());
4376
4377 /* Mark menu as valid: */
4378 m_invalidations.remove(UIActionIndexMN_M_MediumWindow);
4379}
4380
4381void UIActionPoolManager::updateMenuMedium()
4382{
4383 /* Update corresponding menu: */
4384 updateMenuMediumWrapper(action(UIActionIndexMN_M_Medium)->menu());
4385
4386 /* Mark menu as valid: */
4387 m_invalidations.remove(UIActionIndexMN_M_Medium);
4388}
4389
4390void UIActionPoolManager::updateMenuMediumWrapper(UIMenu *pMenu)
4391{
4392 /* Clear contents: */
4393 pMenu->clear();
4394
4395 /* Separator? */
4396 bool fSeparator = false;
4397
4398 /* 'Add' action: */
4399 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Add)) || fSeparator;
4400 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Create)) || fSeparator;
4401
4402 /* Separator? */
4403 if (fSeparator)
4404 {
4405 pMenu->addSeparator();
4406 fSeparator = false;
4407 }
4408
4409 /* 'Copy' action: */
4410 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Copy)) || fSeparator;
4411 /* 'Move' action: */
4412 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Move)) || fSeparator;
4413 /* 'Remove' action: */
4414 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Remove)) || fSeparator;
4415 /* 'Release' action: */
4416 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Release)) || fSeparator;
4417 /* 'Clear' action: */
4418 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Clear)) || fSeparator;
4419 /* 'Search' action: */
4420 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_T_Search)) || fSeparator;
4421 /* 'Properties' action: */
4422 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_T_Details)) || fSeparator;
4423
4424 /* Separator? */
4425 if (fSeparator)
4426 {
4427 pMenu->addSeparator();
4428 fSeparator = false;
4429 }
4430
4431 /* 'Refresh' action: */
4432 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Medium_S_Refresh)) || fSeparator;;
4433}
4434
4435void UIActionPoolManager::updateMenuNetworkWindow()
4436{
4437 /* Update corresponding menu: */
4438 updateMenuNetworkWrapper(action(UIActionIndexMN_M_NetworkWindow)->menu());
4439
4440 /* Mark menu as valid: */
4441 m_invalidations.remove(UIActionIndexMN_M_NetworkWindow);
4442}
4443
4444void UIActionPoolManager::updateMenuNetwork()
4445{
4446 /* Update corresponding menu: */
4447 updateMenuNetworkWrapper(action(UIActionIndexMN_M_Network)->menu());
4448
4449 /* Mark menu as valid: */
4450 m_invalidations.remove(UIActionIndexMN_M_Network);
4451}
4452
4453void UIActionPoolManager::updateMenuNetworkWrapper(UIMenu *pMenu)
4454{
4455 /* Clear contents: */
4456 pMenu->clear();
4457
4458 /* Separator? */
4459 bool fSeparator = false;
4460
4461 /* 'Create' action: */
4462 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Network_S_Create)) || fSeparator;
4463
4464 /* Separator? */
4465 if (fSeparator)
4466 {
4467 pMenu->addSeparator();
4468 fSeparator = false;
4469 }
4470
4471 /* 'Remove' action: */
4472 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Network_S_Remove)) || fSeparator;
4473 /* 'Properties' action: */
4474 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Network_T_Details)) || fSeparator;
4475
4476// /* Separator? */
4477// if (fSeparator)
4478// {
4479// pMenu->addSeparator();
4480// fSeparator = false;
4481// }
4482
4483// /* 'Refresh' action: */
4484// fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Network_S_Refresh)) || fSeparator;;
4485}
4486
4487void UIActionPoolManager::updateMenuCloudWindow()
4488{
4489 /* Update corresponding menu: */
4490 updateMenuCloudWrapper(action(UIActionIndexMN_M_CloudWindow)->menu());
4491
4492 /* Mark menu as valid: */
4493 m_invalidations.remove(UIActionIndexMN_M_CloudWindow);
4494}
4495
4496void UIActionPoolManager::updateMenuCloud()
4497{
4498 /* Update corresponding menu: */
4499 updateMenuCloudWrapper(action(UIActionIndexMN_M_Cloud)->menu());
4500
4501 /* Mark menu as valid: */
4502 m_invalidations.remove(UIActionIndexMN_M_Cloud);
4503}
4504
4505void UIActionPoolManager::updateMenuCloudWrapper(UIMenu *pMenu)
4506{
4507 /* Clear contents: */
4508 pMenu->clear();
4509
4510 /* Separator? */
4511 bool fSeparator = false;
4512
4513 /* 'Add' action: */
4514 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Cloud_S_Add)) || fSeparator;
4515 /* 'Import' action: */
4516 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Cloud_S_Import)) || fSeparator;
4517
4518 /* Separator? */
4519 if (fSeparator)
4520 {
4521 pMenu->addSeparator();
4522 fSeparator = false;
4523 }
4524
4525 /* 'Remove' action: */
4526 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Cloud_S_Remove)) || fSeparator;
4527 /* 'Properties' action: */
4528 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Cloud_T_Details)) || fSeparator;
4529
4530 /* Separator? */
4531 if (fSeparator)
4532 {
4533 pMenu->addSeparator();
4534 fSeparator = false;
4535 }
4536
4537 /* 'Try Page' action: */
4538 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Cloud_S_TryPage)) || fSeparator;
4539 /* 'Help' action: */
4540 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_Cloud_S_Help)) || fSeparator;
4541}
4542
4543void UIActionPoolManager::updateMenuCloudConsoleWindow()
4544{
4545 /* Update corresponding menu: */
4546 updateMenuCloudConsoleWrapper(action(UIActionIndexMN_M_CloudConsoleWindow)->menu());
4547
4548 /* Mark menu as valid: */
4549 m_invalidations.remove(UIActionIndexMN_M_CloudConsoleWindow);
4550}
4551
4552void UIActionPoolManager::updateMenuCloudConsole()
4553{
4554 /* Update corresponding menu: */
4555 updateMenuCloudConsoleWrapper(action(UIActionIndexMN_M_CloudConsole)->menu());
4556
4557 /* Mark menu as valid: */
4558 m_invalidations.remove(UIActionIndexMN_M_CloudConsole);
4559}
4560
4561void UIActionPoolManager::updateMenuCloudConsoleWrapper(UIMenu *pMenu)
4562{
4563 /* Clear contents: */
4564 pMenu->clear();
4565
4566 /* Separator? */
4567 bool fSeparator = false;
4568
4569 /* 'Add Application' action: */
4570 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_CloudConsole_S_ApplicationAdd)) || fSeparator;
4571 /* 'Remove Application' action: */
4572 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_CloudConsole_S_ApplicationRemove)) || fSeparator;
4573
4574 /* Separator? */
4575 if (fSeparator)
4576 {
4577 pMenu->addSeparator();
4578 fSeparator = false;
4579 }
4580
4581 /* 'Add Profile' action: */
4582 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_CloudConsole_S_ProfileAdd)) || fSeparator;
4583 /* 'Remove Profile' action: */
4584 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_CloudConsole_S_ProfileRemove)) || fSeparator;
4585
4586 /* Separator? */
4587 if (fSeparator)
4588 {
4589 pMenu->addSeparator();
4590 fSeparator = false;
4591 }
4592
4593 /* 'Properties' action: */
4594 fSeparator = addAction(pMenu, action(UIActionIndexMN_M_CloudConsole_T_Details)) || fSeparator;
4595}
4596
4597void UIActionPoolManager::updateMenuVMActivityOverview()
4598{
4599 /* Update corresponding menu: */
4600 updateMenuVMActivityOverviewWrapper(action(UIActionIndexMN_M_VMActivityOverview)->menu());
4601
4602 /* Mark menu as valid: */
4603 m_invalidations.remove(UIActionIndexMN_M_VMActivityOverview);
4604}
4605
4606void UIActionPoolManager::updateMenuVMActivityOverviewWrapper(UIMenu *pMenu)
4607{
4608 /* Clear contents: */
4609 pMenu->clear();
4610 addAction(pMenu, action(UIActionIndexMN_M_VMActivityOverview_M_Columns));
4611 addAction(pMenu, action(UIActionIndexMN_M_VMActivityOverview_S_SwitchToMachineActivity));
4612}
4613
4614void UIActionPoolManager::updateMenuSnapshot()
4615{
4616 /* Get corresponding menu: */
4617 UIMenu *pMenu = action(UIActionIndexMN_M_Snapshot)->menu();
4618 AssertPtrReturnVoid(pMenu);
4619 /* Clear contents: */
4620 pMenu->clear();
4621
4622 /* Populate Snapshot-menu: */
4623 const bool fExpertMode = gEDataManager->isSettingsInExpertMode();
4624 pMenu->addAction(action(UIActionIndexMN_M_Snapshot_S_Take));
4625 pMenu->addAction(action(UIActionIndexMN_M_Snapshot_S_Delete));
4626 pMenu->addAction(action(UIActionIndexMN_M_Snapshot_S_Restore));
4627 pMenu->addAction(action(UIActionIndexMN_M_Snapshot_T_Properties));
4628 if (fExpertMode)
4629 pMenu->addAction(action(UIActionIndexMN_M_Snapshot_S_Clone));
4630
4631 /* Mark menu as valid: */
4632 m_invalidations.remove(UIActionIndexMN_M_Snapshot);
4633}
4634
4635
4636#include "UIActionPoolManager.moc"
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use