UIConverterBackendGlobal.cpp revision f0821e819e51b95ecaf7b12c742da563b4ddf7e5
/* $Id$ */
/** @file
* VBox Qt GUI - UIConverterBackendGlobal implementation.
*/
/*
* Copyright (C) 2012 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.
*/
# include <precomp.h>
#else /* !VBOX_WITH_PRECOMPILED_HEADERS */
/* Qt includes: */
# include <QApplication>
# include <QHash>
/* GUI includes: */
# include "UIConverterBackend.h"
# include "UIIconPool.h"
# include "VBoxGlobal.h"
/* COM includes: */
# include "CSystemProperties.h"
#endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
/* Determines if <Object of type X> can be converted to object of other type.
* These functions returns 'true' for all allowed conversions. */
template<> bool canConvert<SizeSuffix>() { return true; }
template<> bool canConvert<StorageSlot>() { return true; }
#ifdef Q_WS_MAC
#endif /* Q_WS_MAC */
#ifdef VBOX_WITH_DEBUGGER_GUI
#endif /* VBOX_WITH_DEBUGGER_GUI */
#ifdef Q_WS_MAC
#endif /* Q_WS_MAC */
template<> bool canConvert<UIVisualStateType>() { return true; }
template<> bool canConvert<DetailsElementType>() { return true; }
template<> bool canConvert<PreviewUpdateIntervalType>() { return true; }
template<> bool canConvert<GlobalSettingsPageType>() { return true; }
template<> bool canConvert<MachineSettingsPageType>() { return true; }
template<> bool canConvert<WizardType>() { return true; }
template<> bool canConvert<IndicatorType>() { return true; }
template<> bool canConvert<MachineCloseAction>() { return true; }
template<> bool canConvert<MouseCapturePolicy>() { return true; }
template<> bool canConvert<GuruMeditationHandlerType>() { return true; }
template<> bool canConvert<HiDPIOptimizationType>() { return true; }
template<> bool canConvert<MiniToolbarAlignment>() { return true; }
/* QString <= SizeSuffix: */
{
switch (sizeSuffix)
{
case SizeSuffix_Byte: strResult = QApplication::translate("VBoxGlobal", "B", "size suffix Bytes"); break;
case SizeSuffix_KiloByte: strResult = QApplication::translate("VBoxGlobal", "KB", "size suffix KBytes=1024 Bytes"); break;
case SizeSuffix_MegaByte: strResult = QApplication::translate("VBoxGlobal", "MB", "size suffix MBytes=1024 KBytes"); break;
case SizeSuffix_GigaByte: strResult = QApplication::translate("VBoxGlobal", "GB", "size suffix GBytes=1024 MBytes"); break;
case SizeSuffix_TeraByte: strResult = QApplication::translate("VBoxGlobal", "TB", "size suffix TBytes=1024 GBytes"); break;
case SizeSuffix_PetaByte: strResult = QApplication::translate("VBoxGlobal", "PB", "size suffix PBytes=1024 TBytes"); break;
default:
{
break;
}
}
return strResult;
}
/* SizeSuffix <= QString: */
{
list.insert(QApplication::translate("VBoxGlobal", "KB", "size suffix KBytes=1024 Bytes"), SizeSuffix_KiloByte);
list.insert(QApplication::translate("VBoxGlobal", "MB", "size suffix MBytes=1024 KBytes"), SizeSuffix_MegaByte);
list.insert(QApplication::translate("VBoxGlobal", "GB", "size suffix GBytes=1024 MBytes"), SizeSuffix_GigaByte);
list.insert(QApplication::translate("VBoxGlobal", "TB", "size suffix TBytes=1024 GBytes"), SizeSuffix_TeraByte);
list.insert(QApplication::translate("VBoxGlobal", "PB", "size suffix PBytes=1024 TBytes"), SizeSuffix_PetaByte);
{
}
}
/* QString <= StorageSlot: */
{
switch (storageSlot.bus)
{
case KStorageBus_IDE:
{
int iMaxPort = vboxGlobal().virtualBox().GetSystemProperties().GetMaxPortCountForStorageBus(storageSlot.bus);
int iMaxDevice = vboxGlobal().virtualBox().GetSystemProperties().GetMaxDevicesPerPortForStorageBus(storageSlot.bus);
{
break;
}
{
AssertMsgFailed(("No text for bus=%d & port=%d & device=%d", storageSlot.bus, storageSlot.port, storageSlot.device));
break;
}
break;
}
case KStorageBus_SATA:
{
int iMaxPort = vboxGlobal().virtualBox().GetSystemProperties().GetMaxPortCountForStorageBus(storageSlot.bus);
{
break;
}
if (storageSlot.device != 0)
{
AssertMsgFailed(("No text for bus=%d & port=%d & device=%d", storageSlot.bus, storageSlot.port, storageSlot.device));
break;
}
strResult = QApplication::translate("VBoxGlobal", "SATA Port %1", "StorageSlot").arg(storageSlot.port);
break;
}
case KStorageBus_SCSI:
{
int iMaxPort = vboxGlobal().virtualBox().GetSystemProperties().GetMaxPortCountForStorageBus(storageSlot.bus);
{
break;
}
if (storageSlot.device != 0)
{
AssertMsgFailed(("No text for bus=%d & port=%d & device=%d", storageSlot.bus, storageSlot.port, storageSlot.device));
break;
}
strResult = QApplication::translate("VBoxGlobal", "SCSI Port %1", "StorageSlot").arg(storageSlot.port);
break;
}
case KStorageBus_SAS:
{
int iMaxPort = vboxGlobal().virtualBox().GetSystemProperties().GetMaxPortCountForStorageBus(storageSlot.bus);
{
break;
}
if (storageSlot.device != 0)
{
AssertMsgFailed(("No text for bus=%d & port=%d & device=%d", storageSlot.bus, storageSlot.port, storageSlot.device));
break;
}
strResult = QApplication::translate("VBoxGlobal", "SAS Port %1", "StorageSlot").arg(storageSlot.port);
break;
}
case KStorageBus_Floppy:
{
int iMaxDevice = vboxGlobal().virtualBox().GetSystemProperties().GetMaxDevicesPerPortForStorageBus(storageSlot.bus);
if (storageSlot.port != 0)
{
break;
}
{
AssertMsgFailed(("No text for bus=%d & port=%d & device=%d", storageSlot.bus, storageSlot.port, storageSlot.device));
break;
}
strResult = QApplication::translate("VBoxGlobal", "Floppy Device %1", "StorageSlot").arg(storageSlot.device);
break;
}
case KStorageBus_USB:
{
int iMaxPort = vboxGlobal().virtualBox().GetSystemProperties().GetMaxPortCountForStorageBus(storageSlot.bus);
{
break;
}
if (storageSlot.device != 0)
{
AssertMsgFailed(("No text for bus=%d & port=%d & device=%d", storageSlot.bus, storageSlot.port, storageSlot.device));
break;
}
strResult = QApplication::translate("VBoxGlobal", "USB Port %1", "StorageSlot").arg(storageSlot.port);
break;
}
default:
{
AssertMsgFailed(("No text for bus=%d & port=%d & device=%d", storageSlot.bus, storageSlot.port, storageSlot.device));
break;
}
}
return strResult;
}
/* StorageSlot <= QString: */
{
int index = -1;
{
{
index = i;
break;
}
}
switch (index)
{
case 0:
case 1:
case 2:
case 3:
{
int iMaxDevice = vboxGlobal().virtualBox().GetSystemProperties().GetMaxDevicesPerPortForStorageBus(bus);
{
break;
}
{
break;
}
break;
}
case 4:
{
{
break;
}
break;
}
case 5:
{
{
break;
}
break;
}
case 6:
{
{
break;
}
break;
}
case 7:
{
int iMaxDevice = vboxGlobal().virtualBox().GetSystemProperties().GetMaxDevicesPerPortForStorageBus(bus);
{
break;
}
break;
}
case 8:
{
{
break;
}
break;
}
default:
{
break;
}
}
return result;
}
/* QString <= UIExtraDataMetaDefs::MenuType: */
{
switch (menuType)
{
#ifdef RT_OS_DARWIN
#endif /* RT_OS_DARWIN */
#ifdef VBOX_WITH_DEBUGGER_GUI
#endif /* VBOX_WITH_DEBUGGER_GUI */
#ifdef RT_OS_DARWIN
#endif /* RT_OS_DARWIN */
default:
{
break;
}
}
return strResult;
}
/* UIExtraDataMetaDefs::MenuType <= QString: */
template<> UIExtraDataMetaDefs::MenuType fromInternalString<UIExtraDataMetaDefs::MenuType>(const QString &strMenuType)
{
/* Here we have some fancy stuff allowing us
* to search through the keys using 'case-insensitive' rule: */
#ifdef RT_OS_DARWIN
#endif /* RT_OS_DARWIN */
#ifdef VBOX_WITH_DEBUGGER_GUI
#endif /* VBOX_WITH_DEBUGGER_GUI */
#ifdef RT_OS_DARWIN
#endif /* RT_OS_DARWIN */
/* Invalid type for unknown words: */
return UIExtraDataMetaDefs::MenuType_Invalid;
/* Corresponding type for known words: */
}
#ifdef Q_WS_MAC
/* QString <= UIExtraDataMetaDefs::MenuApplicationActionType: */
template<> QString toInternalString(const UIExtraDataMetaDefs::MenuApplicationActionType &menuApplicationActionType)
{
switch (menuApplicationActionType)
{
default:
{
break;
}
}
return strResult;
}
/* UIExtraDataMetaDefs::MenuApplicationActionType <= QString: */
template<> UIExtraDataMetaDefs::MenuApplicationActionType fromInternalString<UIExtraDataMetaDefs::MenuApplicationActionType>(const QString &strMenuApplicationActionType)
{
/* Here we have some fancy stuff allowing us
* to search through the keys using 'case-insensitive' rule: */
/* Invalid type for unknown words: */
/* Corresponding type for known words: */
}
#endif /* Q_WS_MAC */
/* QString <= UIExtraDataMetaDefs::MenuHelpActionType: */
template<> QString toInternalString(const UIExtraDataMetaDefs::MenuHelpActionType &menuHelpActionType)
{
switch (menuHelpActionType)
{
case UIExtraDataMetaDefs::MenuHelpActionType_NetworkAccessManager: strResult = "NetworkAccessManager"; break;
#endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
#ifndef Q_WS_MAC
#endif /* !Q_WS_MAC */
default:
{
break;
}
}
return strResult;
}
/* UIExtraDataMetaDefs::MenuHelpActionType <= QString: */
template<> UIExtraDataMetaDefs::MenuHelpActionType fromInternalString<UIExtraDataMetaDefs::MenuHelpActionType>(const QString &strMenuHelpActionType)
{
/* Here we have some fancy stuff allowing us
* to search through the keys using 'case-insensitive' rule: */
keys << "NetworkAccessManager"; values << UIExtraDataMetaDefs::MenuHelpActionType_NetworkAccessManager;
#endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
#ifndef Q_WS_MAC
#endif /* !Q_WS_MAC */
/* Invalid type for unknown words: */
/* Corresponding type for known words: */
}
/* QString <= UIExtraDataMetaDefs::RuntimeMenuMachineActionType: */
template<> QString toInternalString(const UIExtraDataMetaDefs::RuntimeMenuMachineActionType &runtimeMenuMachineActionType)
{
switch (runtimeMenuMachineActionType)
{
case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SettingsDialog: strResult = "SettingsDialog"; break;
case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_TakeSnapshot: strResult = "TakeSnapshot"; break;
case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_TakeScreenshot: strResult = "TakeScreenshot"; break;
case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_InformationDialog: strResult = "InformationDialog"; break;
#ifndef Q_WS_MAC
#endif /* !Q_WS_MAC */
default:
{
break;
}
}
return strResult;
}
/* UIExtraDataMetaDefs::RuntimeMenuMachineActionType <= QString: */
template<> UIExtraDataMetaDefs::RuntimeMenuMachineActionType fromInternalString<UIExtraDataMetaDefs::RuntimeMenuMachineActionType>(const QString &strRuntimeMenuMachineActionType)
{
/* Here we have some fancy stuff allowing us
* to search through the keys using 'case-insensitive' rule: */
keys << "SettingsDialog"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SettingsDialog;
keys << "TakeScreenshot"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_TakeScreenshot;
keys << "InformationDialog"; values << UIExtraDataMetaDefs::RuntimeMenuMachineActionType_InformationDialog;
#ifndef Q_WS_MAC
#endif /* !Q_WS_MAC */
/* Invalid type for unknown words: */
/* Corresponding type for known words: */
}
/* QString <= UIExtraDataMetaDefs::RuntimeMenuViewActionType: */
template<> QString toInternalString(const UIExtraDataMetaDefs::RuntimeMenuViewActionType &runtimeMenuViewActionType)
{
switch (runtimeMenuViewActionType)
{
case UIExtraDataMetaDefs::RuntimeMenuViewActionType_GuestAutoresize: strResult = "GuestAutoresize"; break;
case UIExtraDataMetaDefs::RuntimeMenuViewActionType_AdjustWindow: strResult = "AdjustWindow"; break;
case UIExtraDataMetaDefs::RuntimeMenuViewActionType_MenuBarSettings: strResult = "MenuBarSettings"; break;
case UIExtraDataMetaDefs::RuntimeMenuViewActionType_ToggleMenuBar: strResult = "ToggleMenuBar"; break;
case UIExtraDataMetaDefs::RuntimeMenuViewActionType_StatusBarSettings: strResult = "StatusBarSettings"; break;
case UIExtraDataMetaDefs::RuntimeMenuViewActionType_ToggleStatusBar: strResult = "ToggleStatusBar"; break;
default:
{
break;
}
}
return strResult;
}
/* UIExtraDataMetaDefs::RuntimeMenuViewActionType <= QString: */
template<> UIExtraDataMetaDefs::RuntimeMenuViewActionType fromInternalString<UIExtraDataMetaDefs::RuntimeMenuViewActionType>(const QString &strRuntimeMenuViewActionType)
{
/* Here we have some fancy stuff allowing us
* to search through the keys using 'case-insensitive' rule: */
keys << "GuestAutoresize"; values << UIExtraDataMetaDefs::RuntimeMenuViewActionType_GuestAutoresize;
keys << "MenuBarSettings"; values << UIExtraDataMetaDefs::RuntimeMenuViewActionType_MenuBarSettings;
keys << "StatusBarSettings"; values << UIExtraDataMetaDefs::RuntimeMenuViewActionType_StatusBarSettings;
keys << "ToggleStatusBar"; values << UIExtraDataMetaDefs::RuntimeMenuViewActionType_ToggleStatusBar;
/* Invalid type for unknown words: */
/* Corresponding type for known words: */
}
/* QString <= UIExtraDataMetaDefs::RuntimeMenuInputActionType: */
template<> QString toInternalString(const UIExtraDataMetaDefs::RuntimeMenuInputActionType &runtimeMenuInputActionType)
{
switch (runtimeMenuInputActionType)
{
case UIExtraDataMetaDefs::RuntimeMenuInputActionType_KeyboardSettings: strResult = "KeyboardSettings"; break;
case UIExtraDataMetaDefs::RuntimeMenuInputActionType_MouseIntegration: strResult = "MouseIntegration"; break;
#ifdef Q_WS_X11
#endif /* Q_WS_X11 */
default:
{
break;
}
}
return strResult;
}
/* UIExtraDataMetaDefs::RuntimeMenuInputActionType <= QString: */
template<> UIExtraDataMetaDefs::RuntimeMenuInputActionType fromInternalString<UIExtraDataMetaDefs::RuntimeMenuInputActionType>(const QString &strRuntimeMenuInputActionType)
{
/* Here we have some fancy stuff allowing us
* to search through the keys using 'case-insensitive' rule: */
keys << "KeyboardSettings"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_KeyboardSettings;
keys << "MouseIntegration"; values << UIExtraDataMetaDefs::RuntimeMenuInputActionType_MouseIntegration;
#ifdef Q_WS_X11
#endif /* Q_WS_X11 */
/* Invalid type for unknown words: */
/* Corresponding type for known words: */
}
/* QString <= UIExtraDataMetaDefs::RuntimeMenuDevicesActionType: */
template<> QString toInternalString(const UIExtraDataMetaDefs::RuntimeMenuDevicesActionType &runtimeMenuDevicesActionType)
{
switch (runtimeMenuDevicesActionType)
{
case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_HardDrivesSettings: strResult = "HardDrivesSettings"; break;
case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_OpticalDevices: strResult = "OpticalDevices"; break;
case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_FloppyDevices: strResult = "FloppyDevices"; break;
case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_NetworkSettings: strResult = "NetworkSettings"; break;
case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_USBDevicesSettings: strResult = "USBDevicesSettings"; break;
case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedClipboard: strResult = "SharedClipboard"; break;
case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_DragAndDrop: strResult = "DragAndDrop"; break;
case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedFolders: strResult = "SharedFolders"; break;
case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedFoldersSettings: strResult = "SharedFoldersSettings"; break;
case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_VideoCapture: strResult = "VideoCapture"; break;
case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_VideoCaptureSettings: strResult = "VideoCaptureSettings"; break;
case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_StartVideoCapture: strResult = "StartVideoCapture"; break;
case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_InstallGuestTools: strResult = "InstallGuestTools"; break;
default:
{
break;
}
}
return strResult;
}
/* UIExtraDataMetaDefs::RuntimeMenuDevicesActionType <= QString: */
template<> UIExtraDataMetaDefs::RuntimeMenuDevicesActionType fromInternalString<UIExtraDataMetaDefs::RuntimeMenuDevicesActionType>(const QString &strRuntimeMenuDevicesActionType)
{
/* Here we have some fancy stuff allowing us
* to search through the keys using 'case-insensitive' rule: */
keys << "HardDrivesSettings"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_HardDrivesSettings;
keys << "OpticalDevices"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_OpticalDevices;
keys << "NetworkSettings"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_NetworkSettings;
keys << "USBDevicesSettings"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_USBDevicesSettings;
keys << "SharedClipboard"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedClipboard;
keys << "SharedFoldersSettings"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedFoldersSettings;
keys << "VideoCaptureSettings"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_VideoCaptureSettings;
keys << "StartVideoCapture"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_StartVideoCapture;
keys << "InstallGuestTools"; values << UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_InstallGuestTools;
/* Invalid type for unknown words: */
/* Corresponding type for known words: */
}
#ifdef VBOX_WITH_DEBUGGER_GUI
/* QString <= UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType: */
template<> QString toInternalString(const UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType &runtimeMenuDebuggerActionType)
{
switch (runtimeMenuDebuggerActionType)
{
case UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_Statistics: strResult = "Statistics"; break;
case UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_CommandLine: strResult = "CommandLine"; break;
default:
{
break;
}
}
return strResult;
}
/* UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType <= QString: */
template<> UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType fromInternalString<UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType>(const QString &strRuntimeMenuDebuggerActionType)
{
/* Here we have some fancy stuff allowing us
* to search through the keys using 'case-insensitive' rule: */
/* Invalid type for unknown words: */
/* Corresponding type for known words: */
}
#endif /* VBOX_WITH_DEBUGGER_GUI */
#ifdef Q_WS_MAC
/* QString <= UIExtraDataMetaDefs::MenuWindowActionType: */
template<> QString toInternalString(const UIExtraDataMetaDefs::MenuWindowActionType &menuWindowActionType)
{
switch (menuWindowActionType)
{
default:
{
break;
}
}
return strResult;
}
/* UIExtraDataMetaDefs::MenuWindowActionType <= QString: */
template<> UIExtraDataMetaDefs::MenuWindowActionType fromInternalString<UIExtraDataMetaDefs::MenuWindowActionType>(const QString &strMenuWindowActionType)
{
/* Here we have some fancy stuff allowing us
* to search through the keys using 'case-insensitive' rule: */
/* Invalid type for unknown words: */
/* Corresponding type for known words: */
}
#endif /* Q_WS_MAC */
/* QString <= UIVisualStateType: */
{
switch (visualStateType)
{
default:
{
break;
}
}
return strResult;
}
/* UIVisualStateType <= QString: */
template<> UIVisualStateType fromInternalString<UIVisualStateType>(const QString &strVisualStateType)
{
/* Here we have some fancy stuff allowing us
* to search through the keys using 'case-insensitive' rule: */
/* Invalid type for unknown words: */
return UIVisualStateType_Invalid;
/* Corresponding type for known words: */
}
/* QString <= DetailsElementType: */
{
switch (detailsElementType)
{
case DetailsElementType_General: strResult = QApplication::translate("VBoxGlobal", "General", "DetailsElementType"); break;
case DetailsElementType_Preview: strResult = QApplication::translate("VBoxGlobal", "Preview", "DetailsElementType"); break;
case DetailsElementType_System: strResult = QApplication::translate("VBoxGlobal", "System", "DetailsElementType"); break;
case DetailsElementType_Display: strResult = QApplication::translate("VBoxGlobal", "Display", "DetailsElementType"); break;
case DetailsElementType_Storage: strResult = QApplication::translate("VBoxGlobal", "Storage", "DetailsElementType"); break;
case DetailsElementType_Audio: strResult = QApplication::translate("VBoxGlobal", "Audio", "DetailsElementType"); break;
case DetailsElementType_Network: strResult = QApplication::translate("VBoxGlobal", "Network", "DetailsElementType"); break;
case DetailsElementType_Serial: strResult = QApplication::translate("VBoxGlobal", "Serial ports", "DetailsElementType"); break;
#ifdef VBOX_WITH_PARALLEL_PORTS
case DetailsElementType_Parallel: strResult = QApplication::translate("VBoxGlobal", "Parallel ports", "DetailsElementType"); break;
#endif /* VBOX_WITH_PARALLEL_PORTS */
case DetailsElementType_USB: strResult = QApplication::translate("VBoxGlobal", "USB", "DetailsElementType"); break;
case DetailsElementType_SF: strResult = QApplication::translate("VBoxGlobal", "Shared folders", "DetailsElementType"); break;
case DetailsElementType_UI: strResult = QApplication::translate("VBoxGlobal", "User interface", "DetailsElementType"); break;
case DetailsElementType_Description: strResult = QApplication::translate("VBoxGlobal", "Description", "DetailsElementType"); break;
default:
{
break;
}
}
return strResult;
}
/* DetailsElementType <= QString: */
{
/* Here we have some fancy stuff allowing us
* to search through the keys using 'case-insensitive' rule: */
keys << QApplication::translate("VBoxGlobal", "General", "DetailsElementType"); values << DetailsElementType_General;
keys << QApplication::translate("VBoxGlobal", "Preview", "DetailsElementType"); values << DetailsElementType_Preview;
keys << QApplication::translate("VBoxGlobal", "System", "DetailsElementType"); values << DetailsElementType_System;
keys << QApplication::translate("VBoxGlobal", "Display", "DetailsElementType"); values << DetailsElementType_Display;
keys << QApplication::translate("VBoxGlobal", "Storage", "DetailsElementType"); values << DetailsElementType_Storage;
keys << QApplication::translate("VBoxGlobal", "Audio", "DetailsElementType"); values << DetailsElementType_Audio;
keys << QApplication::translate("VBoxGlobal", "Network", "DetailsElementType"); values << DetailsElementType_Network;
keys << QApplication::translate("VBoxGlobal", "Serial ports", "DetailsElementType"); values << DetailsElementType_Serial;
#ifdef VBOX_WITH_PARALLEL_PORTS
keys << QApplication::translate("VBoxGlobal", "Parallel ports", "DetailsElementType"); values << DetailsElementType_Parallel;
#endif /* VBOX_WITH_PARALLEL_PORTS */
keys << QApplication::translate("VBoxGlobal", "USB", "DetailsElementType"); values << DetailsElementType_USB;
keys << QApplication::translate("VBoxGlobal", "Shared folders", "DetailsElementType"); values << DetailsElementType_SF;
keys << QApplication::translate("VBoxGlobal", "User interface", "DetailsElementType"); values << DetailsElementType_UI;
keys << QApplication::translate("VBoxGlobal", "Description", "DetailsElementType"); values << DetailsElementType_Description;
/* Invalid type for unknown words: */
return DetailsElementType_Invalid;
/* Corresponding type for known words: */
}
/* QString <= DetailsElementType: */
{
switch (detailsElementType)
{
#ifdef VBOX_WITH_PARALLEL_PORTS
#endif /* VBOX_WITH_PARALLEL_PORTS */
default:
{
break;
}
}
return strResult;
}
/* DetailsElementType <= QString: */
template<> DetailsElementType fromInternalString<DetailsElementType>(const QString &strDetailsElementType)
{
/* Here we have some fancy stuff allowing us
* to search through the keys using 'case-insensitive' rule: */
#ifdef VBOX_WITH_PARALLEL_PORTS
#endif /* VBOX_WITH_PARALLEL_PORTS */
/* Invalid type for unknown words: */
return DetailsElementType_Invalid;
/* Corresponding type for known words: */
}
/* QString <= PreviewUpdateIntervalType: */
{
/* Return corresponding QString representation for passed enum value: */
switch (previewUpdateIntervalType)
{
case PreviewUpdateIntervalType_Disabled: return "disabled";
case PreviewUpdateIntervalType_500ms: return "500";
case PreviewUpdateIntervalType_1000ms: return "1000";
case PreviewUpdateIntervalType_2000ms: return "2000";
case PreviewUpdateIntervalType_5000ms: return "5000";
case PreviewUpdateIntervalType_10000ms: return "10000";
}
/* Return QString() by default: */
return QString();
}
/* PreviewUpdateIntervalType <= QString: */
template<> PreviewUpdateIntervalType fromInternalString<PreviewUpdateIntervalType>(const QString &strPreviewUpdateIntervalType)
{
/* Here we have some fancy stuff allowing us
* to search through the keys using 'case-insensitive' rule: */
/* 1000ms type for unknown words: */
return PreviewUpdateIntervalType_1000ms;
/* Corresponding type for known words: */
}
/* int <= PreviewUpdateIntervalType: */
{
/* Return corresponding integer representation for passed enum value: */
switch (previewUpdateIntervalType)
{
case PreviewUpdateIntervalType_Disabled: return 0;
case PreviewUpdateIntervalType_500ms: return 500;
case PreviewUpdateIntervalType_1000ms: return 1000;
case PreviewUpdateIntervalType_2000ms: return 2000;
case PreviewUpdateIntervalType_5000ms: return 5000;
case PreviewUpdateIntervalType_10000ms: return 10000;
}
/* Return 0 by default: */
return 0;
}
/* PreviewUpdateIntervalType <= int: */
template<> PreviewUpdateIntervalType fromInternalInteger<PreviewUpdateIntervalType>(const int &iPreviewUpdateIntervalType)
{
/* Add all the enum values into the hash: */
/* Make sure hash contains incoming integer representation: */
/* Return corresponding enum value for passed integer representation: */
}
/* QString <= GlobalSettingsPageType: */
{
switch (globalSettingsPageType)
{
#endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
#endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
default:
{
break;
}
}
return strResult;
}
/* GlobalSettingsPageType <= QString: */
template<> GlobalSettingsPageType fromInternalString<GlobalSettingsPageType>(const QString &strGlobalSettingsPageType)
{
/* Here we have some fancy stuff allowing us
* to search through the keys using 'case-insensitive' rule: */
#endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
#endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
/* Invalid type for unknown words: */
return GlobalSettingsPageType_Invalid;
/* Corresponding type for known words: */
}
/* QPixmap <= GlobalSettingsPageType: */
{
switch (type)
{
#endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
case GlobalSettingsPageType_Extensions: return UIIconPool::pixmap(":/extension_pack_warning_16px.png");
#endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
}
return QPixmap();
}
/* QString <= MachineSettingsPageType: */
{
switch (machineSettingsPageType)
{
default:
{
break;
}
}
return strResult;
}
/* MachineSettingsPageType <= QString: */
template<> MachineSettingsPageType fromInternalString<MachineSettingsPageType>(const QString &strMachineSettingsPageType)
{
/* Here we have some fancy stuff allowing us
* to search through the keys using 'case-insensitive' rule: */
/* Invalid type for unknown words: */
return MachineSettingsPageType_Invalid;
/* Corresponding type for known words: */
}
/* QPixmap <= MachineSettingsPageType: */
{
switch (type)
{
case MachineSettingsPageType_Parallel: return UIIconPool::pixmap(":/parallel_port_warning_16px.png");
}
return QPixmap();
}
/* QString <= WizardType: */
{
switch (wizardType)
{
default:
{
break;
}
}
return strResult;
}
/* WizardType <= QString: */
{
/* Here we have some fancy stuff allowing us
* to search through the keys using 'case-insensitive' rule: */
/* Invalid type for unknown words: */
return WizardType_Invalid;
/* Corresponding type for known words: */
}
/* QString <= IndicatorType: */
{
switch (indicatorType)
{
default:
{
break;
}
}
return strResult;
}
/* IndicatorType <= QString: */
{
/* Here we have some fancy stuff allowing us
* to search through the keys using 'case-insensitive' rule: */
/* Invalid type for unknown words: */
return IndicatorType_Invalid;
/* Corresponding type for known words: */
}
/* QIcon <= IndicatorType: */
{
switch (indicatorType)
{
default:
{
break;
}
}
return QIcon();
}
/* QString <= MachineCloseAction: */
{
switch (machineCloseAction)
{
default:
{
break;
}
}
return strResult;
}
/* MachineCloseAction <= QString: */
template<> MachineCloseAction fromInternalString<MachineCloseAction>(const QString &strMachineCloseAction)
{
/* Here we have some fancy stuff allowing us
* to search through the keys using 'case-insensitive' rule: */
/* Invalid type for unknown words: */
return MachineCloseAction_Invalid;
/* Corresponding type for known words: */
}
/* QString <= MouseCapturePolicy: */
{
/* Return corresponding QString representation for passed enum value: */
switch (mouseCapturePolicy)
{
case MouseCapturePolicy_Default: return "Default";
case MouseCapturePolicy_HostComboOnly: return "HostComboOnly";
case MouseCapturePolicy_Disabled: return "Disabled";
}
/* Return QString() by default: */
return QString();
}
/* MouseCapturePolicy <= QString: */
template<> MouseCapturePolicy fromInternalString<MouseCapturePolicy>(const QString &strMouseCapturePolicy)
{
/* Here we have some fancy stuff allowing us
* to search through the keys using 'case-insensitive' rule: */
/* Default type for unknown words: */
return MouseCapturePolicy_Default;
/* Corresponding type for known words: */
}
/* QString <= GuruMeditationHandlerType: */
{
switch (guruMeditationHandlerType)
{
default:
{
break;
}
}
return strResult;
}
/* GuruMeditationHandlerType <= QString: */
template<> GuruMeditationHandlerType fromInternalString<GuruMeditationHandlerType>(const QString &strGuruMeditationHandlerType)
{
/* Here we have some fancy stuff allowing us
* to search through the keys using 'case-insensitive' rule: */
/* Default type for unknown words: */
/* Corresponding type for known words: */
}
/* QString <= HiDPIOptimizationType: */
{
switch (optimizationType)
{
default:
{
break;
}
}
return strResult;
}
/* HiDPIOptimizationType <= QString: */
template<> HiDPIOptimizationType fromInternalString<HiDPIOptimizationType>(const QString &strOptimizationType)
{
/* Here we have some fancy stuff allowing us
* to search through the keys using 'case-insensitive' rule: */
/* Corresponding type for known words: */
}
/* QString <= MiniToolbarAlignment: */
{
/* Return corresponding QString representation for passed enum value: */
switch (miniToolbarAlignment)
{
case MiniToolbarAlignment_Bottom: return "Bottom";
case MiniToolbarAlignment_Top: return "Top";
}
/* Return QString() by default: */
return QString();
}
/* MiniToolbarAlignment <= QString: */
template<> MiniToolbarAlignment fromInternalString<MiniToolbarAlignment>(const QString &strMiniToolbarAlignment)
{
/* Here we have some fancy stuff allowing us
* to search through the keys using 'case-insensitive' rule: */
/* Bottom type for unknown words: */
return MiniToolbarAlignment_Bottom;
/* Corresponding type for known words: */
}