UIActionPoolRuntime.cpp revision 2abf432b6eb0db4054adcc6a59efedd8696f7b25
/* $Id$ */
/** @file
*
* VBox frontends: Qt GUI ("VirtualBox"):
* UIActionPoolRuntime class implementation
*/
/*
* Copyright (C) 2010-2013 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
/* Local includes: */
#include "UIActionPoolRuntime.h"
#include "UIShortcutPool.h"
#include "VBoxGlobal.h"
class UIActionMenuMachineRuntime : public UIActionMenu
{
public:
{
}
protected:
void retranslateUi()
{
}
};
class UIActionSimpleShowSettingsDialog : public UIActionSimple
{
public:
{
}
protected:
QString shortcutExtraDataID() const
{
return QString("SettingsDialog");
}
{
return QKeySequence("S");
}
void retranslateUi()
{
}
};
class UIActionSimplePerformTakeSnapshot : public UIActionSimple
{
public:
{
}
protected:
QString shortcutExtraDataID() const
{
return QString("TakeSnapshot");
}
{
return QKeySequence("T");
}
void retranslateUi()
{
}
};
class UIActionSimplePerformTakeScreenshot : public UIActionSimple
{
public:
{
}
protected:
QString shortcutExtraDataID() const
{
return QString("TakeScreenshot");
}
{
return QKeySequence("E");
}
void retranslateUi()
{
}
};
class UIActionSimpleShowInformationDialog : public UIActionSimple
{
public:
{
}
protected:
QString shortcutExtraDataID() const
{
return QString("InformationDialog");
}
{
return QKeySequence("N");
}
void retranslateUi()
{
}
};
class UIActionMenuMouseIntegration : public UIActionMenu
{
public:
{
}
protected:
void retranslateUi() {}
};
class UIActionToggleMouseIntegration : public UIActionToggle
{
public:
":/mouse_can_seamless_on_16px.png", ":/mouse_can_seamless_16px.png",
":/mouse_can_seamless_on_disabled_16px.png", ":/mouse_can_seamless_disabled_16px.png")
{
}
protected:
QString shortcutExtraDataID() const
{
return QString("MouseIntegration");
}
{
return QKeySequence("I");
}
void retranslateUi()
{
setStatusTip(QApplication::translate("UIActionPool", "Temporarily disable host mouse pointer integration"));
}
};
class UIActionSimplePerformTypeCAD : public UIActionSimple
{
public:
{
}
protected:
QString shortcutExtraDataID() const
{
return QString("TypeCAD");
}
{
return QKeySequence("Del");
}
void retranslateUi()
{
setStatusTip(QApplication::translate("UIActionPool", "Send the Ctrl-Alt-Del sequence to the virtual machine"));
}
};
#ifdef Q_WS_X11
class UIActionSimplePerformTypeCABS : public UIActionSimple
{
public:
{
}
protected:
QString shortcutExtraDataID() const
{
return QString("TypeCABS");
}
{
return QKeySequence("Backspace");
}
void retranslateUi()
{
setStatusTip(QApplication::translate("UIActionPool", "Send the Ctrl-Alt-Backspace sequence to the virtual machine"));
}
};
#endif /* Q_WS_X11 */
class UIActionTogglePause : public UIActionToggle
{
public:
":/pause_on_16px.png", ":/pause_16px.png",
":/pause_on_disabled_16px.png", ":/pause_disabled_16px.png")
{
}
protected:
QString shortcutExtraDataID() const
{
return QString("Pause");
}
{
return QKeySequence("P");
}
void retranslateUi()
{
setStatusTip(QApplication::translate("UIActionPool", "Suspend the execution of the virtual machine"));
}
};
class UIActionSimplePerformReset : public UIActionSimple
{
public:
{
}
protected:
QString shortcutExtraDataID() const
{
return QString("Reset");
}
{
return QKeySequence("R");
}
void retranslateUi()
{
}
};
class UIActionSimplePerformSave : public UIActionSimple
{
public:
{
}
protected:
QString shortcutExtraDataID() const
{
return QString("Save");
}
void retranslateUi()
{
setStatusTip(QApplication::translate("UIActionPool", "Save the machine state of the virtual machine"));
}
};
class UIActionSimplePerformShutdown : public UIActionSimple
{
public:
{
}
protected:
QString shortcutExtraDataID() const
{
return QString("Shutdown");
}
{
#ifdef Q_WS_MAC
return QKeySequence("U");
#else /* Q_WS_MAC */
return QKeySequence("H");
#endif /* !Q_WS_MAC */
}
void retranslateUi()
{
setStatusTip(QApplication::translate("UIActionPool", "Send the ACPI Power Button press event to the virtual machine"));
}
};
class UIActionSimplePerformPowerOff : public UIActionSimple
{
public:
{
}
protected:
QString shortcutExtraDataID() const
{
return QString("PowerOff");
}
void retranslateUi()
{
}
};
class UIActionSimplePerformClose : public UIActionSimple
{
public:
{
}
protected:
QString shortcutExtraDataID() const
{
return QString("Close");
}
{
return QKeySequence("Q");
}
void retranslateUi()
{
}
};
class UIActionMenuView : public UIActionMenu
{
public:
{
}
protected:
void retranslateUi()
{
}
};
class UIActionToggleFullscreenMode : public UIActionToggle
{
public:
":/fullscreen_on_16px.png", ":/fullscreen_16px.png",
":/fullscreen_on_disabled_16px.png", ":/fullscreen_disabled_16px.png")
{
}
protected:
QString shortcutExtraDataID() const
{
return QString("FullscreenMode");
}
{
return QKeySequence("F");
}
void retranslateUi()
{
}
};
class UIActionToggleSeamlessMode : public UIActionToggle
{
public:
":/seamless_on_16px.png", ":/seamless_16px.png",
":/seamless_on_disabled_16px.png", ":/seamless_disabled_16px.png")
{
}
protected:
QString shortcutExtraDataID() const
{
return QString("SeamlessMode");
}
{
return QKeySequence("L");
}
void retranslateUi()
{
setStatusTip(QApplication::translate("UIActionPool", "Switch between normal and seamless desktop integration mode"));
}
};
class UIActionToggleScaleMode : public UIActionToggle
{
public:
":/scale_on_16px.png", ":/scale_16px.png",
":/scale_on_disabled_16px.png", ":/scale_disabled_16px.png")
{
}
protected:
QString shortcutExtraDataID() const
{
return QString("ScaleMode");
}
{
return QKeySequence("C");
}
void retranslateUi()
{
}
};
class UIActionToggleGuestAutoresize : public UIActionToggle
{
public:
":/auto_resize_on_on_16px.png", ":/auto_resize_on_16px.png",
":/auto_resize_on_on_disabled_16px.png", ":/auto_resize_on_disabled_16px.png")
{
}
protected:
QString shortcutExtraDataID() const
{
return QString("GuestAutoresize");
}
{
return QKeySequence("G");
}
void retranslateUi()
{
setStatusTip(QApplication::translate("UIActionPool", "Automatically resize the guest display when the window is resized (requires Guest Additions)"));
}
};
class UIActionSimplePerformWindowAdjust : public UIActionSimple
{
public:
{
}
protected:
QString shortcutExtraDataID() const
{
return QString("WindowAdjust");
}
{
return QKeySequence("A");
}
void retranslateUi()
{
setStatusTip(QApplication::translate("UIActionPool", "Adjust window size and position to best fit the guest display"));
}
};
class UIActionMenuDevices : public UIActionMenu
{
public:
{
}
protected:
void retranslateUi()
{
}
};
class UIActionMenuOpticalDevices : public UIActionMenu
{
public:
{
}
protected:
void retranslateUi()
{
}
};
class UIActionMenuFloppyDevices : public UIActionMenu
{
public:
{
}
protected:
void retranslateUi()
{
}
};
class UIActionMenuUSBDevices : public UIActionMenu
{
public:
{
}
protected:
void retranslateUi()
{
}
};
class UIActionMenuSharedClipboard : public UIActionMenu
{
public:
: UIActionMenu(pParent, ":/vm_open_filemanager_16px.png", ":/vm_open_filemanager_disabled_16px.png")
{
}
protected:
void retranslateUi()
{
}
};
class UIActionMenuDragAndDrop : public UIActionMenu
{
public:
: UIActionMenu(pParent, ":/vm_open_filemanager_16px.png", ":/vm_open_filemanager_disabled_16px.png")
{
}
protected:
void retranslateUi()
{
}
};
class UIActionMenuNetworkAdapters : public UIActionMenu
{
public:
{
}
protected:
void retranslateUi() {}
};
class UIActionSimpleShowNetworkAdaptersDialog : public UIActionSimple
{
public:
{
}
protected:
QString shortcutExtraDataID() const
{
return QString("NetworkAdaptersDialog");
}
void retranslateUi()
{
}
};
class UIActionMenuSharedFolders : public UIActionMenu
{
public:
{
}
protected:
void retranslateUi() {}
};
class UIActionSimpleShowSharedFoldersDialog : public UIActionSimple
{
public:
{
}
protected:
QString shortcutExtraDataID() const
{
return QString("SharedFoldersDialog");
}
void retranslateUi()
{
}
};
class UIActionToggleVRDEServer : public UIActionToggle
{
public:
":/vrdp_on_16px.png", ":/vrdp_16px.png",
":/vrdp_on_disabled_16px.png", ":/vrdp_disabled_16px.png")
{
}
protected:
QString shortcutExtraDataID() const
{
return QString("VRDPServer");
}
void retranslateUi()
{
setStatusTip(QApplication::translate("UIActionPool", "Enable remote desktop (RDP) connections to this machine"));
}
};
class UIActionMenuVideoCapture : public UIActionMenu
{
public:
{
}
protected:
void retranslateUi() {}
};
class UIActionToggleVideoCapture : public UIActionToggle
{
public:
":/video_capture_16px.png", ":/video_capture_disabled_16px.png")
{
}
protected:
QString shortcutExtraDataID() const
{
return QString("VideoCapture");
}
void retranslateUi()
{
}
};
class UIActionSimpleShowVideoCaptureOptions : public UIActionSimple
{
public:
{
}
protected:
QString shortcutExtraDataID() const
{
return QString("VideoCaptureOptions");
}
void retranslateUi()
{
}
};
class UIActionSimplePerformInstallGuestTools : public UIActionSimple
{
public:
{
}
protected:
QString shortcutExtraDataID() const
{
return QString("InstallGuestAdditions");
}
{
return QKeySequence("D");
}
void retranslateUi()
{
setStatusTip(QApplication::translate("UIActionPool", "Mount the Guest Additions installation image"));
}
};
#ifdef VBOX_WITH_DEBUGGER_GUI
class UIActionMenuDebug : public UIActionMenu
{
public:
{
}
protected:
void retranslateUi()
{
}
};
class UIActionSimpleShowStatistics : public UIActionSimple
{
public:
{
}
protected:
QString shortcutExtraDataID() const
{
return QString("StatisticWindow");
}
void retranslateUi()
{
}
};
class UIActionSimpleShowCommandLine : public UIActionSimple
{
public:
{
}
protected:
QString shortcutExtraDataID() const
{
return QString("CommandLineWindow");
}
void retranslateUi()
{
}
};
class UIActionToggleLogging : public UIActionToggle
{
public:
{
}
protected:
QString shortcutExtraDataID() const
{
return QString("Logging");
}
void retranslateUi()
{
}
};
#endif /* VBOX_WITH_DEBUGGER_GUI */
#ifdef RT_OS_DARWIN
class UIActionMenuDock : public UIActionMenu
{
public:
{
}
protected:
void retranslateUi() {}
};
class UIActionMenuDockSettings : public UIActionMenu
{
public:
{
}
protected:
void retranslateUi()
{
}
};
class UIActionToggleDockPreviewMonitor : public UIActionToggle
{
public:
{
}
protected:
QString shortcutExtraDataID() const
{
return QString("DockPreviewMonitor");
}
void retranslateUi()
{
}
};
class UIActionToggleDockDisableMonitor : public UIActionToggle
{
public:
{
}
protected:
QString shortcutExtraDataID() const
{
return QString("DockDisableMonitor");
}
void retranslateUi()
{
}
};
#endif /* Q_WS_MAC */
{
/* Prepare connections: */
}
{
return GUI_Input_MachineShortcuts;
}
void UIActionPoolRuntime::createActions()
{
/* Global actions creation: */
/* 'Machine' actions: */
m_pool[UIActionIndexRuntime_Simple_InformationDialog] = new UIActionSimpleShowInformationDialog(this);
#ifdef Q_WS_X11
#endif /* Q_WS_X11 */
/* 'View' actions: */
/* 'Devices' actions: */
m_pool[UIActionIndexRuntime_Simple_NetworkAdaptersDialog] = new UIActionSimpleShowNetworkAdaptersDialog(this);
m_pool[UIActionIndexRuntime_Simple_SharedFoldersDialog] = new UIActionSimpleShowSharedFoldersDialog(this);
m_pool[UIActionIndexRuntime_Simple_VideoCaptureOptions] = new UIActionSimpleShowVideoCaptureOptions(this);
m_pool[UIActionIndexRuntime_Simple_InstallGuestTools] = new UIActionSimplePerformInstallGuestTools(this);
#ifdef VBOX_WITH_DEBUGGER_GUI
/* 'Debug' actions: */
#endif /* VBOX_WITH_DEBUGGER_GUI */
#ifdef Q_WS_MAC
/* 'Dock' actions: */
m_pool[UIActionIndexRuntime_Toggle_DockPreviewMonitor] = new UIActionToggleDockPreviewMonitor(this);
m_pool[UIActionIndexRuntime_Toggle_DockDisableMonitor] = new UIActionToggleDockDisableMonitor(this);
#endif /* Q_WS_MAC */
}
void UIActionPoolRuntime::createMenus()
{
/* Global menus creation: */
/* On Mac OS X, all QMenu's are consumed by Qt after they are added to another QMenu or a QMenuBar.
* This means we have to recreate all QMenus when creating a new QMenuBar.
* For simplicity we doing this on all platforms right now. */
/* Recreate 'close' item as well.
* This makes sure it is removed also from the Application menu: */
delete m_pool[UIActionIndexRuntime_Simple_Close];
/* 'Machine' menu: */
delete m_pool[UIActionIndexRuntime_Menu_Machine];
/* 'View' menu: */
delete m_pool[UIActionIndexRuntime_Menu_View];
/* 'Devices' menu: */
delete m_pool[UIActionIndexRuntime_Menu_Devices];
#ifdef VBOX_WITH_DEBUGGER_GUI
/* 'Debug' menu: */
delete m_pool[UIActionIndexRuntime_Menu_Debug];
#endif /* VBOX_WITH_DEBUGGER_GUI */
#ifdef Q_WS_MAC
/* 'Dock' menu: */
delete m_pool[UIActionIndexRuntime_Menu_Dock];
#endif /* Q_WS_MAC */
}
#include "UIActionPoolRuntime.moc"