1 | /* $Id: UIActionPool.cpp 104447 2024-04-26 14:29:44Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox Qt GUI - UIActionPool class implementation.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2010-2023 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 | /* Qt includes: */
|
---|
29 | #include <QActionGroup>
|
---|
30 | #include <QApplication>
|
---|
31 | #include <QHelpEvent>
|
---|
32 | #include <QToolTip>
|
---|
33 |
|
---|
34 | /* GUI includes: */
|
---|
35 | #include "UIActionPool.h"
|
---|
36 | #include "UIActionPoolManager.h"
|
---|
37 | #include "UIActionPoolRuntime.h"
|
---|
38 | #include "UIConverter.h"
|
---|
39 | #include "UIIconPool.h"
|
---|
40 | #include "UIMessageCenter.h"
|
---|
41 | #include "UIShortcutPool.h"
|
---|
42 | #include "UITranslator.h"
|
---|
43 | #include "UITranslationEventListener.h"
|
---|
44 | #ifdef VBOX_GUI_WITH_NETWORK_MANAGER
|
---|
45 | # include "UIExtraDataManager.h"
|
---|
46 | # include "UINetworkRequestManager.h"
|
---|
47 | # include "UIUpdateManager.h"
|
---|
48 | #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
|
---|
49 |
|
---|
50 |
|
---|
51 | /** Additional Qt event types. */
|
---|
52 | enum UIEventTypeActionPool
|
---|
53 | {
|
---|
54 | UIEventTypeActionPool_ActivateAction = QEvent::User + 101,
|
---|
55 | };
|
---|
56 |
|
---|
57 | /** QEvent extension
|
---|
58 | * representing action-activation event. */
|
---|
59 | class ActivateActionEvent : public QEvent
|
---|
60 | {
|
---|
61 | public:
|
---|
62 |
|
---|
63 | /** Constructs @a pAction event. */
|
---|
64 | ActivateActionEvent(QAction *pAction)
|
---|
65 | : QEvent((QEvent::Type)UIEventTypeActionPool_ActivateAction)
|
---|
66 | , m_pAction(pAction)
|
---|
67 | {}
|
---|
68 |
|
---|
69 | /** Returns the action this event corresponds to. */
|
---|
70 | QAction *action() const { return m_pAction; }
|
---|
71 |
|
---|
72 | private:
|
---|
73 |
|
---|
74 | /** Holds the action this event corresponds to. */
|
---|
75 | QAction *m_pAction;
|
---|
76 | };
|
---|
77 |
|
---|
78 |
|
---|
79 | /*********************************************************************************************************************************
|
---|
80 | * Class UIMenu implementation. *
|
---|
81 | *********************************************************************************************************************************/
|
---|
82 |
|
---|
83 | UIMenu::UIMenu()
|
---|
84 | : m_fShowToolTip(false)
|
---|
85 | #ifdef VBOX_WS_MAC
|
---|
86 | , m_fConsumable(false)
|
---|
87 | , m_fConsumed(false)
|
---|
88 | #endif
|
---|
89 | {
|
---|
90 | }
|
---|
91 |
|
---|
92 | bool UIMenu::event(QEvent *pEvent)
|
---|
93 | {
|
---|
94 | /* Handle particular event-types: */
|
---|
95 | switch (pEvent->type())
|
---|
96 | {
|
---|
97 | /* Tool-tip request handler: */
|
---|
98 | case QEvent::ToolTip:
|
---|
99 | {
|
---|
100 | /* Get current help-event: */
|
---|
101 | QHelpEvent *pHelpEvent = static_cast<QHelpEvent*>(pEvent);
|
---|
102 | /* Get action which caused help-event: */
|
---|
103 | QAction *pAction = actionAt(pHelpEvent->pos());
|
---|
104 | /* If action present => show action's tool-tip if needed: */
|
---|
105 | if (pAction && m_fShowToolTip)
|
---|
106 | QToolTip::showText(pHelpEvent->globalPos(), pAction->toolTip());
|
---|
107 | break;
|
---|
108 | }
|
---|
109 | default:
|
---|
110 | break;
|
---|
111 | }
|
---|
112 | /* Call to base-class: */
|
---|
113 | return QMenu::event(pEvent);
|
---|
114 | }
|
---|
115 |
|
---|
116 |
|
---|
117 | /*********************************************************************************************************************************
|
---|
118 | * Class UIAction implementation. *
|
---|
119 | *********************************************************************************************************************************/
|
---|
120 |
|
---|
121 | UIAction::UIAction(UIActionPool *pParent, UIActionType enmType, bool fMachineMenuAction /* = false */)
|
---|
122 | : QAction(pParent)
|
---|
123 | , m_pActionPool(pParent)
|
---|
124 | , m_enmActionPoolType(pParent->type())
|
---|
125 | , m_enmType(enmType)
|
---|
126 | , m_fMachineMenuAction(fMachineMenuAction)
|
---|
127 | , m_iState(0)
|
---|
128 | , m_fShortcutHidden(false)
|
---|
129 | {
|
---|
130 | /* By default there is no specific menu role.
|
---|
131 | * It will be set explicitly later. */
|
---|
132 | setMenuRole(QAction::NoRole);
|
---|
133 |
|
---|
134 | #ifdef VBOX_WS_MAC
|
---|
135 | /* Make sure each action notifies it's parent about hovering: */
|
---|
136 | connect(this, &UIAction::hovered,
|
---|
137 | static_cast<UIActionPool*>(parent()), &UIActionPool::sltActionHovered);
|
---|
138 | #endif
|
---|
139 | }
|
---|
140 |
|
---|
141 | UIMenu *UIAction::menu() const
|
---|
142 | {
|
---|
143 | return QAction::menu() ? qobject_cast<UIMenu*>(QAction::menu()) : 0;
|
---|
144 | }
|
---|
145 |
|
---|
146 | void UIAction::setState(int iState)
|
---|
147 | {
|
---|
148 | m_iState = iState;
|
---|
149 | updateIcon();
|
---|
150 | retranslateUi();
|
---|
151 | handleStateChange();
|
---|
152 | }
|
---|
153 |
|
---|
154 | void UIAction::setIcon(int iState, const QIcon &icon)
|
---|
155 | {
|
---|
156 | m_icons.resize(iState + 1);
|
---|
157 | m_icons[iState] = icon;
|
---|
158 | updateIcon();
|
---|
159 | }
|
---|
160 |
|
---|
161 | void UIAction::setIcon(const QIcon &icon)
|
---|
162 | {
|
---|
163 | setIcon(0, icon);
|
---|
164 | }
|
---|
165 |
|
---|
166 | void UIAction::setName(const QString &strName)
|
---|
167 | {
|
---|
168 | /* Remember internal name: */
|
---|
169 | m_strName = strName;
|
---|
170 | /* Update text according new name: */
|
---|
171 | updateText();
|
---|
172 | }
|
---|
173 |
|
---|
174 | void UIAction::setShortcuts(const QList<QKeySequence> &shortcuts)
|
---|
175 | {
|
---|
176 | /* Only for manager's action-pool: */
|
---|
177 | if (m_enmActionPoolType == UIType_ManagerUI)
|
---|
178 | {
|
---|
179 | /* If primary shortcut should be visible: */
|
---|
180 | if (!m_fShortcutHidden)
|
---|
181 | /* Call to base-class: */
|
---|
182 | QAction::setShortcuts(shortcuts);
|
---|
183 | /* Remember shortcuts: */
|
---|
184 | m_shortcuts = shortcuts;
|
---|
185 | }
|
---|
186 | /* Update text according to new primary shortcut: */
|
---|
187 | updateText();
|
---|
188 | }
|
---|
189 |
|
---|
190 | void UIAction::showShortcut()
|
---|
191 | {
|
---|
192 | m_fShortcutHidden = false;
|
---|
193 | if (!m_shortcuts.isEmpty())
|
---|
194 | QAction::setShortcuts(m_shortcuts);
|
---|
195 | }
|
---|
196 |
|
---|
197 | void UIAction::hideShortcut()
|
---|
198 | {
|
---|
199 | m_fShortcutHidden = true;
|
---|
200 | if (!shortcut().isEmpty())
|
---|
201 | QAction::setShortcuts(QList<QKeySequence>());
|
---|
202 | }
|
---|
203 |
|
---|
204 | QString UIAction::nameInMenu() const
|
---|
205 | {
|
---|
206 | /* Action-name format depends on action-pool type: */
|
---|
207 | switch (m_enmActionPoolType)
|
---|
208 | {
|
---|
209 | /* Unchanged name for Manager UI: */
|
---|
210 | case UIType_ManagerUI: return name();
|
---|
211 | /* Filtered name for Runtime UI: */
|
---|
212 | case UIType_RuntimeUI: return UITranslator::removeAccelMark(name());
|
---|
213 | }
|
---|
214 | /* Nothing by default: */
|
---|
215 | return QString();
|
---|
216 | }
|
---|
217 |
|
---|
218 | void UIAction::updateIcon()
|
---|
219 | {
|
---|
220 | QAction::setIcon(m_icons.value(m_iState, m_icons.value(0)));
|
---|
221 | }
|
---|
222 |
|
---|
223 | void UIAction::updateText()
|
---|
224 | {
|
---|
225 | /* First of all, action-text depends on action type: */
|
---|
226 | switch (m_enmType)
|
---|
227 | {
|
---|
228 | case UIActionType_Menu:
|
---|
229 | {
|
---|
230 | /* For menu types it's very easy: */
|
---|
231 | setText(nameInMenu());
|
---|
232 | break;
|
---|
233 | }
|
---|
234 | default:
|
---|
235 | {
|
---|
236 | /* For rest of action types it depends on action-pool type: */
|
---|
237 | switch (m_enmActionPoolType)
|
---|
238 | {
|
---|
239 | /* The same as menu name for Manager UI: */
|
---|
240 | case UIType_ManagerUI:
|
---|
241 | {
|
---|
242 | setText(nameInMenu());
|
---|
243 | break;
|
---|
244 | }
|
---|
245 | /* With shortcut appended for Runtime UI: */
|
---|
246 | case UIType_RuntimeUI:
|
---|
247 | {
|
---|
248 | if (m_fMachineMenuAction)
|
---|
249 | setText(UITranslator::insertKeyToActionText(nameInMenu(),
|
---|
250 | gShortcutPool->shortcut(actionPool(), this).primaryToPortableText()));
|
---|
251 | else
|
---|
252 | setText(nameInMenu());
|
---|
253 | break;
|
---|
254 | }
|
---|
255 | }
|
---|
256 | break;
|
---|
257 | }
|
---|
258 | }
|
---|
259 | }
|
---|
260 |
|
---|
261 | /* static */
|
---|
262 | QString UIAction::simplifyText(QString strText)
|
---|
263 | {
|
---|
264 | return strText.remove('.').remove('&');
|
---|
265 | }
|
---|
266 |
|
---|
267 |
|
---|
268 | /*********************************************************************************************************************************
|
---|
269 | * Class UIActionMenu implementation. *
|
---|
270 | *********************************************************************************************************************************/
|
---|
271 |
|
---|
272 | UIActionMenu::UIActionMenu(UIActionPool *pParent,
|
---|
273 | const QString &strIcon, const QString &strIconDisabled)
|
---|
274 | : UIAction(pParent, UIActionType_Menu)
|
---|
275 | , m_pMenu(0)
|
---|
276 | {
|
---|
277 | if (!strIcon.isNull())
|
---|
278 | setIcon(UIIconPool::iconSet(strIcon, strIconDisabled));
|
---|
279 | prepare();
|
---|
280 | }
|
---|
281 |
|
---|
282 | UIActionMenu::UIActionMenu(UIActionPool *pParent,
|
---|
283 | const QString &strIconNormal, const QString &strIconSmall,
|
---|
284 | const QString &strIconNormalDisabled, const QString &strIconSmallDisabled)
|
---|
285 | : UIAction(pParent, UIActionType_Menu)
|
---|
286 | , m_pMenu(0)
|
---|
287 | {
|
---|
288 | if (!strIconNormal.isNull())
|
---|
289 | setIcon(UIIconPool::iconSetFull(strIconNormal, strIconSmall, strIconNormalDisabled, strIconSmallDisabled));
|
---|
290 | prepare();
|
---|
291 | }
|
---|
292 |
|
---|
293 | UIActionMenu::UIActionMenu(UIActionPool *pParent,
|
---|
294 | const QIcon &icon)
|
---|
295 | : UIAction(pParent, UIActionType_Menu)
|
---|
296 | , m_pMenu(0)
|
---|
297 | {
|
---|
298 | if (!icon.isNull())
|
---|
299 | setIcon(icon);
|
---|
300 | prepare();
|
---|
301 | }
|
---|
302 |
|
---|
303 | UIActionMenu::~UIActionMenu()
|
---|
304 | {
|
---|
305 | #if !defined(VBOX_IS_QT6_OR_LATER) || !defined(RT_OS_DARWIN) /** @todo qt6: Tcrashes in QCocoaMenuBar::menuForTag during GUI
|
---|
306 | * termination, so disabled it for now and hope it isn't needed. */
|
---|
307 | /* Hide menu: */
|
---|
308 | hideMenu();
|
---|
309 | #endif
|
---|
310 | /* Delete menu: */
|
---|
311 | delete m_pMenu;
|
---|
312 | m_pMenu = 0;
|
---|
313 | }
|
---|
314 |
|
---|
315 | void UIActionMenu::setShowToolTip(bool fShowToolTip)
|
---|
316 | {
|
---|
317 | AssertPtrReturnVoid(m_pMenu);
|
---|
318 | m_pMenu->setShowToolTip(fShowToolTip);
|
---|
319 | }
|
---|
320 |
|
---|
321 | void UIActionMenu::showMenu()
|
---|
322 | {
|
---|
323 | /* Show menu if necessary: */
|
---|
324 | if (!menu())
|
---|
325 | setMenu(m_pMenu);
|
---|
326 | }
|
---|
327 |
|
---|
328 | void UIActionMenu::hideMenu()
|
---|
329 | {
|
---|
330 | /* Hide menu if necessary: */
|
---|
331 | if (menu())
|
---|
332 | setMenu((QMenu *)0);
|
---|
333 | }
|
---|
334 |
|
---|
335 | void UIActionMenu::prepare()
|
---|
336 | {
|
---|
337 | /* Create menu: */
|
---|
338 | m_pMenu = new UIMenu;
|
---|
339 | AssertPtrReturnVoid(m_pMenu);
|
---|
340 | {
|
---|
341 | /* Prepare menu: */
|
---|
342 | connect(m_pMenu, &UIMenu::aboutToShow,
|
---|
343 | actionPool(), &UIActionPool::sltHandleMenuPrepare);
|
---|
344 | /* Show menu: */
|
---|
345 | showMenu();
|
---|
346 | }
|
---|
347 | }
|
---|
348 |
|
---|
349 |
|
---|
350 | /*********************************************************************************************************************************
|
---|
351 | * Class UIActionSimple implementation. *
|
---|
352 | *********************************************************************************************************************************/
|
---|
353 |
|
---|
354 | UIActionSimple::UIActionSimple(UIActionPool *pParent,
|
---|
355 | bool fMachineMenuAction /* = false */)
|
---|
356 | : UIAction(pParent, UIActionType_Simple, fMachineMenuAction)
|
---|
357 | {
|
---|
358 | }
|
---|
359 |
|
---|
360 | UIActionSimple::UIActionSimple(UIActionPool *pParent,
|
---|
361 | const QString &strIcon, const QString &strIconDisabled,
|
---|
362 | bool fMachineMenuAction /* = false */)
|
---|
363 | : UIAction(pParent, UIActionType_Simple, fMachineMenuAction)
|
---|
364 | {
|
---|
365 | if (!strIcon.isNull())
|
---|
366 | setIcon(UIIconPool::iconSet(strIcon, strIconDisabled));
|
---|
367 | }
|
---|
368 |
|
---|
369 | UIActionSimple::UIActionSimple(UIActionPool *pParent,
|
---|
370 | const QString &strIconNormal, const QString &strIconSmall,
|
---|
371 | const QString &strIconNormalDisabled, const QString &strIconSmallDisabled,
|
---|
372 | bool fMachineMenuAction /* = false */)
|
---|
373 | : UIAction(pParent, UIActionType_Simple, fMachineMenuAction)
|
---|
374 | {
|
---|
375 | if (!strIconNormal.isNull())
|
---|
376 | setIcon(UIIconPool::iconSetFull(strIconNormal, strIconSmall, strIconNormalDisabled, strIconSmallDisabled));
|
---|
377 | }
|
---|
378 |
|
---|
379 | UIActionSimple::UIActionSimple(UIActionPool *pParent,
|
---|
380 | const QIcon &icon,
|
---|
381 | bool fMachineMenuAction /* = false */)
|
---|
382 | : UIAction(pParent, UIActionType_Simple, fMachineMenuAction)
|
---|
383 | {
|
---|
384 | if (!icon.isNull())
|
---|
385 | setIcon(icon);
|
---|
386 | }
|
---|
387 |
|
---|
388 |
|
---|
389 | /*********************************************************************************************************************************
|
---|
390 | * Class UIActionToggle implementation. *
|
---|
391 | *********************************************************************************************************************************/
|
---|
392 |
|
---|
393 | UIActionToggle::UIActionToggle(UIActionPool *pParent,
|
---|
394 | bool fMachineMenuAction /* = false */)
|
---|
395 | : UIAction(pParent, UIActionType_Toggle, fMachineMenuAction)
|
---|
396 | {
|
---|
397 | prepare();
|
---|
398 | }
|
---|
399 |
|
---|
400 | UIActionToggle::UIActionToggle(UIActionPool *pParent,
|
---|
401 | const QString &strIcon, const QString &strIconDisabled,
|
---|
402 | bool fMachineMenuAction /* = false */)
|
---|
403 | : UIAction(pParent, UIActionType_Toggle, fMachineMenuAction)
|
---|
404 | {
|
---|
405 | if (!strIcon.isNull())
|
---|
406 | setIcon(UIIconPool::iconSet(strIcon, strIconDisabled));
|
---|
407 | prepare();
|
---|
408 | }
|
---|
409 |
|
---|
410 | UIActionToggle::UIActionToggle(UIActionPool *pParent,
|
---|
411 | const QString &strIconOn, const QString &strIconOff,
|
---|
412 | const QString &strIconOnDisabled, const QString &strIconOffDisabled,
|
---|
413 | bool fMachineMenuAction /* = false */)
|
---|
414 | : UIAction(pParent, UIActionType_Toggle, fMachineMenuAction)
|
---|
415 | {
|
---|
416 | if (!strIconOn.isNull())
|
---|
417 | setIcon(UIIconPool::iconSetOnOff(strIconOn, strIconOff, strIconOnDisabled, strIconOffDisabled));
|
---|
418 | prepare();
|
---|
419 | }
|
---|
420 |
|
---|
421 | UIActionToggle::UIActionToggle(UIActionPool *pParent,
|
---|
422 | const QIcon &icon,
|
---|
423 | bool fMachineMenuAction /* = false */)
|
---|
424 | : UIAction(pParent, UIActionType_Toggle, fMachineMenuAction)
|
---|
425 | {
|
---|
426 | if (!icon.isNull())
|
---|
427 | setIcon(icon);
|
---|
428 | prepare();
|
---|
429 | }
|
---|
430 |
|
---|
431 | void UIActionToggle::prepare()
|
---|
432 | {
|
---|
433 | setCheckable(true);
|
---|
434 | }
|
---|
435 |
|
---|
436 |
|
---|
437 | /** Menu action extension, used as 'Application' menu class. */
|
---|
438 | class UIActionMenuApplication : public UIActionMenu
|
---|
439 | {
|
---|
440 | Q_OBJECT;
|
---|
441 |
|
---|
442 | public:
|
---|
443 |
|
---|
444 | /** Constructs action passing @a pParent to the base-class. */
|
---|
445 | UIActionMenuApplication(UIActionPool *pParent)
|
---|
446 | : UIActionMenu(pParent)
|
---|
447 | {
|
---|
448 | #ifdef VBOX_WS_MAC
|
---|
449 | menu()->setConsumable(true);
|
---|
450 | #endif
|
---|
451 | retranslateUi();
|
---|
452 | }
|
---|
453 |
|
---|
454 | protected:
|
---|
455 |
|
---|
456 | /** Returns action extra-data ID. */
|
---|
457 | virtual int extraDataID() const RT_OVERRIDE
|
---|
458 | {
|
---|
459 | return UIExtraDataMetaDefs::MenuType_Application;
|
---|
460 | }
|
---|
461 | /** Returns action extra-data key. */
|
---|
462 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
463 | {
|
---|
464 | return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuType_Application);
|
---|
465 | }
|
---|
466 | /** Returns whether action is allowed. */
|
---|
467 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
468 | {
|
---|
469 | return actionPool()->isAllowedInMenuBar(UIExtraDataMetaDefs::MenuType_Application);
|
---|
470 | }
|
---|
471 |
|
---|
472 | /** Handles translation event. */
|
---|
473 | virtual void retranslateUi() RT_OVERRIDE
|
---|
474 | {
|
---|
475 | #ifdef VBOX_WS_MAC
|
---|
476 | setName(QApplication::translate("UIActionPool", "&VirtualBox"));
|
---|
477 | #else
|
---|
478 | setName(QApplication::translate("UIActionPool", "&File"));
|
---|
479 | #endif
|
---|
480 | }
|
---|
481 | };
|
---|
482 |
|
---|
483 | /** Simple action extension, used as 'Close' action class. */
|
---|
484 | class UIActionSimplePerformClose : public UIActionSimple
|
---|
485 | {
|
---|
486 | Q_OBJECT;
|
---|
487 |
|
---|
488 | public:
|
---|
489 |
|
---|
490 | /** Constructs action passing @a pParent to the base-class. */
|
---|
491 | UIActionSimplePerformClose(UIActionPool *pParent)
|
---|
492 | : UIActionSimple(pParent, ":/exit_16px.png", ":/exit_16px.png", true)
|
---|
493 | {
|
---|
494 | setMenuRole(QAction::QuitRole);
|
---|
495 | }
|
---|
496 |
|
---|
497 | protected:
|
---|
498 |
|
---|
499 | /** Returns action extra-data ID. */
|
---|
500 | virtual int extraDataID() const RT_OVERRIDE
|
---|
501 | {
|
---|
502 | return UIExtraDataMetaDefs::MenuApplicationActionType_Close;
|
---|
503 | }
|
---|
504 | /** Returns action extra-data key. */
|
---|
505 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
506 | {
|
---|
507 | return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuApplicationActionType_Close);
|
---|
508 | }
|
---|
509 | /** Returns whether action is allowed. */
|
---|
510 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
511 | {
|
---|
512 | return actionPool()->isAllowedInMenuApplication(UIExtraDataMetaDefs::MenuApplicationActionType_Close);
|
---|
513 | }
|
---|
514 |
|
---|
515 | /** Returns shortcut extra-data ID. */
|
---|
516 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
517 | {
|
---|
518 | return QString("Close");
|
---|
519 | }
|
---|
520 |
|
---|
521 | /** Returns default shortcut. */
|
---|
522 | virtual QKeySequence defaultShortcut(UIType enmActionPoolType) const RT_OVERRIDE
|
---|
523 | {
|
---|
524 | switch (enmActionPoolType)
|
---|
525 | {
|
---|
526 | case UIType_ManagerUI: break;
|
---|
527 | case UIType_RuntimeUI: return QKeySequence("Q");
|
---|
528 | }
|
---|
529 | return QKeySequence();
|
---|
530 | }
|
---|
531 |
|
---|
532 | /** Handles translation event. */
|
---|
533 | virtual void retranslateUi() RT_OVERRIDE
|
---|
534 | {
|
---|
535 | setName(QApplication::translate("UIActionPool", "&Close..."));
|
---|
536 | setStatusTip(QApplication::translate("UIActionPool", "Close the virtual machine"));
|
---|
537 | }
|
---|
538 | };
|
---|
539 |
|
---|
540 | #ifdef VBOX_WS_MAC
|
---|
541 | /** Menu action extension, used as 'Window' menu class. */
|
---|
542 | class UIActionMenuWindow : public UIActionMenu
|
---|
543 | {
|
---|
544 | Q_OBJECT;
|
---|
545 |
|
---|
546 | public:
|
---|
547 |
|
---|
548 | /** Constructs action passing @a pParent to the base-class. */
|
---|
549 | UIActionMenuWindow(UIActionPool *pParent)
|
---|
550 | : UIActionMenu(pParent)
|
---|
551 | {}
|
---|
552 |
|
---|
553 | protected:
|
---|
554 |
|
---|
555 | /** Returns action extra-data ID. */
|
---|
556 | virtual int extraDataID() const RT_OVERRIDE
|
---|
557 | {
|
---|
558 | return UIExtraDataMetaDefs::MenuType_Window;
|
---|
559 | }
|
---|
560 | /** Returns action extra-data key. */
|
---|
561 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
562 | {
|
---|
563 | return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuType_Window);
|
---|
564 | }
|
---|
565 | /** Returns whether action is allowed. */
|
---|
566 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
567 | {
|
---|
568 | return actionPool()->isAllowedInMenuBar(UIExtraDataMetaDefs::MenuType_Window);
|
---|
569 | }
|
---|
570 |
|
---|
571 | /** Handles translation event. */
|
---|
572 | virtual void retranslateUi() RT_OVERRIDE
|
---|
573 | {
|
---|
574 | setName(QApplication::translate("UIActionPool", "&Window"));
|
---|
575 | }
|
---|
576 | };
|
---|
577 |
|
---|
578 | /** Simple action extension, used as 'Minimize' action class. */
|
---|
579 | class UIActionSimpleMinimize : public UIActionSimple
|
---|
580 | {
|
---|
581 | Q_OBJECT;
|
---|
582 |
|
---|
583 | public:
|
---|
584 |
|
---|
585 | /** Constructs action passing @a pParent to the base-class. */
|
---|
586 | UIActionSimpleMinimize(UIActionPool *pParent)
|
---|
587 | : UIActionSimple(pParent)
|
---|
588 | {}
|
---|
589 |
|
---|
590 | protected:
|
---|
591 |
|
---|
592 | /** Returns action extra-data ID. */
|
---|
593 | virtual int extraDataID() const RT_OVERRIDE
|
---|
594 | {
|
---|
595 | return UIExtraDataMetaDefs::MenuWindowActionType_Minimize;
|
---|
596 | }
|
---|
597 | /** Returns action extra-data key. */
|
---|
598 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
599 | {
|
---|
600 | return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuWindowActionType_Minimize);
|
---|
601 | }
|
---|
602 | /** Returns whether action is allowed. */
|
---|
603 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
604 | {
|
---|
605 | return actionPool()->isAllowedInMenuWindow(UIExtraDataMetaDefs::MenuWindowActionType_Minimize);
|
---|
606 | }
|
---|
607 |
|
---|
608 | /** Returns shortcut extra-data ID. */
|
---|
609 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
610 | {
|
---|
611 | return QString("Minimize");
|
---|
612 | }
|
---|
613 |
|
---|
614 | /** Handles translation event. */
|
---|
615 | virtual void retranslateUi() RT_OVERRIDE
|
---|
616 | {
|
---|
617 | setName(QApplication::translate("UIActionPool", "&Minimize"));
|
---|
618 | setStatusTip(QApplication::translate("UIActionPool", "Minimize active window"));
|
---|
619 | }
|
---|
620 | };
|
---|
621 | #endif /* VBOX_WS_MAC */
|
---|
622 |
|
---|
623 | /** Menu action extension, used as 'Help' menu class. */
|
---|
624 | class UIActionMenuHelp : public UIActionMenu
|
---|
625 | {
|
---|
626 | Q_OBJECT;
|
---|
627 |
|
---|
628 | public:
|
---|
629 |
|
---|
630 | /** Constructs action passing @a pParent to the base-class. */
|
---|
631 | UIActionMenuHelp(UIActionPool *pParent)
|
---|
632 | : UIActionMenu(pParent)
|
---|
633 | {
|
---|
634 | retranslateUi();
|
---|
635 | }
|
---|
636 |
|
---|
637 | protected:
|
---|
638 |
|
---|
639 | /** Returns action extra-data ID. */
|
---|
640 | virtual int extraDataID() const RT_OVERRIDE
|
---|
641 | {
|
---|
642 | return UIExtraDataMetaDefs::MenuType_Help;
|
---|
643 | }
|
---|
644 | /** Returns action extra-data key. */
|
---|
645 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
646 | {
|
---|
647 | return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuType_Help);
|
---|
648 | }
|
---|
649 | /** Returns whether action is allowed. */
|
---|
650 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
651 | {
|
---|
652 | return actionPool()->isAllowedInMenuBar(UIExtraDataMetaDefs::MenuType_Help);
|
---|
653 | }
|
---|
654 |
|
---|
655 | /** Handles translation event. */
|
---|
656 | virtual void retranslateUi() RT_OVERRIDE
|
---|
657 | {
|
---|
658 | setName(QApplication::translate("UIActionPool", "&Help"));
|
---|
659 | }
|
---|
660 | };
|
---|
661 |
|
---|
662 | /** Simple action extension, used as 'Contents' action class. */
|
---|
663 | class UIActionSimpleContents : public UIActionSimple
|
---|
664 | {
|
---|
665 | Q_OBJECT;
|
---|
666 |
|
---|
667 | public:
|
---|
668 |
|
---|
669 | /** Constructs action passing @a pParent to the base-class. */
|
---|
670 | UIActionSimpleContents(UIActionPool *pParent)
|
---|
671 | : UIActionSimple(pParent, UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_DialogHelp), true)
|
---|
672 | {
|
---|
673 | retranslateUi();
|
---|
674 | }
|
---|
675 |
|
---|
676 | protected:
|
---|
677 |
|
---|
678 | /** Returns action extra-data ID. */
|
---|
679 | virtual int extraDataID() const RT_OVERRIDE
|
---|
680 | {
|
---|
681 | return UIExtraDataMetaDefs::MenuHelpActionType_Contents;
|
---|
682 | }
|
---|
683 | /** Returns action extra-data key. */
|
---|
684 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
685 | {
|
---|
686 | return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_Contents);
|
---|
687 | }
|
---|
688 | /** Returns whether action is allowed. */
|
---|
689 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
690 | {
|
---|
691 | return actionPool()->isAllowedInMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType_Contents);
|
---|
692 | }
|
---|
693 |
|
---|
694 | /** Returns shortcut extra-data ID. */
|
---|
695 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
696 | {
|
---|
697 | return QString("Help");
|
---|
698 | }
|
---|
699 |
|
---|
700 | /** Returns standard shortcut. */
|
---|
701 | virtual QKeySequence standardShortcut(UIType enmActionPoolType) const RT_OVERRIDE
|
---|
702 | {
|
---|
703 | switch (enmActionPoolType)
|
---|
704 | {
|
---|
705 | case UIType_ManagerUI: return UIShortcutPool::standardSequence(QKeySequence::HelpContents);
|
---|
706 | case UIType_RuntimeUI: break;
|
---|
707 | }
|
---|
708 | return QKeySequence();
|
---|
709 | }
|
---|
710 |
|
---|
711 | /** Handles translation event. */
|
---|
712 | virtual void retranslateUi() RT_OVERRIDE
|
---|
713 | {
|
---|
714 | setName(QApplication::translate("UIActionPool", "&Contents..."));
|
---|
715 | setStatusTip(QApplication::translate("UIActionPool", "Show help contents"));
|
---|
716 | }
|
---|
717 | };
|
---|
718 |
|
---|
719 | /** Simple action extension, used as 'Online Documentation' action class. */
|
---|
720 | class UIActionSimpleOnlineDocumentation : public UIActionSimple
|
---|
721 | {
|
---|
722 | Q_OBJECT;
|
---|
723 |
|
---|
724 | public:
|
---|
725 |
|
---|
726 | /** Constructs action passing @a pParent to the base-class. */
|
---|
727 | UIActionSimpleOnlineDocumentation(UIActionPool *pParent)
|
---|
728 | : UIActionSimple(pParent, ":/site_oracle_16px.png", ":/site_oracle_16px.png", true)
|
---|
729 | {
|
---|
730 | retranslateUi();
|
---|
731 | }
|
---|
732 |
|
---|
733 | protected:
|
---|
734 |
|
---|
735 | /** Returns action extra-data ID. */
|
---|
736 | virtual int extraDataID() const RT_OVERRIDE
|
---|
737 | {
|
---|
738 | return UIExtraDataMetaDefs::MenuHelpActionType_OnlineDocumentation;
|
---|
739 | }
|
---|
740 | /** Returns action extra-data key. */
|
---|
741 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
742 | {
|
---|
743 | return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_OnlineDocumentation);
|
---|
744 | }
|
---|
745 | /** Returns whether action is allowed. */
|
---|
746 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
747 | {
|
---|
748 | return actionPool()->isAllowedInMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType_OnlineDocumentation);
|
---|
749 | }
|
---|
750 |
|
---|
751 | /** Returns shortcut extra-data ID. */
|
---|
752 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
753 | {
|
---|
754 | return QString("OnlineDocumentation");
|
---|
755 | }
|
---|
756 |
|
---|
757 | /** Handles translation event. */
|
---|
758 | virtual void retranslateUi() RT_OVERRIDE
|
---|
759 | {
|
---|
760 | setName(QApplication::translate("UIActionPool", "&Online Documentation..."));
|
---|
761 | setStatusTip(QApplication::translate("UIActionPool", "Open the browser and go to the VirtualBox user manual"));
|
---|
762 | }
|
---|
763 | };
|
---|
764 |
|
---|
765 | /** Simple action extension, used as 'Web Site' action class. */
|
---|
766 | class UIActionSimpleWebSite : public UIActionSimple
|
---|
767 | {
|
---|
768 | Q_OBJECT;
|
---|
769 |
|
---|
770 | public:
|
---|
771 |
|
---|
772 | /** Constructs action passing @a pParent to the base-class. */
|
---|
773 | UIActionSimpleWebSite(UIActionPool *pParent)
|
---|
774 | : UIActionSimple(pParent, ":/site_16px.png", ":/site_16px.png", true)
|
---|
775 | {
|
---|
776 | retranslateUi();
|
---|
777 | }
|
---|
778 |
|
---|
779 | protected:
|
---|
780 |
|
---|
781 | /** Returns action extra-data ID. */
|
---|
782 | virtual int extraDataID() const RT_OVERRIDE
|
---|
783 | {
|
---|
784 | return UIExtraDataMetaDefs::MenuHelpActionType_WebSite;
|
---|
785 | }
|
---|
786 | /** Returns action extra-data key. */
|
---|
787 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
788 | {
|
---|
789 | return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_WebSite);
|
---|
790 | }
|
---|
791 | /** Returns whether action is allowed. */
|
---|
792 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
793 | {
|
---|
794 | return actionPool()->isAllowedInMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType_WebSite);
|
---|
795 | }
|
---|
796 |
|
---|
797 | /** Returns shortcut extra-data ID. */
|
---|
798 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
799 | {
|
---|
800 | return QString("Web");
|
---|
801 | }
|
---|
802 |
|
---|
803 | /** Handles translation event. */
|
---|
804 | virtual void retranslateUi() RT_OVERRIDE
|
---|
805 | {
|
---|
806 | setName(QApplication::translate("UIActionPool", "&VirtualBox Web Site..."));
|
---|
807 | setStatusTip(QApplication::translate("UIActionPool", "Open the browser and go to the VirtualBox product web site"));
|
---|
808 | }
|
---|
809 | };
|
---|
810 |
|
---|
811 | /** Simple action extension, used as 'Bug Tracker' action class. */
|
---|
812 | class UIActionSimpleBugTracker : public UIActionSimple
|
---|
813 | {
|
---|
814 | Q_OBJECT;
|
---|
815 |
|
---|
816 | public:
|
---|
817 |
|
---|
818 | /** Constructs action passing @a pParent to the base-class. */
|
---|
819 | UIActionSimpleBugTracker(UIActionPool *pParent)
|
---|
820 | : UIActionSimple(pParent, ":/site_bugtracker_16px.png", ":/site_bugtracker_16px.png", true)
|
---|
821 | {
|
---|
822 | retranslateUi();
|
---|
823 | }
|
---|
824 |
|
---|
825 | protected:
|
---|
826 |
|
---|
827 | /** Returns action extra-data ID. */
|
---|
828 | virtual int extraDataID() const RT_OVERRIDE
|
---|
829 | {
|
---|
830 | return UIExtraDataMetaDefs::MenuHelpActionType_BugTracker;
|
---|
831 | }
|
---|
832 | /** Returns action extra-data key. */
|
---|
833 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
834 | {
|
---|
835 | return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_BugTracker);
|
---|
836 | }
|
---|
837 | /** Returns whether action is allowed. */
|
---|
838 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
839 | {
|
---|
840 | return actionPool()->isAllowedInMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType_BugTracker);
|
---|
841 | }
|
---|
842 |
|
---|
843 | /** Returns shortcut extra-data ID. */
|
---|
844 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
845 | {
|
---|
846 | return QString("BugTracker");
|
---|
847 | }
|
---|
848 |
|
---|
849 | /** Handles translation event. */
|
---|
850 | virtual void retranslateUi() RT_OVERRIDE
|
---|
851 | {
|
---|
852 | setName(QApplication::translate("UIActionPool", "&VirtualBox Bug Tracker..."));
|
---|
853 | setStatusTip(QApplication::translate("UIActionPool", "Open the browser and go to the VirtualBox product bug tracker"));
|
---|
854 | }
|
---|
855 | };
|
---|
856 |
|
---|
857 | /** Simple action extension, used as 'Forums' action class. */
|
---|
858 | class UIActionSimpleForums : public UIActionSimple
|
---|
859 | {
|
---|
860 | Q_OBJECT;
|
---|
861 |
|
---|
862 | public:
|
---|
863 |
|
---|
864 | /** Constructs action passing @a pParent to the base-class. */
|
---|
865 | UIActionSimpleForums(UIActionPool *pParent)
|
---|
866 | : UIActionSimple(pParent, ":/site_forum_16px.png", ":/site_forum_16px.png", true)
|
---|
867 | {
|
---|
868 | retranslateUi();
|
---|
869 | }
|
---|
870 |
|
---|
871 | protected:
|
---|
872 |
|
---|
873 | /** Returns action extra-data ID. */
|
---|
874 | virtual int extraDataID() const RT_OVERRIDE
|
---|
875 | {
|
---|
876 | return UIExtraDataMetaDefs::MenuHelpActionType_Forums;
|
---|
877 | }
|
---|
878 | /** Returns action extra-data key. */
|
---|
879 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
880 | {
|
---|
881 | return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_Forums);
|
---|
882 | }
|
---|
883 | /** Returns whether action is allowed. */
|
---|
884 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
885 | {
|
---|
886 | return actionPool()->isAllowedInMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType_Forums);
|
---|
887 | }
|
---|
888 |
|
---|
889 | /** Returns shortcut extra-data ID. */
|
---|
890 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
891 | {
|
---|
892 | return QString("Forums");
|
---|
893 | }
|
---|
894 |
|
---|
895 | /** Handles translation event. */
|
---|
896 | virtual void retranslateUi() RT_OVERRIDE
|
---|
897 | {
|
---|
898 | setName(QApplication::translate("UIActionPool", "&VirtualBox Forums..."));
|
---|
899 | setStatusTip(QApplication::translate("UIActionPool", "Open the browser and go to the VirtualBox product forums"));
|
---|
900 | }
|
---|
901 | };
|
---|
902 |
|
---|
903 | /** Simple action extension, used as 'Oracle' action class. */
|
---|
904 | class UIActionSimpleOracle : public UIActionSimple
|
---|
905 | {
|
---|
906 | Q_OBJECT;
|
---|
907 |
|
---|
908 | public:
|
---|
909 |
|
---|
910 | /** Constructs action passing @a pParent to the base-class. */
|
---|
911 | UIActionSimpleOracle(UIActionPool *pParent)
|
---|
912 | : UIActionSimple(pParent, ":/site_oracle_16px.png", ":/site_oracle_16px.png", true)
|
---|
913 | {
|
---|
914 | retranslateUi();
|
---|
915 | }
|
---|
916 |
|
---|
917 | protected:
|
---|
918 |
|
---|
919 | /** Returns action extra-data ID. */
|
---|
920 | virtual int extraDataID() const RT_OVERRIDE
|
---|
921 | {
|
---|
922 | return UIExtraDataMetaDefs::MenuHelpActionType_Oracle;
|
---|
923 | }
|
---|
924 | /** Returns action extra-data key. */
|
---|
925 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
926 | {
|
---|
927 | return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_Oracle);
|
---|
928 | }
|
---|
929 | /** Returns whether action is allowed. */
|
---|
930 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
931 | {
|
---|
932 | return actionPool()->isAllowedInMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType_Oracle);
|
---|
933 | }
|
---|
934 |
|
---|
935 | /** Returns shortcut extra-data ID. */
|
---|
936 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
937 | {
|
---|
938 | return QString("Oracle");
|
---|
939 | }
|
---|
940 |
|
---|
941 | /** Handles translation event. */
|
---|
942 | virtual void retranslateUi() RT_OVERRIDE
|
---|
943 | {
|
---|
944 | setName(QApplication::translate("UIActionPool", "&Oracle Web Site..."));
|
---|
945 | setStatusTip(QApplication::translate("UIActionPool", "Open the browser and go to the Oracle web site"));
|
---|
946 | }
|
---|
947 | };
|
---|
948 |
|
---|
949 | /** Simple action extension, used as 'Reset Warnings' action class. */
|
---|
950 | class UIActionSimpleResetWarnings : public UIActionSimple
|
---|
951 | {
|
---|
952 | Q_OBJECT;
|
---|
953 |
|
---|
954 | public:
|
---|
955 |
|
---|
956 | /** Constructs action passing @a pParent to the base-class. */
|
---|
957 | UIActionSimpleResetWarnings(UIActionPool *pParent)
|
---|
958 | : UIActionSimple(pParent, ":/reset_warnings_16px.png", ":/reset_warnings_16px.png", true)
|
---|
959 | {
|
---|
960 | setMenuRole(QAction::ApplicationSpecificRole);
|
---|
961 | retranslateUi();
|
---|
962 | }
|
---|
963 |
|
---|
964 | protected:
|
---|
965 |
|
---|
966 | /** Returns action extra-data ID. */
|
---|
967 | virtual int extraDataID() const RT_OVERRIDE
|
---|
968 | {
|
---|
969 | return UIExtraDataMetaDefs::MenuApplicationActionType_ResetWarnings;
|
---|
970 | }
|
---|
971 | /** Returns action extra-data key. */
|
---|
972 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
973 | {
|
---|
974 | return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuApplicationActionType_ResetWarnings);
|
---|
975 | }
|
---|
976 | /** Returns whether action is allowed. */
|
---|
977 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
978 | {
|
---|
979 | return actionPool()->isAllowedInMenuApplication(UIExtraDataMetaDefs::MenuApplicationActionType_ResetWarnings);
|
---|
980 | }
|
---|
981 |
|
---|
982 | /** Returns shortcut extra-data ID. */
|
---|
983 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
984 | {
|
---|
985 | return QString("ResetWarnings");
|
---|
986 | }
|
---|
987 |
|
---|
988 | /** Handles translation event. */
|
---|
989 | virtual void retranslateUi() RT_OVERRIDE
|
---|
990 | {
|
---|
991 | setName(QApplication::translate("UIActionPool", "&Reset All Warnings"));
|
---|
992 | setStatusTip(QApplication::translate("UIActionPool", "Go back to showing all suppressed warnings and messages"));
|
---|
993 | }
|
---|
994 | };
|
---|
995 |
|
---|
996 | #ifdef VBOX_GUI_WITH_NETWORK_MANAGER
|
---|
997 | /** Simple action extension, used as 'Check for Updates' action class. */
|
---|
998 | class UIActionSimpleCheckForUpdates : public UIActionSimple
|
---|
999 | {
|
---|
1000 | Q_OBJECT;
|
---|
1001 |
|
---|
1002 | public:
|
---|
1003 |
|
---|
1004 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1005 | UIActionSimpleCheckForUpdates(UIActionPool *pParent)
|
---|
1006 | : UIActionSimple(pParent, ":/refresh_16px.png", ":/refresh_disabled_16px.png", true)
|
---|
1007 | {
|
---|
1008 | setMenuRole(QAction::ApplicationSpecificRole);
|
---|
1009 | retranslateUi();
|
---|
1010 | }
|
---|
1011 |
|
---|
1012 | protected:
|
---|
1013 |
|
---|
1014 | /** Returns action extra-data ID. */
|
---|
1015 | virtual int extraDataID() const RT_OVERRIDE
|
---|
1016 | {
|
---|
1017 | return UIExtraDataMetaDefs::MenuApplicationActionType_CheckForUpdates;
|
---|
1018 | }
|
---|
1019 | /** Returns action extra-data key. */
|
---|
1020 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
1021 | {
|
---|
1022 | return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuApplicationActionType_CheckForUpdates);
|
---|
1023 | }
|
---|
1024 | /** Returns whether action is allowed. */
|
---|
1025 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
1026 | {
|
---|
1027 | return actionPool()->isAllowedInMenuApplication(UIExtraDataMetaDefs::MenuApplicationActionType_CheckForUpdates);
|
---|
1028 | }
|
---|
1029 |
|
---|
1030 | /** Returns shortcut extra-data ID. */
|
---|
1031 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1032 | {
|
---|
1033 | return QString("Update");
|
---|
1034 | }
|
---|
1035 |
|
---|
1036 | /** Handles translation event. */
|
---|
1037 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1038 | {
|
---|
1039 | setName(QApplication::translate("UIActionPool", "C&heck for Updates..."));
|
---|
1040 | setStatusTip(QApplication::translate("UIActionPool", "Check for a new VirtualBox version"));
|
---|
1041 | }
|
---|
1042 | };
|
---|
1043 | #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
|
---|
1044 |
|
---|
1045 | /** Simple action extension, used as 'About' action class. */
|
---|
1046 | class UIActionSimpleAbout : public UIActionSimple
|
---|
1047 | {
|
---|
1048 | Q_OBJECT;
|
---|
1049 |
|
---|
1050 | public:
|
---|
1051 |
|
---|
1052 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1053 | UIActionSimpleAbout(UIActionPool *pParent)
|
---|
1054 | : UIActionSimple(pParent, ":/about_16px.png", ":/about_16px.png", true)
|
---|
1055 | {
|
---|
1056 | setMenuRole(QAction::AboutRole);
|
---|
1057 | retranslateUi();
|
---|
1058 | }
|
---|
1059 |
|
---|
1060 | protected:
|
---|
1061 |
|
---|
1062 | /** Returns action extra-data ID. */
|
---|
1063 | virtual int extraDataID() const RT_OVERRIDE
|
---|
1064 | {
|
---|
1065 | #ifdef VBOX_WS_MAC
|
---|
1066 | return UIExtraDataMetaDefs::MenuApplicationActionType_About;
|
---|
1067 | #else
|
---|
1068 | return UIExtraDataMetaDefs::MenuHelpActionType_About;
|
---|
1069 | #endif
|
---|
1070 | }
|
---|
1071 | /** Returns action extra-data key. */
|
---|
1072 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
1073 | {
|
---|
1074 | #ifdef VBOX_WS_MAC
|
---|
1075 | return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuApplicationActionType_About);
|
---|
1076 | #else
|
---|
1077 | return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuHelpActionType_About);
|
---|
1078 | #endif
|
---|
1079 | }
|
---|
1080 | /** Returns whether action is allowed. */
|
---|
1081 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
1082 | {
|
---|
1083 | #ifdef VBOX_WS_MAC
|
---|
1084 | return actionPool()->isAllowedInMenuApplication(UIExtraDataMetaDefs::MenuApplicationActionType_About);
|
---|
1085 | #else
|
---|
1086 | return actionPool()->isAllowedInMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType_About);
|
---|
1087 | #endif
|
---|
1088 | }
|
---|
1089 |
|
---|
1090 | /** Returns shortcut extra-data ID. */
|
---|
1091 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1092 | {
|
---|
1093 | return QString("About");
|
---|
1094 | }
|
---|
1095 |
|
---|
1096 | /** Handles translation event. */
|
---|
1097 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1098 | {
|
---|
1099 | setName(QApplication::translate("UIActionPool", "&About VirtualBox..."));
|
---|
1100 | setStatusTip(QApplication::translate("UIActionPool", "Display a window with product information"));
|
---|
1101 | }
|
---|
1102 | };
|
---|
1103 |
|
---|
1104 | /** Simple action extension, used as 'Preferences' action class. */
|
---|
1105 | class UIActionSimplePreferences : public UIActionSimple
|
---|
1106 | {
|
---|
1107 | Q_OBJECT;
|
---|
1108 |
|
---|
1109 | public:
|
---|
1110 |
|
---|
1111 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1112 | UIActionSimplePreferences(UIActionPool *pParent)
|
---|
1113 | : UIActionSimple(pParent,
|
---|
1114 | ":/global_settings_32px.png", ":/global_settings_16px.png",
|
---|
1115 | ":/global_settings_disabled_32px.png", ":/global_settings_disabled_16px.png",
|
---|
1116 | true)
|
---|
1117 | {
|
---|
1118 | setMenuRole(QAction::PreferencesRole);
|
---|
1119 | retranslateUi();
|
---|
1120 | }
|
---|
1121 |
|
---|
1122 | protected:
|
---|
1123 |
|
---|
1124 | /** Returns action extra-data ID. */
|
---|
1125 | virtual int extraDataID() const RT_OVERRIDE
|
---|
1126 | {
|
---|
1127 | return UIExtraDataMetaDefs::MenuApplicationActionType_Preferences;
|
---|
1128 | }
|
---|
1129 | /** Returns action extra-data key. */
|
---|
1130 | virtual QString extraDataKey() const RT_OVERRIDE
|
---|
1131 | {
|
---|
1132 | return gpConverter->toInternalString(UIExtraDataMetaDefs::MenuApplicationActionType_Preferences);
|
---|
1133 | }
|
---|
1134 | /** Returns whether action is allowed. */
|
---|
1135 | virtual bool isAllowed() const RT_OVERRIDE
|
---|
1136 | {
|
---|
1137 | return actionPool()->isAllowedInMenuApplication(UIExtraDataMetaDefs::MenuApplicationActionType_Preferences);
|
---|
1138 | }
|
---|
1139 |
|
---|
1140 | /** Returns shortcut extra-data ID. */
|
---|
1141 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1142 | {
|
---|
1143 | return QString("Preferences");
|
---|
1144 | }
|
---|
1145 |
|
---|
1146 | /** Returns default shortcut. */
|
---|
1147 | virtual QKeySequence defaultShortcut(UIType enmActionPoolType) const RT_OVERRIDE
|
---|
1148 | {
|
---|
1149 | switch (enmActionPoolType)
|
---|
1150 | {
|
---|
1151 | case UIType_ManagerUI: return QKeySequence("Ctrl+G");
|
---|
1152 | case UIType_RuntimeUI: break;
|
---|
1153 | }
|
---|
1154 | return QKeySequence();
|
---|
1155 | }
|
---|
1156 |
|
---|
1157 | /** Handles translation event. */
|
---|
1158 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1159 | {
|
---|
1160 | setName(QApplication::translate("UIActionPool", "&Preferences...", "global preferences window"));
|
---|
1161 | setStatusTip(QApplication::translate("UIActionPool", "Display the global preferences window"));
|
---|
1162 | setToolTip( QApplication::translate("UIActionPool", "Display Global Preferences")
|
---|
1163 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
1164 | }
|
---|
1165 | };
|
---|
1166 |
|
---|
1167 | /** Menu action extension, used as 'Log' menu class. */
|
---|
1168 | class UIActionMenuSelectorLog : public UIActionMenu
|
---|
1169 | {
|
---|
1170 | Q_OBJECT;
|
---|
1171 |
|
---|
1172 | public:
|
---|
1173 |
|
---|
1174 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1175 | UIActionMenuSelectorLog(UIActionPool *pParent)
|
---|
1176 | : UIActionMenu(pParent)
|
---|
1177 | {}
|
---|
1178 |
|
---|
1179 | protected:
|
---|
1180 |
|
---|
1181 | /** Returns shortcut extra-data ID. */
|
---|
1182 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1183 | {
|
---|
1184 | return QString("LogViewerMenu");
|
---|
1185 | }
|
---|
1186 |
|
---|
1187 | /** Handles translation event. */
|
---|
1188 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1189 | {
|
---|
1190 | setName(QApplication::translate("UIActionPool", "&Log"));
|
---|
1191 | }
|
---|
1192 | };
|
---|
1193 |
|
---|
1194 | /** Simple action extension, used as 'Toggle Pane Find' action class. */
|
---|
1195 | class UIActionMenuSelectorLogTogglePaneFind : public UIActionToggle
|
---|
1196 | {
|
---|
1197 | Q_OBJECT;
|
---|
1198 |
|
---|
1199 | public:
|
---|
1200 |
|
---|
1201 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1202 | UIActionMenuSelectorLogTogglePaneFind(UIActionPool *pParent)
|
---|
1203 | : UIActionToggle(pParent)
|
---|
1204 | {
|
---|
1205 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
1206 | setIcon(UIIconPool::iconSetFull(":/log_viewer_find_32px.png", ":/log_viewer_find_16px.png",
|
---|
1207 | ":/log_viewer_find_disabled_32px.png", ":/log_viewer_find_disabled_16px.png"));
|
---|
1208 | }
|
---|
1209 |
|
---|
1210 | protected:
|
---|
1211 |
|
---|
1212 | /** Returns shortcut extra-data ID. */
|
---|
1213 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1214 | {
|
---|
1215 | return QString("ToggleLogFind");
|
---|
1216 | }
|
---|
1217 |
|
---|
1218 | /** Returns default shortcut. */
|
---|
1219 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
1220 | {
|
---|
1221 | return QKeySequence("Ctrl+Shift+F");
|
---|
1222 | }
|
---|
1223 |
|
---|
1224 | /** Handles translation event. */
|
---|
1225 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1226 | {
|
---|
1227 | setName(QApplication::translate("UIActionPool", "&Find"));
|
---|
1228 | setShortcutScope(QApplication::translate("UIActionPool", "Log Viewer"));
|
---|
1229 | setStatusTip(QApplication::translate("UIActionPool", "Open pane with searching options"));
|
---|
1230 | setToolTip( QApplication::translate("UIActionPool", "Open Find Pane")
|
---|
1231 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
1232 | }
|
---|
1233 | };
|
---|
1234 |
|
---|
1235 | /** Simple action extension, used as 'Toggle Pane Filter' action class. */
|
---|
1236 | class UIActionMenuSelectorLogTogglePaneFilter : public UIActionToggle
|
---|
1237 | {
|
---|
1238 | Q_OBJECT;
|
---|
1239 |
|
---|
1240 | public:
|
---|
1241 |
|
---|
1242 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1243 | UIActionMenuSelectorLogTogglePaneFilter(UIActionPool *pParent)
|
---|
1244 | : UIActionToggle(pParent)
|
---|
1245 | {
|
---|
1246 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
1247 | setIcon(UIIconPool::iconSetFull(":/log_viewer_filter_32px.png", ":/log_viewer_filter_16px.png",
|
---|
1248 | ":/log_viewer_filter_disabled_32px.png", ":/log_viewer_filter_disabled_16px.png"));
|
---|
1249 | }
|
---|
1250 |
|
---|
1251 | protected:
|
---|
1252 |
|
---|
1253 | /** Returns shortcut extra-data ID. */
|
---|
1254 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1255 | {
|
---|
1256 | return QString("ToggleLogFilter");
|
---|
1257 | }
|
---|
1258 |
|
---|
1259 | /** Returns default shortcut. */
|
---|
1260 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
1261 | {
|
---|
1262 | return QKeySequence("Ctrl+Shift+T");
|
---|
1263 | }
|
---|
1264 |
|
---|
1265 | /** Handles translation event. */
|
---|
1266 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1267 | {
|
---|
1268 | setName(QApplication::translate("UIActionPool", "&Filter"));
|
---|
1269 | setShortcutScope(QApplication::translate("UIActionPool", "Log Viewer"));
|
---|
1270 | setStatusTip(QApplication::translate("UIActionPool", "Open pane with filtering options"));
|
---|
1271 | setToolTip( QApplication::translate("UIActionPool", "Open Filter Pane")
|
---|
1272 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
1273 | }
|
---|
1274 | };
|
---|
1275 |
|
---|
1276 | /** Simple action extension, used as 'Toggle Pane Bookmark' action class. */
|
---|
1277 | class UIActionMenuSelectorLogTogglePaneBookmark : public UIActionToggle
|
---|
1278 | {
|
---|
1279 | Q_OBJECT;
|
---|
1280 |
|
---|
1281 | public:
|
---|
1282 |
|
---|
1283 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1284 | UIActionMenuSelectorLogTogglePaneBookmark(UIActionPool *pParent)
|
---|
1285 | : UIActionToggle(pParent)
|
---|
1286 | {
|
---|
1287 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
1288 | setIcon(UIIconPool::iconSetFull(":/log_viewer_bookmark_32px.png", ":/log_viewer_bookmark_16px.png",
|
---|
1289 | ":/log_viewer_bookmark_disabled_32px.png", ":/log_viewer_bookmark_disabled_16px.png"));
|
---|
1290 | }
|
---|
1291 |
|
---|
1292 | protected:
|
---|
1293 |
|
---|
1294 | /** Returns shortcut extra-data ID. */
|
---|
1295 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1296 | {
|
---|
1297 | return QString("ToggleLogBookmark");
|
---|
1298 | }
|
---|
1299 |
|
---|
1300 | /** Returns default shortcut. */
|
---|
1301 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
1302 | {
|
---|
1303 | return QKeySequence("Ctrl+Shift+D");
|
---|
1304 | }
|
---|
1305 |
|
---|
1306 | /** Handles translation event. */
|
---|
1307 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1308 | {
|
---|
1309 | setName(QApplication::translate("UIActionPool", "&Bookmark"));
|
---|
1310 | setShortcutScope(QApplication::translate("UIActionPool", "Log Viewer"));
|
---|
1311 | setStatusTip(QApplication::translate("UIActionPool", "Open pane with bookmarking options"));
|
---|
1312 | setToolTip( QApplication::translate("UIActionPool", "Open Bookmark Pane")
|
---|
1313 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
1314 | }
|
---|
1315 | };
|
---|
1316 |
|
---|
1317 | /** Simple action extension, used as 'Toggle Pane Preferences' action class. */
|
---|
1318 | class UIActionMenuSelectorLogTogglePanePreferences : public UIActionToggle
|
---|
1319 | {
|
---|
1320 | Q_OBJECT;
|
---|
1321 |
|
---|
1322 | public:
|
---|
1323 |
|
---|
1324 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1325 | UIActionMenuSelectorLogTogglePanePreferences(UIActionPool *pParent)
|
---|
1326 | : UIActionToggle(pParent)
|
---|
1327 | {
|
---|
1328 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
1329 | setIcon(UIIconPool::iconSetFull(":/log_viewer_options_32px.png", ":/log_viewer_options_16px.png",
|
---|
1330 | ":/log_viewer_options_disabled_32px.png", ":/log_viewer_options_disabled_16px.png"));
|
---|
1331 | }
|
---|
1332 |
|
---|
1333 | protected:
|
---|
1334 |
|
---|
1335 | /** Returns shortcut extra-data ID. */
|
---|
1336 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1337 | {
|
---|
1338 | return QString("ToggleLogPreferences");
|
---|
1339 | }
|
---|
1340 |
|
---|
1341 | /** Returns default shortcut. */
|
---|
1342 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
1343 | {
|
---|
1344 | return QKeySequence("Ctrl+Shift+P");
|
---|
1345 | }
|
---|
1346 |
|
---|
1347 | /** Handles translation event. */
|
---|
1348 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1349 | {
|
---|
1350 | setName(QApplication::translate("UIActionPool", "&Preferences"));
|
---|
1351 | setShortcutScope(QApplication::translate("UIActionPool", "Log Viewer"));
|
---|
1352 | setStatusTip(QApplication::translate("UIActionPool", "Open pane with log viewer preferences"));
|
---|
1353 | setToolTip( QApplication::translate("UIActionPool", "Open Preferences Pane")
|
---|
1354 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
1355 | }
|
---|
1356 | };
|
---|
1357 |
|
---|
1358 | /** Simple action extension, used as 'Perform Refresh' action class. */
|
---|
1359 | class UIActionMenuSelectorLogPerformRefresh : public UIActionSimple
|
---|
1360 | {
|
---|
1361 | Q_OBJECT;
|
---|
1362 |
|
---|
1363 | public:
|
---|
1364 |
|
---|
1365 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1366 | UIActionMenuSelectorLogPerformRefresh(UIActionPool *pParent)
|
---|
1367 | : UIActionSimple(pParent,
|
---|
1368 | ":/log_viewer_refresh_32px.png", ":/log_viewer_refresh_16px.png",
|
---|
1369 | ":/log_viewer_refresh_disabled_32px.png", ":/log_viewer_refresh_disabled_16px.png")
|
---|
1370 | {
|
---|
1371 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
1372 | }
|
---|
1373 |
|
---|
1374 | protected:
|
---|
1375 |
|
---|
1376 | /** Returns shortcut extra-data ID. */
|
---|
1377 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1378 | {
|
---|
1379 | return QString("RefreshLog");
|
---|
1380 | }
|
---|
1381 |
|
---|
1382 | /** Returns default shortcut. */
|
---|
1383 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
1384 | {
|
---|
1385 | return QKeySequence("Ctrl+Shift+R");
|
---|
1386 | }
|
---|
1387 |
|
---|
1388 | /** Returns standard shortcut. */
|
---|
1389 | virtual QKeySequence standardShortcut(UIType) const RT_OVERRIDE
|
---|
1390 | {
|
---|
1391 | return actionPool()->isTemporary() ? QKeySequence() : QKeySequence(QKeySequence::Refresh);
|
---|
1392 | }
|
---|
1393 |
|
---|
1394 | /** Handles translation event. */
|
---|
1395 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1396 | {
|
---|
1397 | setName(QApplication::translate("UIActionPool", "&Refresh"));
|
---|
1398 | setShortcutScope(QApplication::translate("UIActionPool", "Log Viewer"));
|
---|
1399 | setStatusTip(QApplication::translate("UIActionPool", "Refresh the currently viewed log"));
|
---|
1400 | setToolTip( QApplication::translate("UIActionPool", "Refresh Viewed Log")
|
---|
1401 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
1402 | }
|
---|
1403 | };
|
---|
1404 |
|
---|
1405 | /** Simple action extension, used as 'Perform Reload' action class. */
|
---|
1406 | class UIActionMenuSelectorLogPerformReload : public UIActionSimple
|
---|
1407 | {
|
---|
1408 | Q_OBJECT;
|
---|
1409 |
|
---|
1410 | public:
|
---|
1411 |
|
---|
1412 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1413 | UIActionMenuSelectorLogPerformReload(UIActionPool *pParent)
|
---|
1414 | : UIActionSimple(pParent,
|
---|
1415 | ":/log_viewer_refresh_32px.png", ":/log_viewer_refresh_16px.png",
|
---|
1416 | ":/log_viewer_refresh_disabled_32px.png", ":/log_viewer_refresh_disabled_16px.png")
|
---|
1417 | {
|
---|
1418 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
1419 | }
|
---|
1420 |
|
---|
1421 | protected:
|
---|
1422 |
|
---|
1423 | /** Returns shortcut extra-data ID. */
|
---|
1424 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1425 | {
|
---|
1426 | return QString("ReloadAllLogs");
|
---|
1427 | }
|
---|
1428 |
|
---|
1429 | /** Returns default shortcut. */
|
---|
1430 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
1431 | {
|
---|
1432 | return QKeySequence();
|
---|
1433 | }
|
---|
1434 |
|
---|
1435 | /** Returns standard shortcut. */
|
---|
1436 | virtual QKeySequence standardShortcut(UIType) const RT_OVERRIDE
|
---|
1437 | {
|
---|
1438 | return QKeySequence();
|
---|
1439 | }
|
---|
1440 |
|
---|
1441 | /** Handles translation event. */
|
---|
1442 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1443 | {
|
---|
1444 | setName(QApplication::translate("UIActionPool", "&Reload"));
|
---|
1445 | setShortcutScope(QApplication::translate("UIActionPool", "Log Viewer"));
|
---|
1446 | setStatusTip(QApplication::translate("UIActionPool", "Reread all the log files and refresh pages"));
|
---|
1447 | setToolTip( QApplication::translate("UIActionPool", "Reload Log Files")
|
---|
1448 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
1449 | }
|
---|
1450 | };
|
---|
1451 |
|
---|
1452 | /** Simple action extension, used as 'Perform Save' action class. */
|
---|
1453 | class UIActionMenuSelectorLogPerformSave : public UIActionSimple
|
---|
1454 | {
|
---|
1455 | Q_OBJECT;
|
---|
1456 |
|
---|
1457 | public:
|
---|
1458 |
|
---|
1459 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1460 | UIActionMenuSelectorLogPerformSave(UIActionPool *pParent)
|
---|
1461 | : UIActionSimple(pParent,
|
---|
1462 | ":/log_viewer_save_32px.png", ":/log_viewer_save_16px.png",
|
---|
1463 | ":/log_viewer_save_disabled_32px.png", ":/log_viewer_save_disabled_16px.png")
|
---|
1464 | {
|
---|
1465 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
1466 | }
|
---|
1467 |
|
---|
1468 | protected:
|
---|
1469 |
|
---|
1470 | /** Returns shortcut extra-data ID. */
|
---|
1471 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1472 | {
|
---|
1473 | return QString("SaveLog");
|
---|
1474 | }
|
---|
1475 |
|
---|
1476 | /** Returns default shortcut. */
|
---|
1477 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
1478 | {
|
---|
1479 | return QKeySequence("Ctrl+Shift+S");
|
---|
1480 | }
|
---|
1481 |
|
---|
1482 | /** Handles translation event. */
|
---|
1483 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1484 | {
|
---|
1485 | setName(QApplication::translate("UIActionPool", "&Save..."));
|
---|
1486 | setShortcutScope(QApplication::translate("UIActionPool", "Log Viewer"));
|
---|
1487 | setStatusTip(QApplication::translate("UIActionPool", "Save selected virtual machine log"));
|
---|
1488 | setToolTip( QApplication::translate("UIActionPool", "Save Virtual Machine Log")
|
---|
1489 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
1490 | }
|
---|
1491 | };
|
---|
1492 |
|
---|
1493 | /** Menu action extension, used as 'File Manager' menu class. */
|
---|
1494 | class UIActionMenuFileManager : public UIActionMenu
|
---|
1495 | {
|
---|
1496 | Q_OBJECT;
|
---|
1497 |
|
---|
1498 | public:
|
---|
1499 |
|
---|
1500 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1501 | UIActionMenuFileManager(UIActionPool *pParent)
|
---|
1502 | : UIActionMenu(pParent)
|
---|
1503 | {}
|
---|
1504 |
|
---|
1505 | protected:
|
---|
1506 |
|
---|
1507 | /** Returns shortcut extra-data ID. */
|
---|
1508 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1509 | {
|
---|
1510 | return QString("FileManagerMenu");
|
---|
1511 | }
|
---|
1512 |
|
---|
1513 | /** Handles translation event. */
|
---|
1514 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1515 | {
|
---|
1516 | setName(QApplication::translate("UIActionPool", "File Manager"));
|
---|
1517 | }
|
---|
1518 | };
|
---|
1519 |
|
---|
1520 | class UIActionMenuFileManagerHostSubmenu : public UIActionMenu
|
---|
1521 | {
|
---|
1522 | Q_OBJECT;
|
---|
1523 |
|
---|
1524 | public:
|
---|
1525 |
|
---|
1526 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1527 | UIActionMenuFileManagerHostSubmenu(UIActionPool *pParent)
|
---|
1528 | : UIActionMenu(pParent)
|
---|
1529 | {}
|
---|
1530 |
|
---|
1531 | protected:
|
---|
1532 |
|
---|
1533 | /** Returns shortcut extra-data ID. */
|
---|
1534 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1535 | {
|
---|
1536 | return QString("FileManagerHostSubmenu");
|
---|
1537 | }
|
---|
1538 |
|
---|
1539 | /** Handles translation event. */
|
---|
1540 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1541 | {
|
---|
1542 | setName(QApplication::translate("UIActionPool", "Host"));
|
---|
1543 | }
|
---|
1544 | };
|
---|
1545 |
|
---|
1546 | class UIActionMenuFileManagerGuestSubmenu : public UIActionMenu
|
---|
1547 | {
|
---|
1548 | Q_OBJECT;
|
---|
1549 |
|
---|
1550 | public:
|
---|
1551 |
|
---|
1552 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1553 | UIActionMenuFileManagerGuestSubmenu(UIActionPool *pParent)
|
---|
1554 | : UIActionMenu(pParent)
|
---|
1555 | {}
|
---|
1556 |
|
---|
1557 | protected:
|
---|
1558 |
|
---|
1559 | /** Returns shortcut extra-data ID. */
|
---|
1560 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1561 | {
|
---|
1562 | return QString("FileManagerGuestSubmenu");
|
---|
1563 | }
|
---|
1564 |
|
---|
1565 | /** Handles translation event. */
|
---|
1566 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1567 | {
|
---|
1568 | setName(QApplication::translate("UIActionPool", "Guest"));
|
---|
1569 | }
|
---|
1570 | };
|
---|
1571 |
|
---|
1572 | /** Simple action extension, used as 'Copy to Guest' in file manager action class. */
|
---|
1573 | class UIActionMenuFileManagerCopyToGuest : public UIActionSimple
|
---|
1574 | {
|
---|
1575 | Q_OBJECT;
|
---|
1576 |
|
---|
1577 | public:
|
---|
1578 |
|
---|
1579 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1580 | UIActionMenuFileManagerCopyToGuest(UIActionPool *pParent)
|
---|
1581 | : UIActionSimple(pParent,
|
---|
1582 | ":/file_manager_copy_to_guest_24px.png", ":/file_manager_copy_to_guest_16px.png",
|
---|
1583 | ":/file_manager_copy_to_guest_disabled_24px.png", ":/file_manager_copy_to_guest_disabled_16px.png"){}
|
---|
1584 |
|
---|
1585 | protected:
|
---|
1586 |
|
---|
1587 | /** Returns shortcut extra-data ID. */
|
---|
1588 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1589 | {
|
---|
1590 | return QString("FileManagerCopyToGuest");
|
---|
1591 | }
|
---|
1592 |
|
---|
1593 | /** Returns default shortcut. */
|
---|
1594 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
1595 | {
|
---|
1596 | return QKeySequence();
|
---|
1597 | }
|
---|
1598 |
|
---|
1599 | /** Handles translation event. */
|
---|
1600 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1601 | {
|
---|
1602 | setName(QApplication::translate("UIActionPool", "Copy to guest"));
|
---|
1603 | setShortcutScope(QApplication::translate("UIActionPool", "File Manager"));
|
---|
1604 | setStatusTip(QApplication::translate("UIActionPool", "Copy the selected object(s) from host to guest"));
|
---|
1605 | setToolTip( QApplication::translate("UIActionPool", "Copy from Host to Guest")
|
---|
1606 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
1607 | }
|
---|
1608 | };
|
---|
1609 |
|
---|
1610 | /** Simple action extension, used as 'Copy to Host' in file manager action class. */
|
---|
1611 | class UIActionMenuFileManagerCopyToHost : public UIActionSimple
|
---|
1612 | {
|
---|
1613 | Q_OBJECT;
|
---|
1614 |
|
---|
1615 | public:
|
---|
1616 |
|
---|
1617 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1618 | UIActionMenuFileManagerCopyToHost(UIActionPool *pParent)
|
---|
1619 | : UIActionSimple(pParent,
|
---|
1620 | ":/file_manager_copy_to_host_24px.png", ":/file_manager_copy_to_host_16px.png",
|
---|
1621 | ":/file_manager_copy_to_host_disabled_24px.png", ":/file_manager_copy_to_host_disabled_16px.png"){}
|
---|
1622 |
|
---|
1623 | protected:
|
---|
1624 |
|
---|
1625 | /** Returns shortcut extra-data ID. */
|
---|
1626 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1627 | {
|
---|
1628 | return QString("FileManagerCopyToHost");
|
---|
1629 | }
|
---|
1630 |
|
---|
1631 | /** Returns default shortcut. */
|
---|
1632 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
1633 | {
|
---|
1634 | return QKeySequence();
|
---|
1635 | }
|
---|
1636 |
|
---|
1637 | /** Handles translation event. */
|
---|
1638 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1639 | {
|
---|
1640 | setName(QApplication::translate("UIActionPool", "Copy to host"));
|
---|
1641 | setShortcutScope(QApplication::translate("UIActionPool", "File Manager"));
|
---|
1642 | setStatusTip(QApplication::translate("UIActionPool", "Copy the selected object(s) from guest to host"));
|
---|
1643 | setToolTip( QApplication::translate("UIActionPool", "Copy from Guest to Host")
|
---|
1644 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
1645 | }
|
---|
1646 | };
|
---|
1647 |
|
---|
1648 | /** Toggle action extension, used to toggle 'File Manager Preferences' panel in file manager. */
|
---|
1649 | class UIActionMenuFileManagerPreferences : public UIActionToggle
|
---|
1650 | {
|
---|
1651 | Q_OBJECT;
|
---|
1652 |
|
---|
1653 | public:
|
---|
1654 |
|
---|
1655 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1656 | UIActionMenuFileManagerPreferences(UIActionPool *pParent)
|
---|
1657 | : UIActionToggle(pParent)
|
---|
1658 | {
|
---|
1659 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
1660 | setIcon(UIIconPool::iconSetFull(":/file_manager_options_32px.png", ":/file_manager_options_16px.png",
|
---|
1661 | ":/file_manager_options_disabled_32px.png", ":/file_manager_options_disabled_16px.png"));
|
---|
1662 | }
|
---|
1663 |
|
---|
1664 | protected:
|
---|
1665 |
|
---|
1666 | /** Returns shortcut extra-data ID. */
|
---|
1667 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1668 | {
|
---|
1669 | return QString("ToggleFileManagerOptionsPanel");
|
---|
1670 | }
|
---|
1671 |
|
---|
1672 | /** Returns default shortcut. */
|
---|
1673 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
1674 | {
|
---|
1675 | return QKeySequence();
|
---|
1676 | }
|
---|
1677 |
|
---|
1678 | /** Handles translation event. */
|
---|
1679 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1680 | {
|
---|
1681 | setName(QApplication::translate("UIActionPool", "Preferences"));
|
---|
1682 | setShortcutScope(QApplication::translate("UIActionPool", "File Manager"));
|
---|
1683 | setStatusTip(QApplication::translate("UIActionPool", "Open panel with file manager preferences"));
|
---|
1684 | setToolTip( QApplication::translate("UIActionPool", "Open Preferences Pane")
|
---|
1685 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
1686 | }
|
---|
1687 | };
|
---|
1688 |
|
---|
1689 | /** Toggle action extension, used to toggle 'File Manager Log' panel in file manager. */
|
---|
1690 | class UIActionMenuFileManagerLog : public UIActionToggle
|
---|
1691 | {
|
---|
1692 | Q_OBJECT;
|
---|
1693 |
|
---|
1694 | public:
|
---|
1695 |
|
---|
1696 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1697 | UIActionMenuFileManagerLog(UIActionPool *pParent)
|
---|
1698 | : UIActionToggle(pParent)
|
---|
1699 | {
|
---|
1700 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
1701 | setIcon(UIIconPool::iconSetFull(":/file_manager_log_32px.png", ":/file_manager_log_16px.png",
|
---|
1702 | ":/file_manager_log_disabled_32px.png", ":/file_manager_log_disabled_16px.png"));
|
---|
1703 | }
|
---|
1704 |
|
---|
1705 | protected:
|
---|
1706 |
|
---|
1707 | /** Returns shortcut extra-data ID. */
|
---|
1708 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1709 | {
|
---|
1710 | return QString("ToggleFileManagerLogPanel");
|
---|
1711 | }
|
---|
1712 |
|
---|
1713 | /** Returns default shortcut. */
|
---|
1714 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
1715 | {
|
---|
1716 | return QKeySequence();
|
---|
1717 | }
|
---|
1718 |
|
---|
1719 | /** Handles translation event. */
|
---|
1720 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1721 | {
|
---|
1722 | setName(QApplication::translate("UIActionPool", "Log"));
|
---|
1723 | setShortcutScope(QApplication::translate("UIActionPool", "File Manager"));
|
---|
1724 | setStatusTip(QApplication::translate("UIActionPool", "Open panel with file manager log"));
|
---|
1725 | setToolTip( QApplication::translate("UIActionPool", "Open Log Pane")
|
---|
1726 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
1727 | }
|
---|
1728 | };
|
---|
1729 |
|
---|
1730 | /** Toggle action extension, used to toggle 'File Manager Operations' panel in file manager. */
|
---|
1731 | class UIActionMenuFileManagerOperations : public UIActionToggle
|
---|
1732 | {
|
---|
1733 | Q_OBJECT;
|
---|
1734 |
|
---|
1735 | public:
|
---|
1736 |
|
---|
1737 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1738 | UIActionMenuFileManagerOperations(UIActionPool *pParent)
|
---|
1739 | : UIActionToggle(pParent)
|
---|
1740 | {
|
---|
1741 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
1742 | setIcon(UIIconPool::iconSetFull(":/file_manager_operations_32px.png", ":/file_manager_operations_16px.png",
|
---|
1743 | ":/file_manager_operations_disabled_32px.png", ":/file_manager_operations_disabled_16px.png"));
|
---|
1744 | }
|
---|
1745 |
|
---|
1746 | protected:
|
---|
1747 |
|
---|
1748 | /** Returns shortcut extra-data ID. */
|
---|
1749 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1750 | {
|
---|
1751 | return QString("ToggleFileManagerOperationsPanel");
|
---|
1752 | }
|
---|
1753 |
|
---|
1754 | /** Returns default shortcut. */
|
---|
1755 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
1756 | {
|
---|
1757 | return QKeySequence();
|
---|
1758 | }
|
---|
1759 |
|
---|
1760 | /** Handles translation event. */
|
---|
1761 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1762 | {
|
---|
1763 | setName(QApplication::translate("UIActionPool", "Operations"));
|
---|
1764 | setShortcutScope(QApplication::translate("UIActionPool", "File Manager"));
|
---|
1765 | setStatusTip(QApplication::translate("UIActionPool", "Open panel with file manager operations"));
|
---|
1766 | setToolTip( QApplication::translate("UIActionPool", "Open Operations Pane")
|
---|
1767 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
1768 | }
|
---|
1769 | };
|
---|
1770 |
|
---|
1771 | /** Toggle action extension, used to toggle 'File Manager Guest Session' panel in file manager. */
|
---|
1772 | class UIActionMenuFileManagerGuestSession : public UIActionToggle
|
---|
1773 | {
|
---|
1774 | Q_OBJECT;
|
---|
1775 |
|
---|
1776 | public:
|
---|
1777 |
|
---|
1778 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1779 | UIActionMenuFileManagerGuestSession(UIActionPool *pParent)
|
---|
1780 | : UIActionToggle(pParent)
|
---|
1781 | {
|
---|
1782 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
1783 | setIcon(UIIconPool::iconSetFull(":/file_manager_session_32px.png", ":/file_manager_session_16px.png",
|
---|
1784 | ":/file_manager_session_disabled_32px.png", ":/file_manager_session_disabled_16px.png"));
|
---|
1785 | }
|
---|
1786 |
|
---|
1787 | protected:
|
---|
1788 |
|
---|
1789 | /** Returns shortcut extra-data ID. */
|
---|
1790 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1791 | {
|
---|
1792 | return QString("ToggleFileManagerGuestSessionPanel");
|
---|
1793 | }
|
---|
1794 |
|
---|
1795 | /** Returns default shortcut. */
|
---|
1796 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
1797 | {
|
---|
1798 | return QKeySequence();
|
---|
1799 | }
|
---|
1800 |
|
---|
1801 | /** Handles translation event. */
|
---|
1802 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1803 | {
|
---|
1804 | setName(QApplication::translate("UIActionPool", "Session"));
|
---|
1805 | setShortcutScope(QApplication::translate("UIActionPool", "File Manager"));
|
---|
1806 | setStatusTip(QApplication::translate("UIActionPool", "Toggle guest session panel of the file manager"));
|
---|
1807 | setToolTip( QApplication::translate("UIActionPool", "Toggle Guest Session Panel")
|
---|
1808 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
1809 | }
|
---|
1810 | };
|
---|
1811 |
|
---|
1812 | /** Simple action extension, used as 'Perform GoUp' in file manager action class. */
|
---|
1813 | class UIActionMenuFileManagerGoUp : public UIActionSimple
|
---|
1814 | {
|
---|
1815 | Q_OBJECT;
|
---|
1816 |
|
---|
1817 | public:
|
---|
1818 |
|
---|
1819 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1820 | UIActionMenuFileManagerGoUp(UIActionPool *pParent)
|
---|
1821 | : UIActionSimple(pParent,
|
---|
1822 | ":/file_manager_go_up_24px.png", ":/file_manager_go_up_16px.png",
|
---|
1823 | ":/file_manager_go_up_disabled_24px.png", ":/file_manager_go_up_disabled_16px.png")
|
---|
1824 | {}
|
---|
1825 |
|
---|
1826 | protected:
|
---|
1827 |
|
---|
1828 | /** Returns shortcut extra-data ID. */
|
---|
1829 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1830 | {
|
---|
1831 | return QString("FileManagerGoUp");
|
---|
1832 | }
|
---|
1833 |
|
---|
1834 | /** Returns default shortcut. */
|
---|
1835 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
1836 | {
|
---|
1837 | return QKeySequence();
|
---|
1838 | }
|
---|
1839 |
|
---|
1840 | /** Handles translation event. */
|
---|
1841 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1842 | {
|
---|
1843 | setName(QApplication::translate("UIActionPool", "Go Up"));
|
---|
1844 | setShortcutScope(QApplication::translate("UIActionPool", "File Manager"));
|
---|
1845 | setStatusTip(QApplication::translate("UIActionPool", "Go one level up to parent folder"));
|
---|
1846 | setToolTip( QApplication::translate("UIActionPool", "Go One Level Up")
|
---|
1847 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
1848 | }
|
---|
1849 | };
|
---|
1850 |
|
---|
1851 | /** Simple action extension, used as 'Perform GoHome' in file manager action class. */
|
---|
1852 | class UIActionMenuFileManagerGoHome : public UIActionSimple
|
---|
1853 | {
|
---|
1854 | Q_OBJECT;
|
---|
1855 |
|
---|
1856 | public:
|
---|
1857 |
|
---|
1858 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1859 | UIActionMenuFileManagerGoHome(UIActionPool *pParent)
|
---|
1860 | : UIActionSimple(pParent,
|
---|
1861 | ":/file_manager_go_home_24px.png", ":/file_manager_go_home_16px.png",
|
---|
1862 | ":/file_manager_go_home_disabled_24px.png", ":/file_manager_go_home_disabled_16px.png")
|
---|
1863 | {}
|
---|
1864 |
|
---|
1865 | protected:
|
---|
1866 |
|
---|
1867 | /** Returns shortcut extra-data ID. */
|
---|
1868 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1869 | {
|
---|
1870 | return QString("FileManagerGoHome");
|
---|
1871 | }
|
---|
1872 |
|
---|
1873 | /** Returns default shortcut. */
|
---|
1874 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
1875 | {
|
---|
1876 | return QKeySequence();
|
---|
1877 | }
|
---|
1878 |
|
---|
1879 | /** Handles translation event. */
|
---|
1880 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1881 | {
|
---|
1882 | setName(QApplication::translate("UIActionPool", "Go Home"));
|
---|
1883 | setShortcutScope(QApplication::translate("UIActionPool", "File Manager"));
|
---|
1884 | setStatusTip(QApplication::translate("UIActionPool", "Go to home folder"));
|
---|
1885 | setToolTip( QApplication::translate("UIActionPool", "Go to Home Folder")
|
---|
1886 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
1887 | }
|
---|
1888 | };
|
---|
1889 |
|
---|
1890 | /** Simple action extension, used as 'Perform GoForward' in file manager action class. */
|
---|
1891 | class UIActionMenuFileManagerGoForward : public UIActionSimple
|
---|
1892 | {
|
---|
1893 | Q_OBJECT;
|
---|
1894 |
|
---|
1895 | public:
|
---|
1896 |
|
---|
1897 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1898 | UIActionMenuFileManagerGoForward(UIActionPool *pParent)
|
---|
1899 | : UIActionSimple(pParent,
|
---|
1900 | ":/file_manager_go_forward_24px.png", ":/file_manager_go_forward_16px.png",
|
---|
1901 | ":/file_manager_go_forward_disabled_24px.png", ":/file_manager_go_forward_disabled_16px.png")
|
---|
1902 | {}
|
---|
1903 |
|
---|
1904 | protected:
|
---|
1905 |
|
---|
1906 | /** Returns shortcut extra-data ID. */
|
---|
1907 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1908 | {
|
---|
1909 | return QString("FileManagerGoForward");
|
---|
1910 | }
|
---|
1911 |
|
---|
1912 | /** Returns default shortcut. */
|
---|
1913 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
1914 | {
|
---|
1915 | return QKeySequence();
|
---|
1916 | }
|
---|
1917 |
|
---|
1918 | /** Handles translation event. */
|
---|
1919 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1920 | {
|
---|
1921 | setName(QApplication::translate("UIActionPool", "Go Forward"));
|
---|
1922 | setShortcutScope(QApplication::translate("UIActionPool", "File Manager"));
|
---|
1923 | setStatusTip(QApplication::translate("UIActionPool", "Go forward"));
|
---|
1924 | setToolTip( QApplication::translate("UIActionPool", "Go Forward")
|
---|
1925 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
1926 | }
|
---|
1927 | };
|
---|
1928 |
|
---|
1929 | /** Simple action extension, used as 'Perform GoBackward' in file manager action class. */
|
---|
1930 | class UIActionMenuFileManagerGoBackward : public UIActionSimple
|
---|
1931 | {
|
---|
1932 | Q_OBJECT;
|
---|
1933 |
|
---|
1934 | public:
|
---|
1935 |
|
---|
1936 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1937 | UIActionMenuFileManagerGoBackward(UIActionPool *pParent)
|
---|
1938 | : UIActionSimple(pParent,
|
---|
1939 | ":/file_manager_go_backward_24px.png", ":/file_manager_go_backward_16px.png",
|
---|
1940 | ":/file_manager_go_backward_disabled_24px.png", ":/file_manager_go_backward_disabled_16px.png")
|
---|
1941 | {}
|
---|
1942 |
|
---|
1943 | protected:
|
---|
1944 |
|
---|
1945 | /** Returns shortcut extra-data ID. */
|
---|
1946 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1947 | {
|
---|
1948 | return QString("FileManagerGoBackward");
|
---|
1949 | }
|
---|
1950 |
|
---|
1951 | /** Returns default shortcut. */
|
---|
1952 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
1953 | {
|
---|
1954 | return QKeySequence();
|
---|
1955 | }
|
---|
1956 |
|
---|
1957 | /** Handles translation event. */
|
---|
1958 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1959 | {
|
---|
1960 | setName(QApplication::translate("UIActionPool", "Go Backward"));
|
---|
1961 | setShortcutScope(QApplication::translate("UIActionPool", "File Manager"));
|
---|
1962 | setStatusTip(QApplication::translate("UIActionPool", "Go forward"));
|
---|
1963 | setToolTip( QApplication::translate("UIActionPool", "Go Backward")
|
---|
1964 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
1965 | }
|
---|
1966 | };
|
---|
1967 |
|
---|
1968 | /** Simple action extension, used as 'Perform Delete' in file manager action class. */
|
---|
1969 | class UIActionMenuFileManagerDelete : public UIActionSimple
|
---|
1970 | {
|
---|
1971 | Q_OBJECT;
|
---|
1972 |
|
---|
1973 | public:
|
---|
1974 |
|
---|
1975 | /** Constructs action passing @a pParent to the base-class. */
|
---|
1976 | UIActionMenuFileManagerDelete(UIActionPool *pParent)
|
---|
1977 | : UIActionSimple(pParent,
|
---|
1978 | ":/file_manager_delete_24px.png", ":/file_manager_delete_16px.png",
|
---|
1979 | ":/file_manager_delete_disabled_24px.png", ":/file_manager_delete_disabled_16px.png")
|
---|
1980 | {}
|
---|
1981 |
|
---|
1982 | protected:
|
---|
1983 |
|
---|
1984 | /** Returns shortcut extra-data ID. */
|
---|
1985 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
1986 | {
|
---|
1987 | return QString("FileManagerDelete");
|
---|
1988 | }
|
---|
1989 |
|
---|
1990 | /** Returns default shortcut. */
|
---|
1991 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
1992 | {
|
---|
1993 | return QKeySequence();
|
---|
1994 | }
|
---|
1995 |
|
---|
1996 | /** Handles translation event. */
|
---|
1997 | virtual void retranslateUi() RT_OVERRIDE
|
---|
1998 | {
|
---|
1999 | setName(QApplication::translate("UIActionPool", "Delete"));
|
---|
2000 | setShortcutScope(QApplication::translate("UIActionPool", "File Manager"));
|
---|
2001 | setStatusTip(QApplication::translate("UIActionPool", "Delete selected file object(s)"));
|
---|
2002 | setToolTip( QApplication::translate("UIActionPool", "Delete Selected Object(s)")
|
---|
2003 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
2004 | }
|
---|
2005 | };
|
---|
2006 |
|
---|
2007 | /** Simple action extension, used as 'Perform Refresh' in file manager action class. */
|
---|
2008 | class UIActionMenuFileManagerRefresh : public UIActionSimple
|
---|
2009 | {
|
---|
2010 | Q_OBJECT;
|
---|
2011 |
|
---|
2012 | public:
|
---|
2013 |
|
---|
2014 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2015 | UIActionMenuFileManagerRefresh(UIActionPool *pParent)
|
---|
2016 | : UIActionSimple(pParent,
|
---|
2017 | ":/file_manager_refresh_24px.png", ":/file_manager_refresh_16px.png",
|
---|
2018 | ":/file_manager_refresh_disabled_24px.png", ":/file_manager_refresh_disabled_16px.png")
|
---|
2019 | {}
|
---|
2020 |
|
---|
2021 | protected:
|
---|
2022 |
|
---|
2023 | /** Returns shortcut extra-data ID. */
|
---|
2024 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2025 | {
|
---|
2026 | return QString("FileManagerRefresh");
|
---|
2027 | }
|
---|
2028 |
|
---|
2029 | /** Returns default shortcut. */
|
---|
2030 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
2031 | {
|
---|
2032 | return QKeySequence();
|
---|
2033 | }
|
---|
2034 |
|
---|
2035 | /** Handles translation event. */
|
---|
2036 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2037 | {
|
---|
2038 | setName(QApplication::translate("UIActionPool", "Refresh"));
|
---|
2039 | setShortcutScope(QApplication::translate("UIActionPool", "File Manager"));
|
---|
2040 | setStatusTip(QApplication::translate("UIActionPool", "Refresh"));
|
---|
2041 | setToolTip( QApplication::translate("UIActionPool", "Refresh Contents")
|
---|
2042 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
2043 | }
|
---|
2044 | };
|
---|
2045 |
|
---|
2046 | /** Simple action extension, used as 'Perform Rename' in file manager action class. */
|
---|
2047 | class UIActionMenuFileManagerRename : public UIActionSimple
|
---|
2048 | {
|
---|
2049 | Q_OBJECT;
|
---|
2050 |
|
---|
2051 | public:
|
---|
2052 |
|
---|
2053 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2054 | UIActionMenuFileManagerRename(UIActionPool *pParent)
|
---|
2055 | : UIActionSimple(pParent,
|
---|
2056 | ":/file_manager_rename_24px.png", ":/file_manager_rename_16px.png",
|
---|
2057 | ":/file_manager_rename_disabled_24px.png", ":/file_manager_rename_disabled_16px.png"){}
|
---|
2058 |
|
---|
2059 | protected:
|
---|
2060 |
|
---|
2061 | /** Returns shortcut extra-data ID. */
|
---|
2062 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2063 | {
|
---|
2064 | return QString("FileManagerRename");
|
---|
2065 | }
|
---|
2066 |
|
---|
2067 | /** Returns default shortcut. */
|
---|
2068 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
2069 | {
|
---|
2070 | return QKeySequence();
|
---|
2071 | }
|
---|
2072 |
|
---|
2073 | /** Handles translation event. */
|
---|
2074 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2075 | {
|
---|
2076 | setName(QApplication::translate("UIActionPool", "Rename"));
|
---|
2077 | setShortcutScope(QApplication::translate("UIActionPool", "File Manager"));
|
---|
2078 | setStatusTip(QApplication::translate("UIActionPool", "Rename selected file object"));
|
---|
2079 | setToolTip( QApplication::translate("UIActionPool", "Rename Selected Object")
|
---|
2080 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
2081 | }
|
---|
2082 | };
|
---|
2083 |
|
---|
2084 | /** Simple action extension, used as 'Perform Rename' in file manager action class. */
|
---|
2085 | class UIActionMenuFileManagerCreateNewDirectory : public UIActionSimple
|
---|
2086 | {
|
---|
2087 | Q_OBJECT;
|
---|
2088 |
|
---|
2089 | public:
|
---|
2090 |
|
---|
2091 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2092 | UIActionMenuFileManagerCreateNewDirectory(UIActionPool *pParent)
|
---|
2093 | : UIActionSimple(pParent,
|
---|
2094 | ":/file_manager_new_directory_24px.png", ":/file_manager_new_directory_16px.png",
|
---|
2095 | ":/file_manager_new_directory_disabled_24px.png", ":/file_manager_new_directory_disabled_16px.png"){}
|
---|
2096 |
|
---|
2097 | protected:
|
---|
2098 |
|
---|
2099 | /** Returns shortcut extra-data ID. */
|
---|
2100 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2101 | {
|
---|
2102 | return QString("FileManagerCreateNewDirectory");
|
---|
2103 | }
|
---|
2104 |
|
---|
2105 | /** Returns default shortcut. */
|
---|
2106 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
2107 | {
|
---|
2108 | return QKeySequence();
|
---|
2109 | }
|
---|
2110 |
|
---|
2111 | /** Handles translation event. */
|
---|
2112 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2113 | {
|
---|
2114 | setName(QApplication::translate("UIActionPool", "Create New Directory"));
|
---|
2115 | setShortcutScope(QApplication::translate("UIActionPool", "File Manager"));
|
---|
2116 | setStatusTip(QApplication::translate("UIActionPool", "Create New Directory"));
|
---|
2117 | setToolTip( QApplication::translate("UIActionPool", "Create New Directory")
|
---|
2118 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
2119 | }
|
---|
2120 | };
|
---|
2121 |
|
---|
2122 | /** Simple action extension, used as 'Perform Copy' in file manager action class. */
|
---|
2123 | class UIActionMenuFileManagerCopy : public UIActionSimple
|
---|
2124 | {
|
---|
2125 | Q_OBJECT;
|
---|
2126 |
|
---|
2127 | public:
|
---|
2128 |
|
---|
2129 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2130 | UIActionMenuFileManagerCopy(UIActionPool *pParent)
|
---|
2131 | : UIActionSimple(pParent,
|
---|
2132 | ":/file_manager_copy_24px.png", ":/file_manager_copy_16px.png",
|
---|
2133 | ":/file_manager_copy_disabled_24px.png", ":/file_manager_copy_disabled_16px.png"){}
|
---|
2134 |
|
---|
2135 | protected:
|
---|
2136 |
|
---|
2137 | /** Returns shortcut extra-data ID. */
|
---|
2138 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2139 | {
|
---|
2140 | return QString("FileManagerCopy");
|
---|
2141 | }
|
---|
2142 |
|
---|
2143 | /** Returns default shortcut. */
|
---|
2144 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
2145 | {
|
---|
2146 | return QKeySequence();
|
---|
2147 | }
|
---|
2148 |
|
---|
2149 | /** Handles translation event. */
|
---|
2150 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2151 | {
|
---|
2152 | setName(QApplication::translate("UIActionPool", "Copy"));
|
---|
2153 | setShortcutScope(QApplication::translate("UIActionPool", "File Manager"));
|
---|
2154 | setStatusTip(QApplication::translate("UIActionPool", "Copy selected file object(s)"));
|
---|
2155 | setToolTip( QApplication::translate("UIActionPool", "Copy Selected Object(s)")
|
---|
2156 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
2157 | }
|
---|
2158 | };
|
---|
2159 |
|
---|
2160 | /** Simple action extension, used as 'Perform Cut' in file manager action class. */
|
---|
2161 | class UIActionMenuFileManagerCut : public UIActionSimple
|
---|
2162 | {
|
---|
2163 | Q_OBJECT;
|
---|
2164 |
|
---|
2165 | public:
|
---|
2166 |
|
---|
2167 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2168 | UIActionMenuFileManagerCut(UIActionPool *pParent)
|
---|
2169 | : UIActionSimple(pParent,
|
---|
2170 | ":/file_manager_cut_24px.png", ":/file_manager_cut_16px.png",
|
---|
2171 | ":/file_manager_cut_disabled_24px.png", ":/file_manager_cut_disabled_16px.png"){}
|
---|
2172 |
|
---|
2173 | protected:
|
---|
2174 |
|
---|
2175 | /** Returns shortcut extra-data ID. */
|
---|
2176 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2177 | {
|
---|
2178 | return QString("FileManagerCut");
|
---|
2179 | }
|
---|
2180 |
|
---|
2181 | /** Returns default shortcut. */
|
---|
2182 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
2183 | {
|
---|
2184 | return QKeySequence();
|
---|
2185 | }
|
---|
2186 |
|
---|
2187 | /** Handles translation event. */
|
---|
2188 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2189 | {
|
---|
2190 | setName(QApplication::translate("UIActionPool", "Cut"));
|
---|
2191 | setShortcutScope(QApplication::translate("UIActionPool", "File Manager"));
|
---|
2192 | setStatusTip(QApplication::translate("UIActionPool", "Cut selected file object(s)"));
|
---|
2193 | setToolTip( QApplication::translate("UIActionPool", "Cut Selected Object(s)")
|
---|
2194 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
2195 | }
|
---|
2196 | };
|
---|
2197 |
|
---|
2198 | /** Simple action extension, used as 'Perform Paste' in file manager action class. */
|
---|
2199 | class UIActionMenuFileManagerPaste : public UIActionSimple
|
---|
2200 | {
|
---|
2201 | Q_OBJECT;
|
---|
2202 |
|
---|
2203 | public:
|
---|
2204 |
|
---|
2205 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2206 | UIActionMenuFileManagerPaste(UIActionPool *pParent)
|
---|
2207 | : UIActionSimple(pParent,
|
---|
2208 | ":/file_manager_paste_24px.png", ":/file_manager_paste_16px.png",
|
---|
2209 | ":/file_manager_paste_disabled_24px.png", ":/file_manager_paste_disabled_16px.png"){}
|
---|
2210 |
|
---|
2211 | protected:
|
---|
2212 |
|
---|
2213 | /** Returns shortcut extra-data ID. */
|
---|
2214 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2215 | {
|
---|
2216 | return QString("FileManagerPaste");
|
---|
2217 | }
|
---|
2218 |
|
---|
2219 | /** Returns default shortcut. */
|
---|
2220 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
2221 | {
|
---|
2222 | return QKeySequence();
|
---|
2223 | }
|
---|
2224 |
|
---|
2225 | /** Handles translation event. */
|
---|
2226 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2227 | {
|
---|
2228 | setName(QApplication::translate("UIActionPool", "Paste"));
|
---|
2229 | setShortcutScope(QApplication::translate("UIActionPool", "File Manager"));
|
---|
2230 | setStatusTip(QApplication::translate("UIActionPool", "Paste copied/cut file object(s)"));
|
---|
2231 | setToolTip( QApplication::translate("UIActionPool", "Paste Copied/Cut Object(s)")
|
---|
2232 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
2233 | }
|
---|
2234 | };
|
---|
2235 |
|
---|
2236 | /** Simple action extension, used as 'Select All' in file manager action class. */
|
---|
2237 | class UIActionMenuFileManagerSelectAll : public UIActionSimple
|
---|
2238 | {
|
---|
2239 | Q_OBJECT;
|
---|
2240 |
|
---|
2241 | public:
|
---|
2242 |
|
---|
2243 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2244 | UIActionMenuFileManagerSelectAll(UIActionPool *pParent)
|
---|
2245 | : UIActionSimple(pParent,
|
---|
2246 | ":/file_manager_select_all_24px.png", ":/file_manager_select_all_16px.png",
|
---|
2247 | ":/file_manager_select_all_disabled_24px.png", ":/file_manager_select_all_disabled_16px.png"){}
|
---|
2248 |
|
---|
2249 | protected:
|
---|
2250 |
|
---|
2251 | /** Returns shortcut extra-data ID. */
|
---|
2252 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2253 | {
|
---|
2254 | return QString("FileManagerSelectAll");
|
---|
2255 | }
|
---|
2256 |
|
---|
2257 | /** Returns default shortcut. */
|
---|
2258 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
2259 | {
|
---|
2260 | return QKeySequence();
|
---|
2261 | }
|
---|
2262 |
|
---|
2263 | /** Handles translation event. */
|
---|
2264 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2265 | {
|
---|
2266 | setName(QApplication::translate("UIActionPool", "Select All"));
|
---|
2267 | setShortcutScope(QApplication::translate("UIActionPool", "File Manager"));
|
---|
2268 | setStatusTip(QApplication::translate("UIActionPool", "Select all files objects"));
|
---|
2269 | setToolTip( QApplication::translate("UIActionPool", "Select All Objects")
|
---|
2270 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
2271 | }
|
---|
2272 | };
|
---|
2273 |
|
---|
2274 | /** Simple action extension, used as 'Invert Selection' in file manager action class. */
|
---|
2275 | class UIActionMenuFileManagerInvertSelection : public UIActionSimple
|
---|
2276 | {
|
---|
2277 | Q_OBJECT;
|
---|
2278 |
|
---|
2279 | public:
|
---|
2280 |
|
---|
2281 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2282 | UIActionMenuFileManagerInvertSelection(UIActionPool *pParent)
|
---|
2283 | : UIActionSimple(pParent,
|
---|
2284 | ":/file_manager_invert_selection_24px.png", ":/file_manager_invert_selection_16px.png",
|
---|
2285 | ":/file_manager_invert_selection_disabled_24px.png", ":/file_manager_invert_selection_disabled_16px.png"){}
|
---|
2286 |
|
---|
2287 | protected:
|
---|
2288 |
|
---|
2289 | /** Returns shortcut extra-data ID. */
|
---|
2290 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2291 | {
|
---|
2292 | return QString("FileManagerInvertSelection");
|
---|
2293 | }
|
---|
2294 |
|
---|
2295 | /** Returns default shortcut. */
|
---|
2296 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
2297 | {
|
---|
2298 | return QKeySequence();
|
---|
2299 | }
|
---|
2300 |
|
---|
2301 | /** Handles translation event. */
|
---|
2302 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2303 | {
|
---|
2304 | setName(QApplication::translate("UIActionPool", "Invert Selection"));
|
---|
2305 | setShortcutScope(QApplication::translate("UIActionPool", "File Manager"));
|
---|
2306 | setStatusTip(QApplication::translate("UIActionPool", "Invert the current selection"));
|
---|
2307 | setToolTip( QApplication::translate("UIActionPool", "Invert Current Selection")
|
---|
2308 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
2309 | }
|
---|
2310 | };
|
---|
2311 |
|
---|
2312 | /** Simple action extension, used as 'Show Properties' in file manager action class. */
|
---|
2313 | class UIActionMenuFileManagerShowProperties : public UIActionSimple
|
---|
2314 | {
|
---|
2315 | Q_OBJECT;
|
---|
2316 |
|
---|
2317 | public:
|
---|
2318 |
|
---|
2319 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2320 | UIActionMenuFileManagerShowProperties(UIActionPool *pParent)
|
---|
2321 | : UIActionSimple(pParent,
|
---|
2322 | ":/file_manager_properties_24px.png", ":/file_manager_properties_16px.png",
|
---|
2323 | ":/file_manager_properties_disabled_24px.png", ":/file_manager_properties_disabled_16px.png"){}
|
---|
2324 |
|
---|
2325 | protected:
|
---|
2326 |
|
---|
2327 | /** Returns shortcut extra-data ID. */
|
---|
2328 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2329 | {
|
---|
2330 | return QString("FileManagerShowProperties");
|
---|
2331 | }
|
---|
2332 |
|
---|
2333 | /** Returns default shortcut. */
|
---|
2334 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
2335 | {
|
---|
2336 | return QKeySequence();
|
---|
2337 | }
|
---|
2338 |
|
---|
2339 | /** Handles translation event. */
|
---|
2340 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2341 | {
|
---|
2342 | setName(QApplication::translate("UIActionPool", "Show Properties"));
|
---|
2343 | setShortcutScope(QApplication::translate("UIActionPool", "File Manager"));
|
---|
2344 | setStatusTip(QApplication::translate("UIActionPool", "Show the properties of currently selected file object(s)"));
|
---|
2345 | setToolTip( QApplication::translate("UIActionPool", "Show Properties of Current Object(s)")
|
---|
2346 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
2347 | }
|
---|
2348 | };
|
---|
2349 |
|
---|
2350 | /** Menu action extension, used as 'VISO Creator' menu class. */
|
---|
2351 | class UIActionMenuVISOCreator : public UIActionMenu
|
---|
2352 | {
|
---|
2353 | Q_OBJECT;
|
---|
2354 |
|
---|
2355 | public:
|
---|
2356 |
|
---|
2357 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2358 | UIActionMenuVISOCreator(UIActionPool *pParent)
|
---|
2359 | : UIActionMenu(pParent)
|
---|
2360 | {}
|
---|
2361 |
|
---|
2362 | protected:
|
---|
2363 |
|
---|
2364 | /** Returns shortcut extra-data ID. */
|
---|
2365 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2366 | {
|
---|
2367 | return QString("VISOCreatorMenu");
|
---|
2368 | }
|
---|
2369 |
|
---|
2370 | /** Handles translation event. */
|
---|
2371 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2372 | {
|
---|
2373 | setName(QApplication::translate("UIActionPool", "VISO Creator"));
|
---|
2374 | }
|
---|
2375 | };
|
---|
2376 |
|
---|
2377 | /** Toggle action extension, used to toggle 'VISO Creator settings' dialog in file manager. */
|
---|
2378 | class UIActionMenuVISOCreatorToggleSettingsDialog : public UIActionToggle
|
---|
2379 | {
|
---|
2380 | Q_OBJECT;
|
---|
2381 |
|
---|
2382 | public:
|
---|
2383 |
|
---|
2384 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2385 | UIActionMenuVISOCreatorToggleSettingsDialog(UIActionPool *pParent)
|
---|
2386 | : UIActionToggle(pParent)
|
---|
2387 | {
|
---|
2388 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
2389 | setIcon(UIIconPool::iconSetFull(":/file_manager_options_32px.png",
|
---|
2390 | ":/%file_manager_options_16px.png",
|
---|
2391 | ":/file_manager_options_disabled_32px.png",
|
---|
2392 | ":/file_manager_options_disabled_16px.png"));
|
---|
2393 | }
|
---|
2394 |
|
---|
2395 | protected:
|
---|
2396 |
|
---|
2397 | /** Returns shortcut extra-data ID. */
|
---|
2398 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2399 | {
|
---|
2400 | return QString("ToggleVISOCreatorSettingsDialog");
|
---|
2401 | }
|
---|
2402 |
|
---|
2403 | /** Returns default shortcut. */
|
---|
2404 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
2405 | {
|
---|
2406 | return QKeySequence();
|
---|
2407 | }
|
---|
2408 |
|
---|
2409 | /** Handles translation event. */
|
---|
2410 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2411 | {
|
---|
2412 | setName(QApplication::translate("UIActionPool", "Settings"));
|
---|
2413 | setShortcutScope(QApplication::translate("UIActionPool", "VISO Creator"));
|
---|
2414 | setStatusTip(QApplication::translate("UIActionPool", "Open VISO Creator settings dialog"));
|
---|
2415 | setToolTip(QApplication::translate("UIActionPool", "Open Settings Dialog")
|
---|
2416 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
2417 | }
|
---|
2418 | };
|
---|
2419 |
|
---|
2420 | class UIActionMenuVISOCreatorAdd : public UIActionSimple
|
---|
2421 | {
|
---|
2422 | Q_OBJECT;
|
---|
2423 |
|
---|
2424 | public:
|
---|
2425 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2426 | UIActionMenuVISOCreatorAdd(UIActionPool *pParent)
|
---|
2427 | : UIActionSimple(pParent,
|
---|
2428 | ":/file_manager_copy_to_guest_24px.png",
|
---|
2429 | ":/file_manager_copy_to_guest_16px.png",
|
---|
2430 | ":/file_manager_copy_to_guest_disabled_24px.png",
|
---|
2431 | ":/file_manager_copy_to_guest_disabled_16px.png")
|
---|
2432 | {
|
---|
2433 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
2434 | }
|
---|
2435 |
|
---|
2436 | protected:
|
---|
2437 |
|
---|
2438 | /** Returns shortcut extra-data ID. */
|
---|
2439 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2440 | {
|
---|
2441 | return QString("VISOAddItem");
|
---|
2442 | }
|
---|
2443 |
|
---|
2444 | /** Handles translation event. */
|
---|
2445 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2446 | {
|
---|
2447 | setName(QApplication::translate("UIActionPool", "&Add"));
|
---|
2448 | setShortcutScope(QApplication::translate("UIActionPool", "VISO Creator"));
|
---|
2449 | setStatusTip(QApplication::translate("UIActionPool", "Add selected item(s) to VISO"));
|
---|
2450 | setToolTip(QApplication::translate("UIActionPool", "Add Item(s) to VISO")
|
---|
2451 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
2452 | }
|
---|
2453 | };
|
---|
2454 |
|
---|
2455 | class UIActionMenuVISOCreatorRemove : public UIActionSimple
|
---|
2456 | {
|
---|
2457 | Q_OBJECT;
|
---|
2458 |
|
---|
2459 | public:
|
---|
2460 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2461 | UIActionMenuVISOCreatorRemove(UIActionPool *pParent)
|
---|
2462 | : UIActionSimple(pParent,
|
---|
2463 | ":/file_manager_delete_24px.png",
|
---|
2464 | ":/file_manager_delete_16px.png",
|
---|
2465 | ":/file_manager_delete_disabled_24px.png",
|
---|
2466 | ":/file_manager_delete_disabled_16px.png")
|
---|
2467 | {
|
---|
2468 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
2469 | }
|
---|
2470 |
|
---|
2471 | protected:
|
---|
2472 |
|
---|
2473 | /** Returns shortcut extra-data ID. */
|
---|
2474 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2475 | {
|
---|
2476 | return QString("VISORemoveItem");
|
---|
2477 | }
|
---|
2478 |
|
---|
2479 | /** Handles translation event. */
|
---|
2480 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2481 | {
|
---|
2482 | setName(QApplication::translate("UIActionPool", "&Remove"));
|
---|
2483 | setShortcutScope(QApplication::translate("UIActionPool", "VISO Creator"));
|
---|
2484 | setStatusTip(QApplication::translate("UIActionPool", "Remove selected item(s) from VISO"));
|
---|
2485 | setToolTip(QApplication::translate("UIActionPool", "Remove Selected Item(s) from VISO")
|
---|
2486 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
2487 | }
|
---|
2488 | };
|
---|
2489 |
|
---|
2490 | class UIActionMenuVISOCreatorRestore : public UIActionSimple
|
---|
2491 | {
|
---|
2492 | Q_OBJECT;
|
---|
2493 |
|
---|
2494 | public:
|
---|
2495 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2496 | UIActionMenuVISOCreatorRestore(UIActionPool *pParent)
|
---|
2497 | : UIActionSimple(pParent,
|
---|
2498 | ":/file_manager_restore_24px.png",
|
---|
2499 | ":/file_manager_restore_16px.png",
|
---|
2500 | ":/file_manager_restore_disabled_24px.png",
|
---|
2501 | ":/file_manager_restore_disabled_16px.png")
|
---|
2502 | {
|
---|
2503 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
2504 | }
|
---|
2505 |
|
---|
2506 | protected:
|
---|
2507 |
|
---|
2508 | /** Returns shortcut extra-data ID. */
|
---|
2509 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2510 | {
|
---|
2511 | return QString("VISORestoreItem");
|
---|
2512 | }
|
---|
2513 |
|
---|
2514 | /** Handles translation event. */
|
---|
2515 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2516 | {
|
---|
2517 | setName(QApplication::translate("UIActionPool", "&Restore"));
|
---|
2518 | setShortcutScope(QApplication::translate("UIActionPool", "VISO Creator"));
|
---|
2519 | setStatusTip(QApplication::translate("UIActionPool", "Restore selected item(s)"));
|
---|
2520 | setToolTip(QApplication::translate("UIActionPool", "Restore Selected Item(s)")
|
---|
2521 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
2522 | }
|
---|
2523 | };
|
---|
2524 |
|
---|
2525 | class UIActionMenuVISOCreatorCreateNewDirectory : public UIActionSimple
|
---|
2526 | {
|
---|
2527 | Q_OBJECT;
|
---|
2528 |
|
---|
2529 | public:
|
---|
2530 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2531 | UIActionMenuVISOCreatorCreateNewDirectory(UIActionPool *pParent)
|
---|
2532 | : UIActionSimple(pParent,
|
---|
2533 | ":/file_manager_new_directory_24px.png",
|
---|
2534 | ":/file_manager_new_directory_16px.png",
|
---|
2535 | ":/file_manager_new_directory_disabled_24px.png",
|
---|
2536 | ":/file_manager_new_directory_disabled_16px.png")
|
---|
2537 | {
|
---|
2538 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
2539 | }
|
---|
2540 |
|
---|
2541 | protected:
|
---|
2542 |
|
---|
2543 | /** Returns shortcut extra-data ID. */
|
---|
2544 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2545 | {
|
---|
2546 | return QString("VISONewDirectory");
|
---|
2547 | }
|
---|
2548 |
|
---|
2549 | /** Handles translation event. */
|
---|
2550 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2551 | {
|
---|
2552 | setName(QApplication::translate("UIActionPool", "&New Directory"));
|
---|
2553 | setShortcutScope(QApplication::translate("UIActionPool", "VISO Creator"));
|
---|
2554 | setStatusTip(QApplication::translate("UIActionPool", "Create a new directory under the current location"));
|
---|
2555 | setToolTip(QApplication::translate("UIActionPool", "Create New Directory")
|
---|
2556 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
2557 | }
|
---|
2558 | };
|
---|
2559 |
|
---|
2560 | class UIActionMenuVISOCreatorRename : public UIActionSimple
|
---|
2561 | {
|
---|
2562 | Q_OBJECT;
|
---|
2563 |
|
---|
2564 | public:
|
---|
2565 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2566 | UIActionMenuVISOCreatorRename(UIActionPool *pParent)
|
---|
2567 | : UIActionSimple(pParent,
|
---|
2568 | ":/file_manager_rename_24px.png",
|
---|
2569 | ":/file_manager_rename_16px.png",
|
---|
2570 | ":/file_manager_rename_disabled_24px.png",
|
---|
2571 | ":/file_manager_rename_disabled_16px.png")
|
---|
2572 | {
|
---|
2573 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
2574 | }
|
---|
2575 |
|
---|
2576 | protected:
|
---|
2577 |
|
---|
2578 | /** Returns shortcut extra-data ID. */
|
---|
2579 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2580 | {
|
---|
2581 | return QString("VISORenameItem");
|
---|
2582 | }
|
---|
2583 |
|
---|
2584 | /** Handles translation event. */
|
---|
2585 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2586 | {
|
---|
2587 | setName(QApplication::translate("UIActionPool", "&Rename"));
|
---|
2588 | setShortcutScope(QApplication::translate("UIActionPool", "VISO Creator"));
|
---|
2589 | setStatusTip(QApplication::translate("UIActionPool", "Rename the selected object"));
|
---|
2590 | setToolTip(QApplication::translate("UIActionPool", "Rename Selected VISO File Object")
|
---|
2591 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
2592 | }
|
---|
2593 | };
|
---|
2594 |
|
---|
2595 | class UIActionMenuVISOCreatorReset : public UIActionSimple
|
---|
2596 | {
|
---|
2597 | Q_OBJECT;
|
---|
2598 |
|
---|
2599 | public:
|
---|
2600 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2601 | UIActionMenuVISOCreatorReset(UIActionPool *pParent)
|
---|
2602 | : UIActionSimple(pParent,
|
---|
2603 | ":/cd_remove_16px.png", ":/cd_remove_disabled_16px.png")
|
---|
2604 | {
|
---|
2605 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
2606 | }
|
---|
2607 |
|
---|
2608 | protected:
|
---|
2609 |
|
---|
2610 | /** Returns shortcut extra-data ID. */
|
---|
2611 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2612 | {
|
---|
2613 | return QString("VISOReset");
|
---|
2614 | }
|
---|
2615 |
|
---|
2616 | /** Handles translation event. */
|
---|
2617 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2618 | {
|
---|
2619 | setName(QApplication::translate("UIActionPool", "R&eset"));
|
---|
2620 | setShortcutScope(QApplication::translate("UIActionPool", "VISO Creator"));
|
---|
2621 | setStatusTip(QApplication::translate("UIActionPool", "Reset the VISO content."));
|
---|
2622 | setToolTip(QApplication::translate("UIActionPool", "Reset the VISO content.")
|
---|
2623 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
2624 | }
|
---|
2625 | };
|
---|
2626 |
|
---|
2627 | class UIActionMenuVISOCreatorOpen : public UIActionSimple
|
---|
2628 | {
|
---|
2629 | Q_OBJECT;
|
---|
2630 |
|
---|
2631 | public:
|
---|
2632 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2633 | UIActionMenuVISOCreatorOpen(UIActionPool *pParent)
|
---|
2634 | : UIActionSimple(pParent,
|
---|
2635 | ":/cd_remove_16px.png", ":/cd_remove_32px.png")
|
---|
2636 | {
|
---|
2637 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
2638 | }
|
---|
2639 |
|
---|
2640 | protected:
|
---|
2641 |
|
---|
2642 | /** Returns shortcut extra-data ID. */
|
---|
2643 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2644 | {
|
---|
2645 | return QString("VISOOpen");
|
---|
2646 | }
|
---|
2647 |
|
---|
2648 | /** Handles translation event. */
|
---|
2649 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2650 | {
|
---|
2651 | setName(QApplication::translate("UIActionPool", "Open"));
|
---|
2652 | setShortcutScope(QApplication::translate("UIActionPool", "VISO Creator"));
|
---|
2653 | setStatusTip(QApplication::translate("UIActionPool", "Open the VISO content."));
|
---|
2654 | setToolTip(QApplication::translate("UIActionPool", "Open the VISO content.")
|
---|
2655 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
2656 | }
|
---|
2657 | };
|
---|
2658 |
|
---|
2659 | class UIActionMenuVISOCreatorSaveAs : public UIActionSimple
|
---|
2660 | {
|
---|
2661 | Q_OBJECT;
|
---|
2662 |
|
---|
2663 | public:
|
---|
2664 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2665 | UIActionMenuVISOCreatorSaveAs(UIActionPool *pParent)
|
---|
2666 | : UIActionSimple(pParent,
|
---|
2667 | ":/cd_write_16px.png", ":/cd_write_32px.png")
|
---|
2668 | {
|
---|
2669 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
2670 | }
|
---|
2671 |
|
---|
2672 | protected:
|
---|
2673 |
|
---|
2674 | /** Returns shortcut extra-data ID. */
|
---|
2675 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2676 | {
|
---|
2677 | return QString("VISOSaveAs");
|
---|
2678 | }
|
---|
2679 |
|
---|
2680 | /** Handles translation event. */
|
---|
2681 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2682 | {
|
---|
2683 | setName(QApplication::translate("UIActionPool", "Save As"));
|
---|
2684 | setShortcutScope(QApplication::translate("UIActionPool", "VISO Creator"));
|
---|
2685 | setStatusTip(QApplication::translate("UIActionPool", "Save the VISO content."));
|
---|
2686 | setToolTip(QApplication::translate("UIActionPool", "Save the VISO content.")
|
---|
2687 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
2688 | }
|
---|
2689 | };
|
---|
2690 |
|
---|
2691 | class UIActionMenuVISOCreatorImportISO : public UIActionSimple
|
---|
2692 | {
|
---|
2693 | Q_OBJECT;
|
---|
2694 |
|
---|
2695 | public:
|
---|
2696 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2697 | UIActionMenuVISOCreatorImportISO(UIActionPool *pParent)
|
---|
2698 | : UIActionSimple(pParent,
|
---|
2699 | ":/cd_add_16px.png", ":/cd_add_32px.png", ":/cd_add_disabled_16px.png", ":/cd_add_disabled_32px.png")
|
---|
2700 | {
|
---|
2701 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
2702 | }
|
---|
2703 |
|
---|
2704 | protected:
|
---|
2705 |
|
---|
2706 | /** Returns shortcut extra-data ID. */
|
---|
2707 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2708 | {
|
---|
2709 | return QString("ISOImport");
|
---|
2710 | }
|
---|
2711 |
|
---|
2712 | /** Handles translation event. */
|
---|
2713 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2714 | {
|
---|
2715 | setName(QApplication::translate("UIActionPool", "ISOImport"));
|
---|
2716 | setShortcutScope(QApplication::translate("UIActionPool", "VISO Creator"));
|
---|
2717 | setStatusTip(QApplication::translate("UIActionPool", "Import ISO into the VISO content."));
|
---|
2718 | setToolTip(QApplication::translate("UIActionPool", "Import Selected ISO into the VISO content.")
|
---|
2719 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
2720 | }
|
---|
2721 | };
|
---|
2722 |
|
---|
2723 |
|
---|
2724 | class UIActionMenuVISOCreatorRemoveISO : public UIActionSimple
|
---|
2725 | {
|
---|
2726 | Q_OBJECT;
|
---|
2727 |
|
---|
2728 | public:
|
---|
2729 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2730 | UIActionMenuVISOCreatorRemoveISO(UIActionPool *pParent)
|
---|
2731 | : UIActionSimple(pParent,
|
---|
2732 | ":/cd_remove_16px.png", ":/cd_remove_32px.png", ":/cd_remove_disabled_16px.png", ":/cd_remove_disabled_32px.png")
|
---|
2733 | {
|
---|
2734 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
2735 | }
|
---|
2736 |
|
---|
2737 | protected:
|
---|
2738 |
|
---|
2739 | /** Returns shortcut extra-data ID. */
|
---|
2740 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2741 | {
|
---|
2742 | return QString("ISORemove");
|
---|
2743 | }
|
---|
2744 |
|
---|
2745 | /** Handles translation event. */
|
---|
2746 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2747 | {
|
---|
2748 | setName(QApplication::translate("UIActionPool", "ISORemove"));
|
---|
2749 | setShortcutScope(QApplication::translate("UIActionPool", "VISO Creator"));
|
---|
2750 | setStatusTip(QApplication::translate("UIActionPool", "Remove the imported ISO from the VISO content."));
|
---|
2751 | setToolTip(QApplication::translate("UIActionPool", "Remove the imported ISO from the VISO content.")
|
---|
2752 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
2753 | }
|
---|
2754 | };
|
---|
2755 |
|
---|
2756 | /** Simple action extension, used as 'Perform GoUp' in VISO creator action class. */
|
---|
2757 | class UIActionMenuVISOCreatorGoUp : public UIActionSimple
|
---|
2758 | {
|
---|
2759 | Q_OBJECT;
|
---|
2760 |
|
---|
2761 | public:
|
---|
2762 |
|
---|
2763 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2764 | UIActionMenuVISOCreatorGoUp(UIActionPool *pParent)
|
---|
2765 | : UIActionSimple(pParent,
|
---|
2766 | ":/file_manager_go_up_24px.png", ":/file_manager_go_up_16px.png",
|
---|
2767 | ":/file_manager_go_up_disabled_24px.png", ":/file_manager_go_up_disabled_16px.png")
|
---|
2768 | {}
|
---|
2769 |
|
---|
2770 | protected:
|
---|
2771 |
|
---|
2772 | /** Returns shortcut extra-data ID. */
|
---|
2773 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2774 | {
|
---|
2775 | return QString("VISOCreatorGoUp");
|
---|
2776 | }
|
---|
2777 |
|
---|
2778 | /** Returns default shortcut. */
|
---|
2779 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
2780 | {
|
---|
2781 | return QKeySequence();
|
---|
2782 | }
|
---|
2783 |
|
---|
2784 | /** Handles translation event. */
|
---|
2785 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2786 | {
|
---|
2787 | setName(QApplication::translate("UIActionPool", "Go Up"));
|
---|
2788 | setShortcutScope(QApplication::translate("UIActionPool", "VISO Creator"));
|
---|
2789 | setStatusTip(QApplication::translate("UIActionPool", "Go one level up to parent folder"));
|
---|
2790 | setToolTip( QApplication::translate("UIActionPool", "Go One Level Up")
|
---|
2791 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
2792 | }
|
---|
2793 | };
|
---|
2794 |
|
---|
2795 | /** Simple action extension, used as 'Perform GoHome' in VISO creator action class. */
|
---|
2796 | class UIActionMenuVISOCreatorGoHome : public UIActionSimple
|
---|
2797 | {
|
---|
2798 | Q_OBJECT;
|
---|
2799 |
|
---|
2800 | public:
|
---|
2801 |
|
---|
2802 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2803 | UIActionMenuVISOCreatorGoHome(UIActionPool *pParent)
|
---|
2804 | : UIActionSimple(pParent,
|
---|
2805 | ":/file_manager_go_home_24px.png", ":/file_manager_go_home_16px.png",
|
---|
2806 | ":/file_manager_go_home_disabled_24px.png", ":/file_manager_go_home_disabled_16px.png")
|
---|
2807 | {}
|
---|
2808 |
|
---|
2809 | protected:
|
---|
2810 |
|
---|
2811 | /** Returns shortcut extra-data ID. */
|
---|
2812 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2813 | {
|
---|
2814 | return QString("VISOCreatorGoHome");
|
---|
2815 | }
|
---|
2816 |
|
---|
2817 | /** Returns default shortcut. */
|
---|
2818 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
2819 | {
|
---|
2820 | return QKeySequence();
|
---|
2821 | }
|
---|
2822 |
|
---|
2823 | /** Handles translation event. */
|
---|
2824 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2825 | {
|
---|
2826 | setName(QApplication::translate("UIActionPool", "Go Home"));
|
---|
2827 | setShortcutScope(QApplication::translate("UIActionPool", "VISO Creator"));
|
---|
2828 | setStatusTip(QApplication::translate("UIActionPool", "Go to home folder"));
|
---|
2829 | setToolTip( QApplication::translate("UIActionPool", "Go to Home Folder")
|
---|
2830 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
2831 | }
|
---|
2832 | };
|
---|
2833 |
|
---|
2834 | /** Simple action extension, used as 'Perform GoForward' in VISO creator action class. */
|
---|
2835 | class UIActionMenuVISOCreatorGoForward : public UIActionSimple
|
---|
2836 | {
|
---|
2837 | Q_OBJECT;
|
---|
2838 |
|
---|
2839 | public:
|
---|
2840 |
|
---|
2841 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2842 | UIActionMenuVISOCreatorGoForward(UIActionPool *pParent)
|
---|
2843 | : UIActionSimple(pParent,
|
---|
2844 | ":/file_manager_go_forward_24px.png", ":/file_manager_go_forward_16px.png",
|
---|
2845 | ":/file_manager_go_forward_disabled_24px.png", ":/file_manager_go_forward_disabled_16px.png")
|
---|
2846 | {}
|
---|
2847 |
|
---|
2848 | protected:
|
---|
2849 |
|
---|
2850 | /** Returns shortcut extra-data ID. */
|
---|
2851 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2852 | {
|
---|
2853 | return QString("VISOCreatorGoForward");
|
---|
2854 | }
|
---|
2855 |
|
---|
2856 | /** Returns default shortcut. */
|
---|
2857 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
2858 | {
|
---|
2859 | return QKeySequence();
|
---|
2860 | }
|
---|
2861 |
|
---|
2862 | /** Handles translation event. */
|
---|
2863 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2864 | {
|
---|
2865 | setName(QApplication::translate("UIActionPool", "Go Forward"));
|
---|
2866 | setShortcutScope(QApplication::translate("UIActionPool", "VISO Creator"));
|
---|
2867 | setStatusTip(QApplication::translate("UIActionPool", "Go forward"));
|
---|
2868 | setToolTip( QApplication::translate("UIActionPool", "Go Forward")
|
---|
2869 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
2870 | }
|
---|
2871 | };
|
---|
2872 |
|
---|
2873 | /** Simple action extension, used as 'Perform GoBackward' in VISO creator action class. */
|
---|
2874 | class UIActionMenuVISOCreatorGoBackward : public UIActionSimple
|
---|
2875 | {
|
---|
2876 | Q_OBJECT;
|
---|
2877 |
|
---|
2878 | public:
|
---|
2879 |
|
---|
2880 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2881 | UIActionMenuVISOCreatorGoBackward(UIActionPool *pParent)
|
---|
2882 | : UIActionSimple(pParent,
|
---|
2883 | ":/file_manager_go_backward_24px.png", ":/file_manager_go_backward_16px.png",
|
---|
2884 | ":/file_manager_go_backward_disabled_24px.png", ":/file_manager_go_backward_disabled_16px.png")
|
---|
2885 | {}
|
---|
2886 |
|
---|
2887 | protected:
|
---|
2888 |
|
---|
2889 | /** Returns shortcut extra-data ID. */
|
---|
2890 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2891 | {
|
---|
2892 | return QString("VISOCreatorGoBackward");
|
---|
2893 | }
|
---|
2894 |
|
---|
2895 | /** Returns default shortcut. */
|
---|
2896 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
2897 | {
|
---|
2898 | return QKeySequence();
|
---|
2899 | }
|
---|
2900 |
|
---|
2901 | /** Handles translation event. */
|
---|
2902 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2903 | {
|
---|
2904 | setName(QApplication::translate("UIActionPool", "Go Backward"));
|
---|
2905 | setShortcutScope(QApplication::translate("UIActionPool", "VISO Creator"));
|
---|
2906 | setStatusTip(QApplication::translate("UIActionPool", "Go forward"));
|
---|
2907 | setToolTip( QApplication::translate("UIActionPool", "Go Backward")
|
---|
2908 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
2909 | }
|
---|
2910 | };
|
---|
2911 |
|
---|
2912 | /** Menu action extension, used as 'Menu Selector' menu class. */
|
---|
2913 | class UIActionMenuMediumSelector : public UIActionMenu
|
---|
2914 | {
|
---|
2915 | Q_OBJECT;
|
---|
2916 |
|
---|
2917 | public:
|
---|
2918 |
|
---|
2919 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2920 | UIActionMenuMediumSelector(UIActionPool *pParent)
|
---|
2921 | : UIActionMenu(pParent)
|
---|
2922 | {}
|
---|
2923 |
|
---|
2924 | protected:
|
---|
2925 |
|
---|
2926 | /** Returns shortcut extra-data ID. */
|
---|
2927 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2928 | {
|
---|
2929 | return QString("MediumSelector");
|
---|
2930 | }
|
---|
2931 |
|
---|
2932 | /** Handles translation event. */
|
---|
2933 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2934 | {
|
---|
2935 | setName(QApplication::translate("UIActionPool", "&Medium Selector"));
|
---|
2936 | }
|
---|
2937 | };
|
---|
2938 |
|
---|
2939 | /** Simple action extension, used as 'Add' action class. */
|
---|
2940 | class UIActionMenuMediumSelectorAddHD : public UIActionSimple
|
---|
2941 | {
|
---|
2942 | Q_OBJECT;
|
---|
2943 |
|
---|
2944 | public:
|
---|
2945 |
|
---|
2946 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2947 | UIActionMenuMediumSelectorAddHD(UIActionPool *pParent)
|
---|
2948 | : UIActionSimple(pParent, ":/hd_add_32px.png", ":/hd_add_16px.png",
|
---|
2949 | ":/hd_add_disabled_32px.png", ":/hd_add_disabled_16px.png")
|
---|
2950 | {
|
---|
2951 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
2952 | }
|
---|
2953 |
|
---|
2954 | protected:
|
---|
2955 |
|
---|
2956 | /** Returns shortcut extra-data ID. */
|
---|
2957 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2958 | {
|
---|
2959 | return QString("MediumSelectorAddHD");
|
---|
2960 | }
|
---|
2961 |
|
---|
2962 | /** Handles translation event. */
|
---|
2963 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2964 | {
|
---|
2965 | setName(QApplication::translate("UIActionPool", "&Add..."));
|
---|
2966 | setShortcutScope(QApplication::translate("UIActionPool", "Medium Selector"));
|
---|
2967 | setStatusTip(QApplication::translate("UIActionPool", "Add existing disk image file"));
|
---|
2968 | setToolTip( QApplication::translate("UIActionPool", "Add Disk Image File")
|
---|
2969 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
2970 | }
|
---|
2971 | };
|
---|
2972 |
|
---|
2973 | /** Simple action extension, used as 'Add' action class. */
|
---|
2974 | class UIActionMenuMediumSelectorAddCD : public UIActionSimple
|
---|
2975 | {
|
---|
2976 | Q_OBJECT;
|
---|
2977 |
|
---|
2978 | public:
|
---|
2979 |
|
---|
2980 | /** Constructs action passing @a pParent to the base-class. */
|
---|
2981 | UIActionMenuMediumSelectorAddCD(UIActionPool *pParent)
|
---|
2982 | : UIActionSimple(pParent, ":/cd_add_32px.png", ":/cd_add_16px.png",
|
---|
2983 | ":/cd_add_disabled_32px.png", ":/cd_add_disabled_16px.png")
|
---|
2984 | {
|
---|
2985 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
2986 | }
|
---|
2987 |
|
---|
2988 | protected:
|
---|
2989 |
|
---|
2990 | /** Returns shortcut extra-data ID. */
|
---|
2991 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
2992 | {
|
---|
2993 | return QString("MediumSelectorAddCD");
|
---|
2994 | }
|
---|
2995 |
|
---|
2996 | /** Handles translation event. */
|
---|
2997 | virtual void retranslateUi() RT_OVERRIDE
|
---|
2998 | {
|
---|
2999 | setName(QApplication::translate("UIActionPool", "&Add..."));
|
---|
3000 | setShortcutScope(QApplication::translate("UIActionPool", "Medium Selector"));
|
---|
3001 | setStatusTip(QApplication::translate("UIActionPool", "Add existing disk image file"));
|
---|
3002 | setToolTip( QApplication::translate("UIActionPool", "Add Disk Image File")
|
---|
3003 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
3004 | }
|
---|
3005 | };
|
---|
3006 |
|
---|
3007 | /** Simple action extension, used as 'Add' action class. */
|
---|
3008 | class UIActionMenuMediumSelectorAddFD : public UIActionSimple
|
---|
3009 | {
|
---|
3010 | Q_OBJECT;
|
---|
3011 |
|
---|
3012 | public:
|
---|
3013 |
|
---|
3014 | /** Constructs action passing @a pParent to the base-class. */
|
---|
3015 | UIActionMenuMediumSelectorAddFD(UIActionPool *pParent)
|
---|
3016 | : UIActionSimple(pParent, ":/fd_add_32px.png", ":/fd_add_16px.png",
|
---|
3017 | ":/fd_add_disabled_32px.png", ":/fd_add_disabled_16px.png")
|
---|
3018 | {
|
---|
3019 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
3020 | }
|
---|
3021 |
|
---|
3022 | protected:
|
---|
3023 |
|
---|
3024 | /** Returns shortcut extra-data ID. */
|
---|
3025 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
3026 | {
|
---|
3027 | return QString("MediumSelectorAddFD");
|
---|
3028 | }
|
---|
3029 |
|
---|
3030 | /** Handles translation event. */
|
---|
3031 | virtual void retranslateUi() RT_OVERRIDE
|
---|
3032 | {
|
---|
3033 | setName(QApplication::translate("UIActionPool", "&Add..."));
|
---|
3034 | setShortcutScope(QApplication::translate("UIActionPool", "Medium Selector"));
|
---|
3035 | setStatusTip(QApplication::translate("UIActionPool", "Add existing disk image file"));
|
---|
3036 | setToolTip( QApplication::translate("UIActionPool", "Add Disk Image File")
|
---|
3037 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
3038 | }
|
---|
3039 | };
|
---|
3040 |
|
---|
3041 | /** Simple action extension, used as 'Create' action class. */
|
---|
3042 | class UIActionMenuMediumSelectorCreateHD : public UIActionSimple
|
---|
3043 | {
|
---|
3044 | Q_OBJECT;
|
---|
3045 |
|
---|
3046 | public:
|
---|
3047 |
|
---|
3048 | /** Constructs action passing @a pParent to the base-class. */
|
---|
3049 | UIActionMenuMediumSelectorCreateHD(UIActionPool *pParent)
|
---|
3050 | : UIActionSimple(pParent, ":/hd_create_32px.png", ":/hd_create_16px.png",
|
---|
3051 | ":/hd_create_disabled_32px.png", ":/hd_create_disabled_16px.png")
|
---|
3052 | {
|
---|
3053 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
3054 | }
|
---|
3055 |
|
---|
3056 | protected:
|
---|
3057 |
|
---|
3058 | /** Returns shortcut extra-data ID. */
|
---|
3059 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
3060 | {
|
---|
3061 | return QString("MediumSelectorCreateHD");
|
---|
3062 | }
|
---|
3063 |
|
---|
3064 | /** Handles translation event. */
|
---|
3065 | virtual void retranslateUi() RT_OVERRIDE
|
---|
3066 | {
|
---|
3067 | setName(QApplication::translate("UIActionPool", "&Create..."));
|
---|
3068 | setShortcutScope(QApplication::translate("UIActionPool", "Medium Selector"));
|
---|
3069 | setStatusTip(QApplication::translate("UIActionPool", "Create a new disk image file"));
|
---|
3070 | setToolTip( QApplication::translate("UIActionPool", "Create Disk Image File")
|
---|
3071 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
3072 | }
|
---|
3073 | };
|
---|
3074 |
|
---|
3075 | /** Simple action extension, used as 'Create' action class. */
|
---|
3076 | class UIActionMenuMediumSelectorCreateCD : public UIActionSimple
|
---|
3077 | {
|
---|
3078 | Q_OBJECT;
|
---|
3079 |
|
---|
3080 | public:
|
---|
3081 |
|
---|
3082 | /** Constructs action passing @a pParent to the base-class. */
|
---|
3083 | UIActionMenuMediumSelectorCreateCD(UIActionPool *pParent)
|
---|
3084 | : UIActionSimple(pParent, ":/cd_create_32px.png", ":/cd_create_16px.png",
|
---|
3085 | ":/cd_create_disabled_32px.png", ":/cd_create_disabled_16px.png")
|
---|
3086 | {
|
---|
3087 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
3088 | }
|
---|
3089 |
|
---|
3090 | protected:
|
---|
3091 |
|
---|
3092 | /** Returns shortcut extra-data ID. */
|
---|
3093 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
3094 | {
|
---|
3095 | return QString("MediumSelectorCreateCD");
|
---|
3096 | }
|
---|
3097 |
|
---|
3098 | /** Handles translation event. */
|
---|
3099 | virtual void retranslateUi() RT_OVERRIDE
|
---|
3100 | {
|
---|
3101 | setName(QApplication::translate("UIActionPool", "&Create..."));
|
---|
3102 | setShortcutScope(QApplication::translate("UIActionPool", "Medium Selector"));
|
---|
3103 | setStatusTip(QApplication::translate("UIActionPool", "Create a new disk image file"));
|
---|
3104 | setToolTip( QApplication::translate("UIActionPool", "Create Disk Image File")
|
---|
3105 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
3106 | }
|
---|
3107 | };
|
---|
3108 |
|
---|
3109 | /** Simple action extension, used as 'Create' action class. */
|
---|
3110 | class UIActionMenuMediumSelectorCreateFD : public UIActionSimple
|
---|
3111 | {
|
---|
3112 | Q_OBJECT;
|
---|
3113 |
|
---|
3114 | public:
|
---|
3115 |
|
---|
3116 | /** Constructs action passing @a pParent to the base-class. */
|
---|
3117 | UIActionMenuMediumSelectorCreateFD(UIActionPool *pParent)
|
---|
3118 | : UIActionSimple(pParent, ":/fd_create_32px.png", ":/fd_create_16px.png",
|
---|
3119 | ":/fd_create_disabled_32px.png", ":/fd_create_disabled_16px.png")
|
---|
3120 | {
|
---|
3121 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
3122 | }
|
---|
3123 |
|
---|
3124 | protected:
|
---|
3125 |
|
---|
3126 | /** Returns shortcut extra-data ID. */
|
---|
3127 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
3128 | {
|
---|
3129 | return QString("MediumSelectorCreateFD");
|
---|
3130 | }
|
---|
3131 |
|
---|
3132 | /** Handles translation event. */
|
---|
3133 | virtual void retranslateUi() RT_OVERRIDE
|
---|
3134 | {
|
---|
3135 | setName(QApplication::translate("UIActionPool", "&Create..."));
|
---|
3136 | setShortcutScope(QApplication::translate("UIActionPool", "Medium Selector"));
|
---|
3137 | setStatusTip(QApplication::translate("UIActionPool", "Create a new disk image file"));
|
---|
3138 | setToolTip( QApplication::translate("UIActionPool", "Create Disk Image File")
|
---|
3139 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
3140 | }
|
---|
3141 | };
|
---|
3142 |
|
---|
3143 | /** Simple action extension, used as 'Create' action class. */
|
---|
3144 | class UIActionMenuMediumSelectorRefresh : public UIActionSimple
|
---|
3145 | {
|
---|
3146 | Q_OBJECT;
|
---|
3147 |
|
---|
3148 | public:
|
---|
3149 |
|
---|
3150 | /** Constructs action passing @a pParent to the base-class. */
|
---|
3151 | UIActionMenuMediumSelectorRefresh(UIActionPool *pParent)
|
---|
3152 | : UIActionSimple(pParent, ":/refresh_32px.png", ":/refresh_16px.png",
|
---|
3153 | ":/refresh_disabled_32px.png", ":/refresh_disabled_16px.png")
|
---|
3154 | {
|
---|
3155 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
3156 | }
|
---|
3157 |
|
---|
3158 | protected:
|
---|
3159 |
|
---|
3160 | /** Returns shortcut extra-data ID. */
|
---|
3161 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
3162 | {
|
---|
3163 | return QString("MediumSelectorRefresh");
|
---|
3164 | }
|
---|
3165 |
|
---|
3166 | /** Handles translation event. */
|
---|
3167 | virtual void retranslateUi() RT_OVERRIDE
|
---|
3168 | {
|
---|
3169 | setName(QApplication::translate("UIActionPool", "&Refresh..."));
|
---|
3170 | setShortcutScope(QApplication::translate("UIActionPool", "Medium Selector"));
|
---|
3171 | setStatusTip(QApplication::translate("UIActionPool", "Refresh disk images"));
|
---|
3172 | setToolTip( QApplication::translate("UIActionPool", "Refresh Disk Images")
|
---|
3173 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
3174 | }
|
---|
3175 | };
|
---|
3176 |
|
---|
3177 | /** Menu action extension, used as 'Activity' menu class. */
|
---|
3178 | class UIActionMenuSelectorActivity : public UIActionMenu
|
---|
3179 | {
|
---|
3180 | Q_OBJECT;
|
---|
3181 |
|
---|
3182 | public:
|
---|
3183 |
|
---|
3184 | /** Constructs action passing @a pParent to the base-class. */
|
---|
3185 | UIActionMenuSelectorActivity(UIActionPool *pParent)
|
---|
3186 | : UIActionMenu(pParent)
|
---|
3187 | {}
|
---|
3188 |
|
---|
3189 | protected:
|
---|
3190 |
|
---|
3191 | /** Returns shortcut extra-data ID. */
|
---|
3192 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
3193 | {
|
---|
3194 | return QString("VMActivityMonitorMenu");
|
---|
3195 | }
|
---|
3196 |
|
---|
3197 | /** Handles translation event. */
|
---|
3198 | virtual void retranslateUi() RT_OVERRIDE
|
---|
3199 | {
|
---|
3200 | setName(QApplication::translate("UIActionPool", "&Activity"));
|
---|
3201 | }
|
---|
3202 | };
|
---|
3203 |
|
---|
3204 | /** Simple action extension, used as 'Perform Export' action class. */
|
---|
3205 | class UIActionMenuSelectorActivityPerformExport : public UIActionSimple
|
---|
3206 | {
|
---|
3207 | Q_OBJECT;
|
---|
3208 |
|
---|
3209 | public:
|
---|
3210 |
|
---|
3211 | /** Constructs action passing @a pParent to the base-class. */
|
---|
3212 | UIActionMenuSelectorActivityPerformExport(UIActionPool *pParent)
|
---|
3213 | : UIActionSimple(pParent,
|
---|
3214 | ":/performance_monitor_export_32px.png", ":/performance_monitor_export_16px.png",
|
---|
3215 | ":/performance_monitor_export_disabled_32px.png", ":/performance_monitor_export_disabled_16px.png")
|
---|
3216 | {
|
---|
3217 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
3218 | }
|
---|
3219 |
|
---|
3220 | protected:
|
---|
3221 |
|
---|
3222 | /** Returns shortcut extra-data ID. */
|
---|
3223 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
3224 | {
|
---|
3225 | return QString("VMActivityMonitorExportCharts");
|
---|
3226 | }
|
---|
3227 |
|
---|
3228 | /** Handles translation event. */
|
---|
3229 | virtual void retranslateUi() RT_OVERRIDE
|
---|
3230 | {
|
---|
3231 | setName(QApplication::translate("UIActionPool", "&Export..."));
|
---|
3232 | setShortcutScope(QApplication::translate("UIActionPool", "VM Activity Monitor"));
|
---|
3233 | setStatusTip(QApplication::translate("UIActionPool", "Export the chart data into a text file"));
|
---|
3234 | setToolTip( QApplication::translate("UIActionPool", "Export Data to File")
|
---|
3235 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
3236 | }
|
---|
3237 | };
|
---|
3238 |
|
---|
3239 | /** Simple action extension, used as 'To VM Activity Overview' action class. */
|
---|
3240 | class UIActionMenuSelectorActivityToVMActivityOverview : public UIActionSimple
|
---|
3241 | {
|
---|
3242 | Q_OBJECT;
|
---|
3243 |
|
---|
3244 | public:
|
---|
3245 |
|
---|
3246 | /** Constructs action passing @a pParent to the base-class. */
|
---|
3247 | UIActionMenuSelectorActivityToVMActivityOverview(UIActionPool *pParent)
|
---|
3248 | : UIActionSimple(pParent,
|
---|
3249 | ":/resources_monitor_24px.png", ":/resource_monitor_16px.png",
|
---|
3250 | ":/resource_monitor_disabled_24px.png", ":/resource_monitor_disabled_16px.png")
|
---|
3251 | {
|
---|
3252 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
3253 | }
|
---|
3254 |
|
---|
3255 | protected:
|
---|
3256 |
|
---|
3257 | /** Returns shortcut extra-data ID. */
|
---|
3258 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
3259 | {
|
---|
3260 | return QString("ToVMActivityOverview");
|
---|
3261 | }
|
---|
3262 |
|
---|
3263 | /** Handles translation event. */
|
---|
3264 | virtual void retranslateUi() RT_OVERRIDE
|
---|
3265 | {
|
---|
3266 | setName(QApplication::translate("UIActionPool", "&Activity Overview..."));
|
---|
3267 | setShortcutScope(QApplication::translate("UIActionPool", "Activity Monitor"));
|
---|
3268 | setStatusTip(QApplication::translate("UIActionPool", "Navigate to the vm activity overview"));
|
---|
3269 | setToolTip( QApplication::translate("UIActionPool", "Navigate to VM Activity Overview")
|
---|
3270 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
3271 | }
|
---|
3272 | };
|
---|
3273 |
|
---|
3274 | /** Simple action extension, used as 'Toggle Pane Preferences' action class. */
|
---|
3275 | class UIActionMenuActivityPreferences : public UIActionToggle
|
---|
3276 | {
|
---|
3277 | Q_OBJECT;
|
---|
3278 |
|
---|
3279 | public:
|
---|
3280 |
|
---|
3281 | /** Constructs action passing @a pParent to the base-class. */
|
---|
3282 | UIActionMenuActivityPreferences(UIActionPool *pParent)
|
---|
3283 | : UIActionToggle(pParent)
|
---|
3284 | {
|
---|
3285 | setShortcutContext(Qt::WidgetWithChildrenShortcut);
|
---|
3286 | setIcon(UIIconPool::iconSetFull(":/performance_monitor_preferences_32px.png", ":/performance_monitor_preferences_16px.png",
|
---|
3287 | ":/performance_monitor_preferences_disabled_32px.png", ":/performance_monitor_preferences_disabled_16px.png"));
|
---|
3288 | }
|
---|
3289 |
|
---|
3290 | protected:
|
---|
3291 |
|
---|
3292 | /** Returns shortcut extra-data ID. */
|
---|
3293 | virtual QString shortcutExtraDataID() const RT_OVERRIDE
|
---|
3294 | {
|
---|
3295 | return QString("ToggleActivityMonitorPreferences");
|
---|
3296 | }
|
---|
3297 |
|
---|
3298 | /** Returns default shortcut. */
|
---|
3299 | virtual QKeySequence defaultShortcut(UIType) const RT_OVERRIDE
|
---|
3300 | {
|
---|
3301 | return QKeySequence("");
|
---|
3302 | }
|
---|
3303 |
|
---|
3304 | /** Handles translation event. */
|
---|
3305 | virtual void retranslateUi() RT_OVERRIDE
|
---|
3306 | {
|
---|
3307 | setName(QApplication::translate("UIActionPool", "&Preferences"));
|
---|
3308 | setShortcutScope(QApplication::translate("UIActionPool", "Activity Monitor"));
|
---|
3309 | setStatusTip(QApplication::translate("UIActionPool", "Open pane with activity monitor preferences"));
|
---|
3310 | setToolTip( QApplication::translate("UIActionPool", "Open Preferences Pane")
|
---|
3311 | + (shortcut().isEmpty() ? QString() : QString(" (%1)").arg(shortcut().toString())));
|
---|
3312 | }
|
---|
3313 | };
|
---|
3314 |
|
---|
3315 |
|
---|
3316 | /*********************************************************************************************************************************
|
---|
3317 | * Class UIActionPool implementation. *
|
---|
3318 | *********************************************************************************************************************************/
|
---|
3319 |
|
---|
3320 | /* static */
|
---|
3321 | UIActionPool *UIActionPool::create(UIType enmType)
|
---|
3322 | {
|
---|
3323 | UIActionPool *pActionPool = 0;
|
---|
3324 | switch (enmType)
|
---|
3325 | {
|
---|
3326 | case UIType_ManagerUI: pActionPool = new UIActionPoolManager; break;
|
---|
3327 | case UIType_RuntimeUI: pActionPool = new UIActionPoolRuntime; break;
|
---|
3328 | default: AssertFailedReturn(0);
|
---|
3329 | }
|
---|
3330 | AssertPtrReturn(pActionPool, 0);
|
---|
3331 | pActionPool->prepare();
|
---|
3332 | return pActionPool;
|
---|
3333 | }
|
---|
3334 |
|
---|
3335 | /* static */
|
---|
3336 | void UIActionPool::destroy(UIActionPool *pActionPool)
|
---|
3337 | {
|
---|
3338 | AssertPtrReturnVoid(pActionPool);
|
---|
3339 | pActionPool->cleanup();
|
---|
3340 | delete pActionPool;
|
---|
3341 | }
|
---|
3342 |
|
---|
3343 | /* static */
|
---|
3344 | void UIActionPool::createTemporary(UIType enmType)
|
---|
3345 | {
|
---|
3346 | UIActionPool *pActionPool = 0;
|
---|
3347 | switch (enmType)
|
---|
3348 | {
|
---|
3349 | case UIType_ManagerUI: pActionPool = new UIActionPoolManager(true); break;
|
---|
3350 | case UIType_RuntimeUI: pActionPool = new UIActionPoolRuntime(true); break;
|
---|
3351 | default: AssertFailedReturnVoid();
|
---|
3352 | }
|
---|
3353 | AssertPtrReturnVoid(pActionPool);
|
---|
3354 | pActionPool->prepare();
|
---|
3355 | pActionPool->cleanup();
|
---|
3356 | delete pActionPool;
|
---|
3357 | }
|
---|
3358 |
|
---|
3359 | UIActionPoolManager *UIActionPool::toManager()
|
---|
3360 | {
|
---|
3361 | return qobject_cast<UIActionPoolManager*>(this);
|
---|
3362 | }
|
---|
3363 |
|
---|
3364 | UIActionPoolRuntime *UIActionPool::toRuntime()
|
---|
3365 | {
|
---|
3366 | return qobject_cast<UIActionPoolRuntime*>(this);
|
---|
3367 | }
|
---|
3368 |
|
---|
3369 | UIAction *UIActionPool::action(int iIndex) const
|
---|
3370 | {
|
---|
3371 | AssertReturn(m_pool.contains(iIndex), 0);
|
---|
3372 | return m_pool.value(iIndex);
|
---|
3373 | }
|
---|
3374 |
|
---|
3375 | QList<UIAction*> UIActionPool::actions() const
|
---|
3376 | {
|
---|
3377 | return m_pool.values();
|
---|
3378 | }
|
---|
3379 |
|
---|
3380 | QActionGroup *UIActionPool::actionGroup(int iIndex) const
|
---|
3381 | {
|
---|
3382 | AssertReturn(m_groupPool.contains(iIndex), 0);
|
---|
3383 | return m_groupPool.value(iIndex);
|
---|
3384 | }
|
---|
3385 |
|
---|
3386 | bool UIActionPool::isAllowedInMenuBar(UIExtraDataMetaDefs::MenuType enmType) const
|
---|
3387 | {
|
---|
3388 | foreach (const UIExtraDataMetaDefs::MenuType &enmRestriction, m_restrictedMenus.values())
|
---|
3389 | if (enmRestriction & enmType)
|
---|
3390 | return false;
|
---|
3391 | return true;
|
---|
3392 | }
|
---|
3393 |
|
---|
3394 | void UIActionPool::setRestrictionForMenuBar(UIActionRestrictionLevel enmLevel, UIExtraDataMetaDefs::MenuType enmRestriction)
|
---|
3395 | {
|
---|
3396 | m_restrictedMenus[enmLevel] = enmRestriction;
|
---|
3397 | updateMenus();
|
---|
3398 | }
|
---|
3399 |
|
---|
3400 | bool UIActionPool::isAllowedInMenuApplication(UIExtraDataMetaDefs::MenuApplicationActionType enmType) const
|
---|
3401 | {
|
---|
3402 | foreach (const UIExtraDataMetaDefs::MenuApplicationActionType &enmRestriction, m_restrictedActionsMenuApplication.values())
|
---|
3403 | if (enmRestriction & enmType)
|
---|
3404 | return false;
|
---|
3405 | return true;
|
---|
3406 | }
|
---|
3407 |
|
---|
3408 | void UIActionPool::setRestrictionForMenuApplication(UIActionRestrictionLevel enmLevel, UIExtraDataMetaDefs::MenuApplicationActionType enmRestriction)
|
---|
3409 | {
|
---|
3410 | m_restrictedActionsMenuApplication[enmLevel] = enmRestriction;
|
---|
3411 | m_invalidations << UIActionIndex_M_Application;
|
---|
3412 | }
|
---|
3413 |
|
---|
3414 | #ifdef VBOX_WS_MAC
|
---|
3415 | bool UIActionPool::isAllowedInMenuWindow(UIExtraDataMetaDefs::MenuWindowActionType enmType) const
|
---|
3416 | {
|
---|
3417 | foreach (const UIExtraDataMetaDefs::MenuWindowActionType &enmRestriction, m_restrictedActionsMenuWindow.values())
|
---|
3418 | if (enmRestriction & enmType)
|
---|
3419 | return false;
|
---|
3420 | return true;
|
---|
3421 | }
|
---|
3422 |
|
---|
3423 | void UIActionPool::setRestrictionForMenuWindow(UIActionRestrictionLevel enmLevel, UIExtraDataMetaDefs::MenuWindowActionType enmRestriction)
|
---|
3424 | {
|
---|
3425 | m_restrictedActionsMenuWindow[enmLevel] = enmRestriction;
|
---|
3426 | m_invalidations << UIActionIndex_M_Window;
|
---|
3427 | }
|
---|
3428 | #endif /* VBOX_WS_MAC */
|
---|
3429 |
|
---|
3430 | bool UIActionPool::isAllowedInMenuHelp(UIExtraDataMetaDefs::MenuHelpActionType enmType) const
|
---|
3431 | {
|
---|
3432 | foreach (const UIExtraDataMetaDefs::MenuHelpActionType &enmRestriction, m_restrictedActionsMenuHelp.values())
|
---|
3433 | if (enmRestriction & enmType)
|
---|
3434 | return false;
|
---|
3435 | return true;
|
---|
3436 | }
|
---|
3437 |
|
---|
3438 | void UIActionPool::setRestrictionForMenuHelp(UIActionRestrictionLevel enmLevel, UIExtraDataMetaDefs::MenuHelpActionType enmRestriction)
|
---|
3439 | {
|
---|
3440 | m_restrictedActionsMenuHelp[enmLevel] = enmRestriction;
|
---|
3441 | m_invalidations << UIActionIndex_Menu_Help;
|
---|
3442 | }
|
---|
3443 |
|
---|
3444 | bool UIActionPool::processHotKey(const QKeySequence &key)
|
---|
3445 | {
|
---|
3446 | /* Iterate through the whole list of keys: */
|
---|
3447 | foreach (const int &iKey, m_pool.keys())
|
---|
3448 | {
|
---|
3449 | /* Get current action: */
|
---|
3450 | UIAction *pAction = m_pool.value(iKey);
|
---|
3451 | /* Skip menus/separators: */
|
---|
3452 | if (pAction->type() == UIActionType_Menu)
|
---|
3453 | continue;
|
---|
3454 | /* Get the hot-key of the current action: */
|
---|
3455 | const QString strHotKey = gShortcutPool->shortcut(this, pAction).primaryToPortableText();
|
---|
3456 | if (pAction->isEnabled() && pAction->isAllowed() && !strHotKey.isEmpty())
|
---|
3457 | {
|
---|
3458 | if (key.matches(QKeySequence(strHotKey)) == QKeySequence::ExactMatch)
|
---|
3459 | {
|
---|
3460 | /* We asynchronously post a special event instead of calling
|
---|
3461 | * pAction->trigger() directly, to let key presses and
|
---|
3462 | * releases be processed correctly by Qt first.
|
---|
3463 | * Note: we assume that nobody will delete the menu item
|
---|
3464 | * corresponding to the key sequence, so that the pointer to
|
---|
3465 | * menu data posted along with the event will remain valid in
|
---|
3466 | * the event handler, at least until the main window is closed. */
|
---|
3467 | QApplication::postEvent(this, new ActivateActionEvent(pAction));
|
---|
3468 | return true;
|
---|
3469 | }
|
---|
3470 | }
|
---|
3471 | }
|
---|
3472 | return false;
|
---|
3473 | }
|
---|
3474 |
|
---|
3475 | void UIActionPool::sltHandleMenuPrepare()
|
---|
3476 | {
|
---|
3477 | /* Make sure menu is valid: */
|
---|
3478 | AssertPtrReturnVoid(sender());
|
---|
3479 | UIMenu *pMenu = qobject_cast<UIMenu*>(sender());
|
---|
3480 | AssertPtrReturnVoid(pMenu);
|
---|
3481 | /* Make sure action is valid: */
|
---|
3482 | AssertPtrReturnVoid(pMenu->menuAction());
|
---|
3483 | UIAction *pAction = qobject_cast<UIAction*>(pMenu->menuAction());
|
---|
3484 | AssertPtrReturnVoid(pAction);
|
---|
3485 |
|
---|
3486 | /* Determine action index: */
|
---|
3487 | const int iIndex = m_pool.key(pAction);
|
---|
3488 |
|
---|
3489 | /* Update menu if necessary: */
|
---|
3490 | updateMenu(iIndex);
|
---|
3491 |
|
---|
3492 | /* Notify listeners about menu prepared: */
|
---|
3493 | emit sigNotifyAboutMenuPrepare(iIndex, pMenu);
|
---|
3494 | }
|
---|
3495 |
|
---|
3496 | #ifdef VBOX_WS_MAC
|
---|
3497 | void UIActionPool::sltActionHovered()
|
---|
3498 | {
|
---|
3499 | /* Acquire sender action: */
|
---|
3500 | UIAction *pAction = qobject_cast<UIAction*>(sender());
|
---|
3501 | AssertPtrReturnVoid(pAction);
|
---|
3502 | //printf("Action hovered: {%s}\n", pAction->name().toUtf8().constData());
|
---|
3503 |
|
---|
3504 | /* Notify listener about action hevering: */
|
---|
3505 | emit sigActionHovered(pAction);
|
---|
3506 | }
|
---|
3507 | #endif /* VBOX_WS_MAC */
|
---|
3508 |
|
---|
3509 | UIActionPool::UIActionPool(UIType enmType, bool fTemporary /* = false */)
|
---|
3510 | : m_enmType(enmType)
|
---|
3511 | , m_fTemporary(fTemporary)
|
---|
3512 | {
|
---|
3513 | }
|
---|
3514 |
|
---|
3515 | void UIActionPool::preparePool()
|
---|
3516 | {
|
---|
3517 | /* Create 'Application' actions: */
|
---|
3518 | m_pool[UIActionIndex_M_Application] = new UIActionMenuApplication(this);
|
---|
3519 | #ifdef VBOX_WS_MAC
|
---|
3520 | m_pool[UIActionIndex_M_Application_S_About] = new UIActionSimpleAbout(this);
|
---|
3521 | #endif
|
---|
3522 | m_pool[UIActionIndex_M_Application_S_Preferences] = new UIActionSimplePreferences(this);
|
---|
3523 | #ifdef VBOX_GUI_WITH_NETWORK_MANAGER
|
---|
3524 | m_pool[UIActionIndex_M_Application_S_CheckForUpdates] = new UIActionSimpleCheckForUpdates(this);
|
---|
3525 | #endif
|
---|
3526 | m_pool[UIActionIndex_M_Application_S_ResetWarnings] = new UIActionSimpleResetWarnings(this);
|
---|
3527 | m_pool[UIActionIndex_M_Application_S_Close] = new UIActionSimplePerformClose(this);
|
---|
3528 |
|
---|
3529 | #ifdef VBOX_WS_MAC
|
---|
3530 | /* Create 'Window' actions: */
|
---|
3531 | m_pool[UIActionIndex_M_Window] = new UIActionMenuWindow(this);
|
---|
3532 | m_pool[UIActionIndex_M_Window_S_Minimize] = new UIActionSimpleMinimize(this);
|
---|
3533 | #endif
|
---|
3534 |
|
---|
3535 | /* Create 'Help' actions: */
|
---|
3536 | m_pool[UIActionIndex_Menu_Help] = new UIActionMenuHelp(this);
|
---|
3537 | m_pool[UIActionIndex_Simple_Contents] = new UIActionSimpleContents(this);
|
---|
3538 | m_pool[UIActionIndex_Simple_OnlineDocumentation] = new UIActionSimpleOnlineDocumentation(this);
|
---|
3539 | m_pool[UIActionIndex_Simple_WebSite] = new UIActionSimpleWebSite(this);
|
---|
3540 | m_pool[UIActionIndex_Simple_BugTracker] = new UIActionSimpleBugTracker(this);
|
---|
3541 | m_pool[UIActionIndex_Simple_Forums] = new UIActionSimpleForums(this);
|
---|
3542 | m_pool[UIActionIndex_Simple_Oracle] = new UIActionSimpleOracle(this);
|
---|
3543 | #ifndef VBOX_WS_MAC
|
---|
3544 | m_pool[UIActionIndex_Simple_About] = new UIActionSimpleAbout(this);
|
---|
3545 | #endif
|
---|
3546 |
|
---|
3547 | /* Create 'Log Viewer' actions: */
|
---|
3548 | m_pool[UIActionIndex_M_LogWindow] = new UIActionMenuSelectorLog(this);
|
---|
3549 | m_pool[UIActionIndex_M_Log] = new UIActionMenuSelectorLog(this);
|
---|
3550 | m_pool[UIActionIndex_M_Log_T_Find] = new UIActionMenuSelectorLogTogglePaneFind(this);
|
---|
3551 | m_pool[UIActionIndex_M_Log_T_Filter] = new UIActionMenuSelectorLogTogglePaneFilter(this);
|
---|
3552 | m_pool[UIActionIndex_M_Log_T_Bookmark] = new UIActionMenuSelectorLogTogglePaneBookmark(this);
|
---|
3553 | m_pool[UIActionIndex_M_Log_T_Preferences] = new UIActionMenuSelectorLogTogglePanePreferences(this);
|
---|
3554 | m_pool[UIActionIndex_M_Log_S_Refresh] = new UIActionMenuSelectorLogPerformRefresh(this);
|
---|
3555 | m_pool[UIActionIndex_M_Log_S_Reload] = new UIActionMenuSelectorLogPerformReload(this);
|
---|
3556 | m_pool[UIActionIndex_M_Log_S_Save] = new UIActionMenuSelectorLogPerformSave(this);
|
---|
3557 |
|
---|
3558 | /* Create 'Performance Monitor' actions: */
|
---|
3559 | m_pool[UIActionIndex_M_Activity] = new UIActionMenuSelectorActivity(this);
|
---|
3560 | m_pool[UIActionIndex_M_Activity_S_Export] = new UIActionMenuSelectorActivityPerformExport(this);
|
---|
3561 | m_pool[UIActionIndex_M_Activity_S_ToVMActivityOverview] = new UIActionMenuSelectorActivityToVMActivityOverview(this);
|
---|
3562 | m_pool[UIActionIndex_M_Activity_T_Preferences] = new UIActionMenuActivityPreferences(this);
|
---|
3563 |
|
---|
3564 | /* Create 'File Manager' actions: */
|
---|
3565 | m_pool[UIActionIndex_M_FileManager] = new UIActionMenuFileManager(this);
|
---|
3566 | m_pool[UIActionIndex_M_FileManager_M_HostSubmenu] = new UIActionMenuFileManagerHostSubmenu(this);
|
---|
3567 | m_pool[UIActionIndex_M_FileManager_M_GuestSubmenu] = new UIActionMenuFileManagerGuestSubmenu(this);
|
---|
3568 | m_pool[UIActionIndex_M_FileManager_S_CopyToGuest] = new UIActionMenuFileManagerCopyToGuest(this);
|
---|
3569 | m_pool[UIActionIndex_M_FileManager_S_CopyToHost] = new UIActionMenuFileManagerCopyToHost(this);
|
---|
3570 | m_pool[UIActionIndex_M_FileManager_T_Preferences] = new UIActionMenuFileManagerPreferences(this);
|
---|
3571 | m_pool[UIActionIndex_M_FileManager_T_Log] = new UIActionMenuFileManagerLog(this);
|
---|
3572 | m_pool[UIActionIndex_M_FileManager_T_Operations] = new UIActionMenuFileManagerOperations(this);
|
---|
3573 | m_pool[UIActionIndex_M_FileManager_T_GuestSession] = new UIActionMenuFileManagerGuestSession(this);
|
---|
3574 | m_pool[UIActionIndex_M_FileManager_S_Host_GoUp] = new UIActionMenuFileManagerGoUp(this);
|
---|
3575 | m_pool[UIActionIndex_M_FileManager_S_Guest_GoUp] = new UIActionMenuFileManagerGoUp(this);
|
---|
3576 | m_pool[UIActionIndex_M_FileManager_S_Host_GoHome] = new UIActionMenuFileManagerGoHome(this);
|
---|
3577 | m_pool[UIActionIndex_M_FileManager_S_Guest_GoHome] = new UIActionMenuFileManagerGoHome(this);
|
---|
3578 | m_pool[UIActionIndex_M_FileManager_S_Host_GoForward] = new UIActionMenuFileManagerGoForward(this);
|
---|
3579 | m_pool[UIActionIndex_M_FileManager_S_Guest_GoForward] = new UIActionMenuFileManagerGoForward(this);
|
---|
3580 | m_pool[UIActionIndex_M_FileManager_S_Host_GoBackward] = new UIActionMenuFileManagerGoBackward(this);
|
---|
3581 | m_pool[UIActionIndex_M_FileManager_S_Guest_GoBackward] = new UIActionMenuFileManagerGoBackward(this);
|
---|
3582 | m_pool[UIActionIndex_M_FileManager_S_Host_Refresh] = new UIActionMenuFileManagerRefresh(this);
|
---|
3583 | m_pool[UIActionIndex_M_FileManager_S_Guest_Refresh] = new UIActionMenuFileManagerRefresh(this);
|
---|
3584 | m_pool[UIActionIndex_M_FileManager_S_Host_Delete] = new UIActionMenuFileManagerDelete(this);
|
---|
3585 | m_pool[UIActionIndex_M_FileManager_S_Guest_Delete] = new UIActionMenuFileManagerDelete(this);
|
---|
3586 | m_pool[UIActionIndex_M_FileManager_S_Host_Rename] = new UIActionMenuFileManagerRename(this);
|
---|
3587 | m_pool[UIActionIndex_M_FileManager_S_Guest_Rename] = new UIActionMenuFileManagerRename(this);
|
---|
3588 | m_pool[UIActionIndex_M_FileManager_S_Host_CreateNewDirectory] = new UIActionMenuFileManagerCreateNewDirectory(this);
|
---|
3589 | m_pool[UIActionIndex_M_FileManager_S_Guest_CreateNewDirectory] = new UIActionMenuFileManagerCreateNewDirectory(this);
|
---|
3590 | m_pool[UIActionIndex_M_FileManager_S_Host_Copy] = new UIActionMenuFileManagerCopy(this);
|
---|
3591 | m_pool[UIActionIndex_M_FileManager_S_Guest_Copy] = new UIActionMenuFileManagerCopy(this);
|
---|
3592 | m_pool[UIActionIndex_M_FileManager_S_Host_Cut] = new UIActionMenuFileManagerCut(this);
|
---|
3593 | m_pool[UIActionIndex_M_FileManager_S_Guest_Cut] = new UIActionMenuFileManagerCut(this);
|
---|
3594 | m_pool[UIActionIndex_M_FileManager_S_Host_Paste] = new UIActionMenuFileManagerPaste(this);
|
---|
3595 | m_pool[UIActionIndex_M_FileManager_S_Guest_Paste] = new UIActionMenuFileManagerPaste(this);
|
---|
3596 | m_pool[UIActionIndex_M_FileManager_S_Host_SelectAll] = new UIActionMenuFileManagerSelectAll(this);
|
---|
3597 | m_pool[UIActionIndex_M_FileManager_S_Guest_SelectAll] = new UIActionMenuFileManagerSelectAll(this);
|
---|
3598 | m_pool[UIActionIndex_M_FileManager_S_Host_InvertSelection] = new UIActionMenuFileManagerInvertSelection(this);
|
---|
3599 | m_pool[UIActionIndex_M_FileManager_S_Guest_InvertSelection] = new UIActionMenuFileManagerInvertSelection(this);
|
---|
3600 | m_pool[UIActionIndex_M_FileManager_S_Host_ShowProperties] = new UIActionMenuFileManagerShowProperties(this);
|
---|
3601 | m_pool[UIActionIndex_M_FileManager_S_Guest_ShowProperties] = new UIActionMenuFileManagerShowProperties(this);
|
---|
3602 |
|
---|
3603 | /* Create VISO Creator actions: */
|
---|
3604 | m_pool[UIActionIndex_M_VISOCreator] = new UIActionMenuVISOCreator(this);
|
---|
3605 | m_pool[UIActionIndex_M_VISOCreator_ToggleSettingsDialog] = new UIActionMenuVISOCreatorToggleSettingsDialog(this);
|
---|
3606 | m_pool[UIActionIndex_M_VISOCreator_Add] = new UIActionMenuVISOCreatorAdd(this);
|
---|
3607 | m_pool[UIActionIndex_M_VISOCreator_Remove] = new UIActionMenuVISOCreatorRemove(this);
|
---|
3608 | m_pool[UIActionIndex_M_VISOCreator_Restore] = new UIActionMenuVISOCreatorRestore(this);
|
---|
3609 | m_pool[UIActionIndex_M_VISOCreator_CreateNewDirectory] = new UIActionMenuVISOCreatorCreateNewDirectory(this);
|
---|
3610 | m_pool[UIActionIndex_M_VISOCreator_Rename] = new UIActionMenuVISOCreatorRename(this);
|
---|
3611 | m_pool[UIActionIndex_M_VISOCreator_Reset] = new UIActionMenuVISOCreatorReset(this);
|
---|
3612 | m_pool[UIActionIndex_M_VISOCreator_Open] = new UIActionMenuVISOCreatorOpen(this);
|
---|
3613 | m_pool[UIActionIndex_M_VISOCreator_SaveAs] = new UIActionMenuVISOCreatorSaveAs(this);
|
---|
3614 | m_pool[UIActionIndex_M_VISOCreator_ImportISO] = new UIActionMenuVISOCreatorImportISO(this);
|
---|
3615 | m_pool[UIActionIndex_M_VISOCreator_RemoveISO] = new UIActionMenuVISOCreatorRemoveISO(this);
|
---|
3616 |
|
---|
3617 | m_pool[UIActionIndex_M_VISOCreator_VisoContent_GoHome] = new UIActionMenuVISOCreatorGoHome(this);
|
---|
3618 | m_pool[UIActionIndex_M_VISOCreator_VisoContent_GoUp] = new UIActionMenuVISOCreatorGoUp(this);
|
---|
3619 | m_pool[UIActionIndex_M_VISOCreator_VisoContent_GoForward] = new UIActionMenuVISOCreatorGoForward(this);
|
---|
3620 | m_pool[UIActionIndex_M_VISOCreator_VisoContent_GoBackward] = new UIActionMenuVISOCreatorGoBackward(this);
|
---|
3621 | m_pool[UIActionIndex_M_VISOCreator_Host_GoHome] = new UIActionMenuVISOCreatorGoHome(this);
|
---|
3622 | m_pool[UIActionIndex_M_VISOCreator_Host_GoUp] = new UIActionMenuVISOCreatorGoUp(this);
|
---|
3623 | m_pool[UIActionIndex_M_VISOCreator_Host_GoForward] = new UIActionMenuVISOCreatorGoForward(this);
|
---|
3624 | m_pool[UIActionIndex_M_VISOCreator_Host_GoBackward] = new UIActionMenuVISOCreatorGoBackward(this);
|
---|
3625 |
|
---|
3626 |
|
---|
3627 | /* Medium Selector actions: */
|
---|
3628 | m_pool[UIActionIndex_M_MediumSelector] = new UIActionMenuMediumSelector(this);
|
---|
3629 | m_pool[UIActionIndex_M_MediumSelector_AddHD] = new UIActionMenuMediumSelectorAddHD(this);
|
---|
3630 | m_pool[UIActionIndex_M_MediumSelector_AddCD] = new UIActionMenuMediumSelectorAddCD(this);
|
---|
3631 | m_pool[UIActionIndex_M_MediumSelector_AddFD] = new UIActionMenuMediumSelectorAddFD(this);
|
---|
3632 | m_pool[UIActionIndex_M_MediumSelector_CreateHD] = new UIActionMenuMediumSelectorCreateHD(this);
|
---|
3633 | m_pool[UIActionIndex_M_MediumSelector_CreateCD] = new UIActionMenuMediumSelectorCreateCD(this);
|
---|
3634 | m_pool[UIActionIndex_M_MediumSelector_CreateFD] = new UIActionMenuMediumSelectorCreateFD(this);
|
---|
3635 | m_pool[UIActionIndex_M_MediumSelector_Refresh] = new UIActionMenuMediumSelectorRefresh(this);
|
---|
3636 |
|
---|
3637 | /* Prepare update-handlers for known menus: */
|
---|
3638 | #ifdef VBOX_WS_MAC
|
---|
3639 | m_menuUpdateHandlers[UIActionIndex_M_Application].ptf = &UIActionPool::updateMenuApplication;
|
---|
3640 | m_menuUpdateHandlers[UIActionIndex_M_Window].ptf = &UIActionPool::updateMenuWindow;
|
---|
3641 | #endif
|
---|
3642 | m_menuUpdateHandlers[UIActionIndex_Menu_Help].ptf = &UIActionPool::updateMenuHelp;
|
---|
3643 | m_menuUpdateHandlers[UIActionIndex_M_LogWindow].ptf = &UIActionPool::updateMenuLogViewerWindow;
|
---|
3644 | m_menuUpdateHandlers[UIActionIndex_M_Log].ptf = &UIActionPool::updateMenuLogViewer;
|
---|
3645 | m_menuUpdateHandlers[UIActionIndex_M_Activity].ptf = &UIActionPool::updateMenuVMActivityMonitor;
|
---|
3646 | m_menuUpdateHandlers[UIActionIndex_M_FileManager].ptf = &UIActionPool::updateMenuFileManager;
|
---|
3647 |
|
---|
3648 | /* Invalidate all known menus: */
|
---|
3649 | #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
---|
3650 | QList<int> const updateHandlerKeys = m_menuUpdateHandlers.keys();
|
---|
3651 | m_invalidations.unite(QSet<int>(updateHandlerKeys.begin(), updateHandlerKeys.end()));
|
---|
3652 | #else
|
---|
3653 | m_invalidations.unite(m_menuUpdateHandlers.keys().toSet());
|
---|
3654 | #endif
|
---|
3655 |
|
---|
3656 | /* Apply language settings: */
|
---|
3657 | sltRetranslateUI();
|
---|
3658 | connect(&translationEventListener(), &UITranslationEventListener::sigRetranslateUI,
|
---|
3659 | this, &UIActionPool::sltRetranslateUI);
|
---|
3660 | }
|
---|
3661 |
|
---|
3662 | void UIActionPool::prepareConnections()
|
---|
3663 | {
|
---|
3664 | /* 'Application' menu connections: */
|
---|
3665 | #ifdef VBOX_WS_MAC
|
---|
3666 | connect(action(UIActionIndex_M_Application_S_About), &UIAction::triggered,
|
---|
3667 | &msgCenter(), &UIMessageCenter::sltShowHelpAboutDialog, Qt::UniqueConnection);
|
---|
3668 | #endif
|
---|
3669 | #ifdef VBOX_GUI_WITH_NETWORK_MANAGER
|
---|
3670 | connect(action(UIActionIndex_M_Application_S_CheckForUpdates), &UIAction::triggered,
|
---|
3671 | gUpdateManager, &UIUpdateManager::sltForceCheck, Qt::UniqueConnection);
|
---|
3672 | #endif
|
---|
3673 | connect(action(UIActionIndex_M_Application_S_ResetWarnings), &UIAction::triggered,
|
---|
3674 | &msgCenter(), &UIMessageCenter::sltResetSuppressedMessages, Qt::UniqueConnection);
|
---|
3675 |
|
---|
3676 | /* 'Help' menu connections. Note that connections for UIActionIndex_Simple_Contents
|
---|
3677 | * are done in manager and runtime UIs separately in their respective classes: */
|
---|
3678 | connect(action(UIActionIndex_Simple_OnlineDocumentation), &UIAction::triggered,
|
---|
3679 | &msgCenter(), &UIMessageCenter::sltShowOnlineDocumentation, Qt::UniqueConnection);
|
---|
3680 | connect(action(UIActionIndex_Simple_WebSite), &UIAction::triggered,
|
---|
3681 | &msgCenter(), &UIMessageCenter::sltShowHelpWebDialog, Qt::UniqueConnection);
|
---|
3682 | connect(action(UIActionIndex_Simple_BugTracker), &UIAction::triggered,
|
---|
3683 | &msgCenter(), &UIMessageCenter::sltShowBugTracker, Qt::UniqueConnection);
|
---|
3684 | connect(action(UIActionIndex_Simple_Forums), &UIAction::triggered,
|
---|
3685 | &msgCenter(), &UIMessageCenter::sltShowForums, Qt::UniqueConnection);
|
---|
3686 | connect(action(UIActionIndex_Simple_Oracle), &UIAction::triggered,
|
---|
3687 | &msgCenter(), &UIMessageCenter::sltShowOracle, Qt::UniqueConnection);
|
---|
3688 | #ifndef VBOX_WS_MAC
|
---|
3689 | connect(action(UIActionIndex_Simple_About), &UIAction::triggered,
|
---|
3690 | &msgCenter(), &UIMessageCenter::sltShowHelpAboutDialog, Qt::UniqueConnection);
|
---|
3691 | #endif
|
---|
3692 | }
|
---|
3693 |
|
---|
3694 | void UIActionPool::cleanupConnections()
|
---|
3695 | {
|
---|
3696 | /* Nothing for now.. */
|
---|
3697 | }
|
---|
3698 |
|
---|
3699 | void UIActionPool::cleanupPool()
|
---|
3700 | {
|
---|
3701 | qDeleteAll(m_groupPool);
|
---|
3702 | qDeleteAll(m_pool);
|
---|
3703 | }
|
---|
3704 |
|
---|
3705 | void UIActionPool::updateConfiguration()
|
---|
3706 | {
|
---|
3707 | /* Recache common action restrictions: */
|
---|
3708 | // Nothing here for now..
|
---|
3709 |
|
---|
3710 | #ifdef VBOX_GUI_WITH_NETWORK_MANAGER
|
---|
3711 | /* Recache update action restrictions: */
|
---|
3712 | bool fUpdateAllowed = gEDataManager->applicationUpdateEnabled();
|
---|
3713 | if (!fUpdateAllowed)
|
---|
3714 | {
|
---|
3715 | m_restrictedActionsMenuApplication[UIActionRestrictionLevel_Base] = (UIExtraDataMetaDefs::MenuApplicationActionType)
|
---|
3716 | (m_restrictedActionsMenuApplication[UIActionRestrictionLevel_Base] | UIExtraDataMetaDefs::MenuApplicationActionType_CheckForUpdates);
|
---|
3717 | }
|
---|
3718 | #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
|
---|
3719 |
|
---|
3720 | /* Update menus: */
|
---|
3721 | updateMenus();
|
---|
3722 | }
|
---|
3723 |
|
---|
3724 | void UIActionPool::updateMenu(int iIndex)
|
---|
3725 | {
|
---|
3726 | /* Make sure index belongs to this class: */
|
---|
3727 | AssertReturnVoid(iIndex < UIActionIndex_Max);
|
---|
3728 |
|
---|
3729 | /* If menu with such index is invalidated
|
---|
3730 | * and there is update-handler => handle it here: */
|
---|
3731 | if ( m_invalidations.contains(iIndex)
|
---|
3732 | && m_menuUpdateHandlers.contains(iIndex))
|
---|
3733 | (this->*(m_menuUpdateHandlers.value(iIndex).ptf))();
|
---|
3734 | }
|
---|
3735 |
|
---|
3736 | void UIActionPool::updateShortcuts()
|
---|
3737 | {
|
---|
3738 | gShortcutPool->applyShortcuts(this);
|
---|
3739 | }
|
---|
3740 |
|
---|
3741 | bool UIActionPool::event(QEvent *pEvent)
|
---|
3742 | {
|
---|
3743 | /* Depending on event-type: */
|
---|
3744 | switch ((UIEventTypeActionPool)pEvent->type())
|
---|
3745 | {
|
---|
3746 | case UIEventTypeActionPool_ActivateAction:
|
---|
3747 | {
|
---|
3748 | /* Process specific event: */
|
---|
3749 | ActivateActionEvent *pActionEvent = static_cast<ActivateActionEvent*>(pEvent);
|
---|
3750 | pActionEvent->action()->trigger();
|
---|
3751 | pEvent->accept();
|
---|
3752 | return true;
|
---|
3753 | }
|
---|
3754 | default:
|
---|
3755 | break;
|
---|
3756 | }
|
---|
3757 | /* Pass to the base-class: */
|
---|
3758 | return QObject::event(pEvent);
|
---|
3759 | }
|
---|
3760 |
|
---|
3761 | void UIActionPool::sltRetranslateUI()
|
---|
3762 | {
|
---|
3763 | /* Translate all the actions: */
|
---|
3764 | foreach (const int iActionPoolKey, m_pool.keys())
|
---|
3765 | m_pool[iActionPoolKey]->retranslateUi();
|
---|
3766 | /* Update shortcuts: */
|
---|
3767 | updateShortcuts();
|
---|
3768 | }
|
---|
3769 |
|
---|
3770 | bool UIActionPool::addAction(UIMenu *pMenu, UIAction *pAction, bool fReallyAdd /* = true */)
|
---|
3771 | {
|
---|
3772 | /* Check if action is allowed: */
|
---|
3773 | const bool fIsActionAllowed = pAction->isAllowed();
|
---|
3774 |
|
---|
3775 | #ifdef VBOX_WS_MAC
|
---|
3776 | /* Check if menu is consumable: */
|
---|
3777 | const bool fIsMenuConsumable = pMenu->isConsumable();
|
---|
3778 | /* Check if menu is NOT yet consumed: */
|
---|
3779 | const bool fIsMenuConsumed = pMenu->isConsumed();
|
---|
3780 | #endif
|
---|
3781 |
|
---|
3782 | /* Make this action visible
|
---|
3783 | * depending on clearance state. */
|
---|
3784 | pAction->setVisible(fIsActionAllowed);
|
---|
3785 |
|
---|
3786 | #ifdef VBOX_WS_MAC
|
---|
3787 | /* If menu is consumable: */
|
---|
3788 | if (fIsMenuConsumable)
|
---|
3789 | {
|
---|
3790 | /* Add action only if menu was not yet consumed: */
|
---|
3791 | if (!fIsMenuConsumed)
|
---|
3792 | pMenu->addAction(pAction);
|
---|
3793 | }
|
---|
3794 | /* If menu is NOT consumable: */
|
---|
3795 | else
|
---|
3796 | #endif
|
---|
3797 | {
|
---|
3798 | /* Add action only if is allowed: */
|
---|
3799 | if (fIsActionAllowed && fReallyAdd)
|
---|
3800 | pMenu->addAction(pAction);
|
---|
3801 | }
|
---|
3802 |
|
---|
3803 | /* Return if action is allowed: */
|
---|
3804 | return fIsActionAllowed;
|
---|
3805 | }
|
---|
3806 |
|
---|
3807 | bool UIActionPool::addMenu(QList<QMenu*> &menuList, UIAction *pAction, bool fReallyAdd /* = true */)
|
---|
3808 | {
|
---|
3809 | /* Check if action is allowed: */
|
---|
3810 | const bool fIsActionAllowed = pAction->isAllowed();
|
---|
3811 |
|
---|
3812 | /* Get action's menu: */
|
---|
3813 | UIMenu *pMenu = pAction->menu();
|
---|
3814 |
|
---|
3815 | #ifdef VBOX_WS_MAC
|
---|
3816 | /* Check if menu is consumable: */
|
---|
3817 | const bool fIsMenuConsumable = pMenu->isConsumable();
|
---|
3818 | /* Check if menu is NOT yet consumed: */
|
---|
3819 | const bool fIsMenuConsumed = pMenu->isConsumed();
|
---|
3820 | #endif
|
---|
3821 |
|
---|
3822 | /* Make this action visible
|
---|
3823 | * depending on clearance state. */
|
---|
3824 | pAction->setVisible( fIsActionAllowed
|
---|
3825 | #ifdef VBOX_WS_MAC
|
---|
3826 | || fIsMenuConsumable
|
---|
3827 | #endif
|
---|
3828 | );
|
---|
3829 |
|
---|
3830 | #ifdef VBOX_WS_MAC
|
---|
3831 | /* If menu is consumable: */
|
---|
3832 | if (fIsMenuConsumable)
|
---|
3833 | {
|
---|
3834 | /* Add action's menu only if menu was not yet consumed: */
|
---|
3835 | if (!fIsMenuConsumed)
|
---|
3836 | menuList << pMenu;
|
---|
3837 | }
|
---|
3838 | /* If menu is NOT consumable: */
|
---|
3839 | else
|
---|
3840 | #endif
|
---|
3841 | {
|
---|
3842 | /* Add action only if is allowed: */
|
---|
3843 | if (fIsActionAllowed && fReallyAdd)
|
---|
3844 | menuList << pMenu;
|
---|
3845 | }
|
---|
3846 |
|
---|
3847 | /* Return if action is allowed: */
|
---|
3848 | return fIsActionAllowed;
|
---|
3849 | }
|
---|
3850 |
|
---|
3851 | void UIActionPool::updateMenuApplication()
|
---|
3852 | {
|
---|
3853 | /* Get corresponding menu: */
|
---|
3854 | UIMenu *pMenu = action(UIActionIndex_M_Application)->menu();
|
---|
3855 | AssertPtrReturnVoid(pMenu);
|
---|
3856 | #ifdef VBOX_WS_MAC
|
---|
3857 | AssertReturnVoid(pMenu->isConsumable());
|
---|
3858 | #endif
|
---|
3859 | /* Clear contents: */
|
---|
3860 | #ifdef VBOX_WS_MAC
|
---|
3861 | if (!pMenu->isConsumed())
|
---|
3862 | #endif
|
---|
3863 | pMenu->clear();
|
---|
3864 |
|
---|
3865 | /* Separator: */
|
---|
3866 | bool fSeparator = false;
|
---|
3867 |
|
---|
3868 | #ifdef VBOX_WS_MAC
|
---|
3869 | /* 'About' action: */
|
---|
3870 | fSeparator = addAction(pMenu, action(UIActionIndex_M_Application_S_About)) || fSeparator;
|
---|
3871 | #endif
|
---|
3872 |
|
---|
3873 | /* 'Preferences' action: */
|
---|
3874 | fSeparator = addAction(pMenu, action(UIActionIndex_M_Application_S_Preferences)) || fSeparator;
|
---|
3875 |
|
---|
3876 | #ifndef VBOX_WS_MAC
|
---|
3877 | /* Separator: */
|
---|
3878 | if (fSeparator)
|
---|
3879 | {
|
---|
3880 | pMenu->addSeparator();
|
---|
3881 | fSeparator = false;
|
---|
3882 | }
|
---|
3883 | #endif
|
---|
3884 |
|
---|
3885 | /* 'Reset Warnings' action: */
|
---|
3886 | fSeparator = addAction(pMenu, action(UIActionIndex_M_Application_S_ResetWarnings)) || fSeparator;
|
---|
3887 |
|
---|
3888 | #ifndef VBOX_WS_MAC
|
---|
3889 | /* Separator: */
|
---|
3890 | if (fSeparator)
|
---|
3891 | {
|
---|
3892 | pMenu->addSeparator();
|
---|
3893 | fSeparator = false;
|
---|
3894 | }
|
---|
3895 | #endif
|
---|
3896 |
|
---|
3897 | /* 'Close' action: */
|
---|
3898 | fSeparator = addAction(pMenu, action(UIActionIndex_M_Application_S_Close)) || fSeparator;
|
---|
3899 |
|
---|
3900 | /* Mark menu as valid: */
|
---|
3901 | m_invalidations.remove(UIActionIndex_M_Application);
|
---|
3902 | }
|
---|
3903 |
|
---|
3904 | #ifdef VBOX_WS_MAC
|
---|
3905 | void UIActionPool::updateMenuWindow()
|
---|
3906 | {
|
---|
3907 | /* Get corresponding menu: */
|
---|
3908 | UIMenu *pMenu = action(UIActionIndex_M_Window)->menu();
|
---|
3909 | AssertPtrReturnVoid(pMenu);
|
---|
3910 | /* Clear contents: */
|
---|
3911 | pMenu->clear();
|
---|
3912 |
|
---|
3913 | /* Separator: */
|
---|
3914 | bool fSeparator = false;
|
---|
3915 |
|
---|
3916 | /* 'Minimize' action: */
|
---|
3917 | fSeparator = addAction(pMenu, action(UIActionIndex_M_Window_S_Minimize)) || fSeparator;
|
---|
3918 |
|
---|
3919 | /* Separator: */
|
---|
3920 | if (fSeparator)
|
---|
3921 | {
|
---|
3922 | pMenu->addSeparator();
|
---|
3923 | fSeparator = false;
|
---|
3924 | }
|
---|
3925 |
|
---|
3926 | /* This menu always remains invalid.. */
|
---|
3927 | }
|
---|
3928 | #endif /* VBOX_WS_MAC */
|
---|
3929 |
|
---|
3930 | void UIActionPool::updateMenuHelp()
|
---|
3931 | {
|
---|
3932 | /* Get corresponding menu: */
|
---|
3933 | UIMenu *pMenu = action(UIActionIndex_Menu_Help)->menu();
|
---|
3934 | AssertPtrReturnVoid(pMenu);
|
---|
3935 | /* Clear contents: */
|
---|
3936 | pMenu->clear();
|
---|
3937 |
|
---|
3938 | /* Separator? */
|
---|
3939 | bool fSeparator = false;
|
---|
3940 |
|
---|
3941 | /* 'Contents' action: */
|
---|
3942 | fSeparator = addAction(pMenu, action(UIActionIndex_Simple_Contents)) || fSeparator;
|
---|
3943 | /* 'Online Documentation' action: */
|
---|
3944 | fSeparator = addAction(pMenu, action(UIActionIndex_Simple_OnlineDocumentation)) || fSeparator;
|
---|
3945 | /* 'Web Site' action: */
|
---|
3946 | fSeparator = addAction(pMenu, action(UIActionIndex_Simple_WebSite)) || fSeparator;
|
---|
3947 | /* 'Bug Tracker' action: */
|
---|
3948 | fSeparator = addAction(pMenu, action(UIActionIndex_Simple_BugTracker)) || fSeparator;
|
---|
3949 | /* 'Forums' action: */
|
---|
3950 | fSeparator = addAction(pMenu, action(UIActionIndex_Simple_Forums)) || fSeparator;
|
---|
3951 | /* 'Oracle' action: */
|
---|
3952 | fSeparator = addAction(pMenu, action(UIActionIndex_Simple_Oracle)) || fSeparator;
|
---|
3953 |
|
---|
3954 | #ifndef VBOX_WS_MAC
|
---|
3955 | /* Separator? */
|
---|
3956 | if (fSeparator)
|
---|
3957 | {
|
---|
3958 | pMenu->addSeparator();
|
---|
3959 | fSeparator = false;
|
---|
3960 | }
|
---|
3961 |
|
---|
3962 | /* 'About' action: */
|
---|
3963 | fSeparator = addAction(pMenu, action(UIActionIndex_Simple_About)) || fSeparator;
|
---|
3964 | #endif
|
---|
3965 |
|
---|
3966 | /* Mark menu as valid: */
|
---|
3967 | m_invalidations.remove(UIActionIndex_Menu_Help);
|
---|
3968 | }
|
---|
3969 |
|
---|
3970 | void UIActionPool::updateMenuLogViewerWindow()
|
---|
3971 | {
|
---|
3972 | /* Update corresponding menu: */
|
---|
3973 | updateMenuLogViewerWrapper(action(UIActionIndex_M_LogWindow)->menu());
|
---|
3974 |
|
---|
3975 | /* Mark menu as valid: */
|
---|
3976 | m_invalidations.remove(UIActionIndex_M_LogWindow);
|
---|
3977 | }
|
---|
3978 |
|
---|
3979 | void UIActionPool::updateMenuLogViewer()
|
---|
3980 | {
|
---|
3981 | /* Update corresponding menu: */
|
---|
3982 | updateMenuLogViewerWrapper(action(UIActionIndex_M_Log)->menu());
|
---|
3983 |
|
---|
3984 | /* Mark menu as valid: */
|
---|
3985 | m_invalidations.remove(UIActionIndex_M_Log);
|
---|
3986 | }
|
---|
3987 |
|
---|
3988 | void UIActionPool::updateMenuLogViewerWrapper(UIMenu *pMenu)
|
---|
3989 | {
|
---|
3990 | /* Clear contents: */
|
---|
3991 | pMenu->clear();
|
---|
3992 |
|
---|
3993 | /* Separator? */
|
---|
3994 | bool fSeparator = false;
|
---|
3995 |
|
---|
3996 | /* 'Save' action: */
|
---|
3997 | fSeparator = addAction(pMenu, action(UIActionIndex_M_Log_S_Save)) || fSeparator;
|
---|
3998 |
|
---|
3999 | /* Separator? */
|
---|
4000 | if (fSeparator)
|
---|
4001 | {
|
---|
4002 | pMenu->addSeparator();
|
---|
4003 | fSeparator = false;
|
---|
4004 | }
|
---|
4005 |
|
---|
4006 | /* 'Find' action: */
|
---|
4007 | fSeparator = addAction(pMenu, action(UIActionIndex_M_Log_T_Find)) || fSeparator;
|
---|
4008 | /* 'Filter' action: */
|
---|
4009 | fSeparator = addAction(pMenu, action(UIActionIndex_M_Log_T_Filter)) || fSeparator;
|
---|
4010 | /* 'Bookmarks' action: */
|
---|
4011 | fSeparator = addAction(pMenu, action(UIActionIndex_M_Log_T_Bookmark)) || fSeparator;
|
---|
4012 | /* 'Preferences' action: */
|
---|
4013 | fSeparator = addAction(pMenu, action(UIActionIndex_M_Log_T_Preferences)) || fSeparator;
|
---|
4014 |
|
---|
4015 | /* Separator? */
|
---|
4016 | if (fSeparator)
|
---|
4017 | {
|
---|
4018 | pMenu->addSeparator();
|
---|
4019 | fSeparator = false;
|
---|
4020 | }
|
---|
4021 |
|
---|
4022 | /* 'Refresh' action: */
|
---|
4023 | fSeparator = addAction(pMenu, action(UIActionIndex_M_Log_S_Refresh)) || fSeparator;
|
---|
4024 | fSeparator = addAction(pMenu, action(UIActionIndex_M_Log_S_Reload)) || fSeparator;
|
---|
4025 | }
|
---|
4026 |
|
---|
4027 | void UIActionPool::updateMenuVMActivityMonitor()
|
---|
4028 | {
|
---|
4029 | /* Get corresponding menu: */
|
---|
4030 | UIMenu *pMenu = action(UIActionIndex_M_Activity)->menu();
|
---|
4031 | AssertPtrReturnVoid(pMenu);
|
---|
4032 | /* Clear contents: */
|
---|
4033 | pMenu->clear();
|
---|
4034 |
|
---|
4035 | /* 'Export' and 'Switch to VM Activity Overview" actions: */
|
---|
4036 | pMenu->addAction(action(UIActionIndex_M_Activity_S_Export));
|
---|
4037 | pMenu->addAction(action(UIActionIndex_M_Activity_S_ToVMActivityOverview));
|
---|
4038 | /* 'Preferences' action: */
|
---|
4039 | pMenu->addAction(action(UIActionIndex_M_Activity_T_Preferences));
|
---|
4040 |
|
---|
4041 | /* Mark menu as valid: */
|
---|
4042 | m_invalidations.remove(UIActionIndex_M_Activity);
|
---|
4043 | }
|
---|
4044 |
|
---|
4045 | void UIActionPool::updateMenuFileManager()
|
---|
4046 | {
|
---|
4047 | updateMenuFileManagerWrapper(action(UIActionIndex_M_FileManager)->menu());
|
---|
4048 |
|
---|
4049 | /* Mark menu as valid: */
|
---|
4050 | m_invalidations.remove(UIActionIndex_M_FileManager);
|
---|
4051 | }
|
---|
4052 |
|
---|
4053 | void UIActionPool::updateMenuFileManagerWrapper(UIMenu *pMenu)
|
---|
4054 | {
|
---|
4055 | addAction(pMenu, action(UIActionIndex_M_FileManager_T_Preferences));
|
---|
4056 | addAction(pMenu, action(UIActionIndex_M_FileManager_T_Operations));
|
---|
4057 | addAction(pMenu, action(UIActionIndex_M_FileManager_T_Log));
|
---|
4058 |
|
---|
4059 | addAction(pMenu, action(UIActionIndex_M_FileManager_M_HostSubmenu));
|
---|
4060 | addAction(pMenu, action(UIActionIndex_M_FileManager_M_GuestSubmenu));
|
---|
4061 |
|
---|
4062 | UIMenu *pHostSubmenu = action(UIActionIndex_M_FileManager_M_HostSubmenu)->menu();
|
---|
4063 | if (pHostSubmenu)
|
---|
4064 | {
|
---|
4065 | addAction(pHostSubmenu, action(UIActionIndex_M_FileManager_S_Host_GoUp));
|
---|
4066 | addAction(pHostSubmenu, action(UIActionIndex_M_FileManager_S_Host_GoHome));
|
---|
4067 | addAction(pHostSubmenu, action(UIActionIndex_M_FileManager_S_Host_Refresh));
|
---|
4068 | addAction(pHostSubmenu, action(UIActionIndex_M_FileManager_S_Host_Delete));
|
---|
4069 | addAction(pHostSubmenu, action(UIActionIndex_M_FileManager_S_Host_Rename));
|
---|
4070 | addAction(pHostSubmenu, action(UIActionIndex_M_FileManager_S_Host_CreateNewDirectory));
|
---|
4071 | addAction(pHostSubmenu, action(UIActionIndex_M_FileManager_S_Host_Copy));
|
---|
4072 | addAction(pHostSubmenu, action(UIActionIndex_M_FileManager_S_Host_Cut));
|
---|
4073 | addAction(pHostSubmenu, action(UIActionIndex_M_FileManager_S_Host_Paste));
|
---|
4074 | addAction(pHostSubmenu, action(UIActionIndex_M_FileManager_S_Host_SelectAll));
|
---|
4075 | addAction(pHostSubmenu, action(UIActionIndex_M_FileManager_S_Host_InvertSelection));
|
---|
4076 | addAction(pHostSubmenu, action(UIActionIndex_M_FileManager_S_Host_ShowProperties));
|
---|
4077 | }
|
---|
4078 |
|
---|
4079 | UIMenu *pGuestSubmenu = action(UIActionIndex_M_FileManager_M_GuestSubmenu)->menu();
|
---|
4080 | if (pGuestSubmenu)
|
---|
4081 | {
|
---|
4082 | addAction(pGuestSubmenu, action(UIActionIndex_M_FileManager_S_Host_GoUp));
|
---|
4083 | addAction(pGuestSubmenu, action(UIActionIndex_M_FileManager_S_Guest_GoHome));
|
---|
4084 | addAction(pGuestSubmenu, action(UIActionIndex_M_FileManager_S_Guest_Refresh));
|
---|
4085 | addAction(pGuestSubmenu, action(UIActionIndex_M_FileManager_S_Guest_Delete));
|
---|
4086 | addAction(pGuestSubmenu, action(UIActionIndex_M_FileManager_S_Guest_Rename));
|
---|
4087 | addAction(pGuestSubmenu, action(UIActionIndex_M_FileManager_S_Guest_CreateNewDirectory));
|
---|
4088 | addAction(pGuestSubmenu, action(UIActionIndex_M_FileManager_S_Guest_Copy));
|
---|
4089 | addAction(pGuestSubmenu, action(UIActionIndex_M_FileManager_S_Guest_Cut));
|
---|
4090 | addAction(pGuestSubmenu, action(UIActionIndex_M_FileManager_S_Guest_Paste));
|
---|
4091 | addAction(pGuestSubmenu, action(UIActionIndex_M_FileManager_S_Guest_SelectAll));
|
---|
4092 | addAction(pGuestSubmenu, action(UIActionIndex_M_FileManager_S_Guest_InvertSelection));
|
---|
4093 | addAction(pGuestSubmenu, action(UIActionIndex_M_FileManager_S_Guest_ShowProperties));
|
---|
4094 | }
|
---|
4095 | }
|
---|
4096 |
|
---|
4097 | void UIActionPool::prepare()
|
---|
4098 | {
|
---|
4099 | /* Prepare pool: */
|
---|
4100 | preparePool();
|
---|
4101 | /* Prepare connections: */
|
---|
4102 | prepareConnections();
|
---|
4103 |
|
---|
4104 | /* Update configuration: */
|
---|
4105 | updateConfiguration();
|
---|
4106 | /* Update shortcuts: */
|
---|
4107 | updateShortcuts();
|
---|
4108 | }
|
---|
4109 |
|
---|
4110 | void UIActionPool::cleanup()
|
---|
4111 | {
|
---|
4112 | /* Cleanup connections: */
|
---|
4113 | cleanupConnections();
|
---|
4114 | /* Cleanup pool: */
|
---|
4115 | cleanupPool();
|
---|
4116 | }
|
---|
4117 |
|
---|
4118 |
|
---|
4119 | #include "UIActionPool.moc"
|
---|