VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp@ 103131

Last change on this file since 103131 was 101035, checked in by vboxsync, 17 months ago

Initial commit (based draft v2 / on patch v5) for implementing platform architecture support for x86 and ARM. bugref:10384

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
  • Property svn:mergeinfo set to (toggle deleted branches)
    /branches/VBox-3.0/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp58652,​70973
    /branches/VBox-3.2/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp66309,​66318
    /branches/VBox-4.0/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp70873
    /branches/VBox-4.1/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp74233
    /branches/VBox-4.2/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp91503-91504,​91506-91508,​91510,​91514-91515,​91521
    /branches/VBox-4.3/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp91223
    /branches/VBox-4.3/trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp91223
    /branches/dsen/gui/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp79076-79078,​79089,​79109-79110,​79112-79113,​79127-79130,​79134,​79141,​79151,​79155,​79157-79159,​79193,​79197
    /branches/dsen/gui2/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp79224,​79228,​79233,​79235,​79258,​79262-79263,​79273,​79341,​79345,​79354,​79357,​79387-79388,​79559-79569,​79572-79573,​79578,​79581-79582,​79590-79591,​79598-79599,​79602-79603,​79605-79606,​79632,​79635,​79637,​79644
    /branches/dsen/gui3/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp79645-79692
File size: 154.0 KB
Line 
1/* $Id: UIConverterBackendGlobal.cpp 101035 2023-09-07 08:59:15Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIConverterBackendGlobal implementation.
4 */
5
6/*
7 * Copyright (C) 2012-2023 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28/* Qt includes: */
29#include <QApplication>
30#include <QHash>
31#include <QRegExp>
32#include <QRegularExpression>
33
34/* GUI includes: */
35#include "UICommon.h"
36#include "UIConverterBackend.h"
37#include "UIIconPool.h"
38
39/* COM includes: */
40#include "CPlatformProperties.h"
41
42
43/* Determines if <Object of type X> can be converted to object of other type.
44 * These functions returns 'true' for all allowed conversions. */
45template<> bool canConvert<Qt::Alignment>() { return true; }
46template<> bool canConvert<Qt::SortOrder>() { return true; }
47template<> bool canConvert<SizeSuffix>() { return true; }
48template<> bool canConvert<StorageSlot>() { return true; }
49template<> bool canConvert<DesktopWatchdogPolicy_SynthTest>() { return true; }
50template<> bool canConvert<UIExtraDataMetaDefs::DialogType>() { return true; }
51template<> bool canConvert<UIExtraDataMetaDefs::MenuType>() { return true; }
52template<> bool canConvert<UIExtraDataMetaDefs::MenuApplicationActionType>() { return true; }
53template<> bool canConvert<UIExtraDataMetaDefs::MenuHelpActionType>() { return true; }
54template<> bool canConvert<UIExtraDataMetaDefs::RuntimeMenuMachineActionType>() { return true; }
55template<> bool canConvert<UIExtraDataMetaDefs::RuntimeMenuViewActionType>() { return true; }
56template<> bool canConvert<UIExtraDataMetaDefs::RuntimeMenuInputActionType>() { return true; }
57template<> bool canConvert<UIExtraDataMetaDefs::RuntimeMenuDevicesActionType>() { return true; }
58#ifdef VBOX_WITH_DEBUGGER_GUI
59template<> bool canConvert<UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType>() { return true; }
60#endif /* VBOX_WITH_DEBUGGER_GUI */
61#ifdef VBOX_WS_MAC
62template<> bool canConvert<UIExtraDataMetaDefs::MenuWindowActionType>() { return true; }
63#endif /* VBOX_WS_MAC */
64template<> bool canConvert<UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral>() { return true; }
65template<> bool canConvert<UIExtraDataMetaDefs::DetailsElementOptionTypeSystem>() { return true; }
66template<> bool canConvert<UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay>() { return true; }
67template<> bool canConvert<UIExtraDataMetaDefs::DetailsElementOptionTypeStorage>() { return true; }
68template<> bool canConvert<UIExtraDataMetaDefs::DetailsElementOptionTypeAudio>() { return true; }
69template<> bool canConvert<UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork>() { return true; }
70template<> bool canConvert<UIExtraDataMetaDefs::DetailsElementOptionTypeSerial>() { return true; }
71template<> bool canConvert<UIExtraDataMetaDefs::DetailsElementOptionTypeUsb>() { return true; }
72template<> bool canConvert<UIExtraDataMetaDefs::DetailsElementOptionTypeSharedFolders>() { return true; }
73template<> bool canConvert<UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface>() { return true; }
74template<> bool canConvert<UIExtraDataMetaDefs::DetailsElementOptionTypeDescription>() { return true; }
75template<> bool canConvert<UIColorThemeType>() { return true; }
76template<> bool canConvert<UILaunchMode>() { return true; }
77template<> bool canConvert<UIToolType>() { return true; }
78template<> bool canConvert<UIVisualStateType>() { return true; }
79template<> bool canConvert<DetailsElementType>() { return true; }
80template<> bool canConvert<PreviewUpdateIntervalType>() { return true; }
81template<> bool canConvert<UIDiskEncryptionCipherType>() { return true; }
82template<> bool canConvert<GUIFeatureType>() { return true; }
83template<> bool canConvert<GlobalSettingsPageType>() { return true; }
84template<> bool canConvert<MachineSettingsPageType>() { return true; }
85template<> bool canConvert<UIRemoteMode>() { return true; }
86template<> bool canConvert<WizardType>() { return true; }
87template<> bool canConvert<IndicatorType>() { return true; }
88template<> bool canConvert<MachineCloseAction>() { return true; }
89template<> bool canConvert<MouseCapturePolicy>() { return true; }
90template<> bool canConvert<GuruMeditationHandlerType>() { return true; }
91template<> bool canConvert<ScalingOptimizationType>() { return true; }
92#ifndef VBOX_WS_MAC
93template<> bool canConvert<MiniToolbarAlignment>() { return true; }
94#endif
95template<> bool canConvert<InformationElementType>() { return true; }
96template<> bool canConvert<MaximumGuestScreenSizePolicy>() { return true; }
97template<> bool canConvert<UIMediumFormat>() { return true; }
98template<> bool canConvert<UISettingsDefs::RecordingMode>() { return true; }
99template<> bool canConvert<VMActivityOverviewColumn>(){ return true; };
100
101
102/* QString <= Qt::Alignment: */
103template<> QString toInternalString(const Qt::Alignment &enmAlignment)
104{
105 QString strResult;
106 switch (enmAlignment)
107 {
108 case Qt::AlignTop: strResult = "Top"; break;
109 case Qt::AlignBottom: strResult = "Bottom"; break;
110 default:
111 {
112 AssertMsgFailed(("No text for alignment=%d", enmAlignment));
113 break;
114 }
115 }
116 return strResult;
117}
118
119/* Qt::Alignment <= QString: */
120template<> Qt::Alignment fromInternalString<Qt::Alignment>(const QString &strAlignment)
121{
122 if (strAlignment.compare("Top", Qt::CaseInsensitive) == 0)
123 return Qt::AlignTop;
124 if (strAlignment.compare("Bottom", Qt::CaseInsensitive) == 0)
125 return Qt::AlignBottom;
126 return Qt::AlignTop;
127}
128
129/* QString <= Qt::SortOrder: */
130template<> QString toInternalString(const Qt::SortOrder &enmSortOrder)
131{
132 QString strResult;
133 switch (enmSortOrder)
134 {
135 case Qt::AscendingOrder: strResult = "Ascending"; break;
136 case Qt::DescendingOrder: strResult = "Descending"; break;
137 default:
138 {
139 AssertMsgFailed(("No text for sort order=%d", enmSortOrder));
140 break;
141 }
142 }
143 return strResult;
144}
145
146/* Qt::SortOrder <= QString: */
147template<> Qt::SortOrder fromInternalString<Qt::SortOrder>(const QString &strSortOrder)
148{
149 if (strSortOrder.compare("Ascending", Qt::CaseInsensitive) == 0)
150 return Qt::AscendingOrder;
151 if (strSortOrder.compare("Descending", Qt::CaseInsensitive) == 0)
152 return Qt::DescendingOrder;
153 return Qt::AscendingOrder;
154}
155
156/* QString <= SizeSuffix: */
157template<> QString toString(const SizeSuffix &sizeSuffix)
158{
159 QString strResult;
160 switch (sizeSuffix)
161 {
162 case SizeSuffix_Byte: strResult = QApplication::translate("UICommon", "B", "size suffix Bytes"); break;
163 case SizeSuffix_KiloByte: strResult = QApplication::translate("UICommon", "KB", "size suffix KBytes=1024 Bytes"); break;
164 case SizeSuffix_MegaByte: strResult = QApplication::translate("UICommon", "MB", "size suffix MBytes=1024 KBytes"); break;
165 case SizeSuffix_GigaByte: strResult = QApplication::translate("UICommon", "GB", "size suffix GBytes=1024 MBytes"); break;
166 case SizeSuffix_TeraByte: strResult = QApplication::translate("UICommon", "TB", "size suffix TBytes=1024 GBytes"); break;
167 case SizeSuffix_PetaByte: strResult = QApplication::translate("UICommon", "PB", "size suffix PBytes=1024 TBytes"); break;
168 default:
169 {
170 AssertMsgFailed(("No text for size suffix=%d", sizeSuffix));
171 break;
172 }
173 }
174 return strResult;
175}
176
177/* SizeSuffix <= QString: */
178template<> SizeSuffix fromString<SizeSuffix>(const QString &strSizeSuffix)
179{
180 QHash<QString, SizeSuffix> list;
181 list.insert(QApplication::translate("UICommon", "B", "size suffix Bytes"), SizeSuffix_Byte);
182 list.insert(QApplication::translate("UICommon", "KB", "size suffix KBytes=1024 Bytes"), SizeSuffix_KiloByte);
183 list.insert(QApplication::translate("UICommon", "MB", "size suffix MBytes=1024 KBytes"), SizeSuffix_MegaByte);
184 list.insert(QApplication::translate("UICommon", "GB", "size suffix GBytes=1024 MBytes"), SizeSuffix_GigaByte);
185 list.insert(QApplication::translate("UICommon", "TB", "size suffix TBytes=1024 GBytes"), SizeSuffix_TeraByte);
186 list.insert(QApplication::translate("UICommon", "PB", "size suffix PBytes=1024 TBytes"), SizeSuffix_PetaByte);
187 if (!list.contains(strSizeSuffix))
188 {
189 AssertMsgFailed(("No value for '%s'", strSizeSuffix.toUtf8().constData()));
190 }
191 return list.value(strSizeSuffix);
192}
193
194/* QString <= StorageSlot: */
195template<> QString toString(const StorageSlot &storageSlot)
196{
197 QString strResult;
198 switch (storageSlot.bus)
199 {
200 case KStorageBus_IDE:
201 {
202 int iMaxPort = uiCommon().virtualBox().GetPlatformProperties(KPlatformArchitecture_x86).GetMaxPortCountForStorageBus(storageSlot.bus);
203 int iMaxDevice = uiCommon().virtualBox().GetPlatformProperties(KPlatformArchitecture_x86).GetMaxDevicesPerPortForStorageBus(storageSlot.bus);
204 if (storageSlot.port < 0 || storageSlot.port > iMaxPort)
205 {
206 AssertMsgFailed(("No text for bus=%d & port=%d", storageSlot.bus, storageSlot.port));
207 break;
208 }
209 if (storageSlot.device < 0 || storageSlot.device > iMaxDevice)
210 {
211 AssertMsgFailed(("No text for bus=%d & port=%d & device=%d", storageSlot.bus, storageSlot.port, storageSlot.device));
212 break;
213 }
214 if (storageSlot.port == 0 && storageSlot.device == 0)
215 strResult = QApplication::translate("UICommon", "IDE Primary Device 0", "StorageSlot");
216 else if (storageSlot.port == 0 && storageSlot.device == 1)
217 strResult = QApplication::translate("UICommon", "IDE Primary Device 1", "StorageSlot");
218 else if (storageSlot.port == 1 && storageSlot.device == 0)
219 strResult = QApplication::translate("UICommon", "IDE Secondary Device 0", "StorageSlot");
220 else if (storageSlot.port == 1 && storageSlot.device == 1)
221 strResult = QApplication::translate("UICommon", "IDE Secondary Device 1", "StorageSlot");
222 break;
223 }
224 case KStorageBus_SATA:
225 {
226 int iMaxPort = uiCommon().virtualBox().GetPlatformProperties(KPlatformArchitecture_x86).GetMaxPortCountForStorageBus(storageSlot.bus);
227 if (storageSlot.port < 0 || storageSlot.port > iMaxPort)
228 {
229 AssertMsgFailed(("No text for bus=%d & port=%d", storageSlot.bus, storageSlot.port));
230 break;
231 }
232 if (storageSlot.device != 0)
233 {
234 AssertMsgFailed(("No text for bus=%d & port=%d & device=%d", storageSlot.bus, storageSlot.port, storageSlot.device));
235 break;
236 }
237 strResult = QApplication::translate("UICommon", "SATA Port %1", "StorageSlot").arg(storageSlot.port);
238 break;
239 }
240 case KStorageBus_SCSI:
241 {
242 int iMaxPort = uiCommon().virtualBox().GetPlatformProperties(KPlatformArchitecture_x86).GetMaxPortCountForStorageBus(storageSlot.bus);
243 if (storageSlot.port < 0 || storageSlot.port > iMaxPort)
244 {
245 AssertMsgFailed(("No text for bus=%d & port=%d", storageSlot.bus, storageSlot.port));
246 break;
247 }
248 if (storageSlot.device != 0)
249 {
250 AssertMsgFailed(("No text for bus=%d & port=%d & device=%d", storageSlot.bus, storageSlot.port, storageSlot.device));
251 break;
252 }
253 strResult = QApplication::translate("UICommon", "SCSI Port %1", "StorageSlot").arg(storageSlot.port);
254 break;
255 }
256 case KStorageBus_SAS:
257 {
258 int iMaxPort = uiCommon().virtualBox().GetPlatformProperties(KPlatformArchitecture_x86).GetMaxPortCountForStorageBus(storageSlot.bus);
259 if (storageSlot.port < 0 || storageSlot.port > iMaxPort)
260 {
261 AssertMsgFailed(("No text for bus=%d & port=%d", storageSlot.bus, storageSlot.port));
262 break;
263 }
264 if (storageSlot.device != 0)
265 {
266 AssertMsgFailed(("No text for bus=%d & port=%d & device=%d", storageSlot.bus, storageSlot.port, storageSlot.device));
267 break;
268 }
269 strResult = QApplication::translate("UICommon", "SAS Port %1", "StorageSlot").arg(storageSlot.port);
270 break;
271 }
272 case KStorageBus_Floppy:
273 {
274 int iMaxDevice = uiCommon().virtualBox().GetPlatformProperties(KPlatformArchitecture_x86).GetMaxDevicesPerPortForStorageBus(storageSlot.bus);
275 if (storageSlot.port != 0)
276 {
277 AssertMsgFailed(("No text for bus=%d & port=%d", storageSlot.bus, storageSlot.port));
278 break;
279 }
280 if (storageSlot.device < 0 || storageSlot.device > iMaxDevice)
281 {
282 AssertMsgFailed(("No text for bus=%d & port=%d & device=%d", storageSlot.bus, storageSlot.port, storageSlot.device));
283 break;
284 }
285 strResult = QApplication::translate("UICommon", "Floppy Device %1", "StorageSlot").arg(storageSlot.device);
286 break;
287 }
288 case KStorageBus_USB:
289 {
290 int iMaxPort = uiCommon().virtualBox().GetPlatformProperties(KPlatformArchitecture_x86).GetMaxPortCountForStorageBus(storageSlot.bus);
291 if (storageSlot.port < 0 || storageSlot.port > iMaxPort)
292 {
293 AssertMsgFailed(("No text for bus=%d & port=%d", storageSlot.bus, storageSlot.port));
294 break;
295 }
296 if (storageSlot.device != 0)
297 {
298 AssertMsgFailed(("No text for bus=%d & port=%d & device=%d", storageSlot.bus, storageSlot.port, storageSlot.device));
299 break;
300 }
301 strResult = QApplication::translate("UICommon", "USB Port %1", "StorageSlot").arg(storageSlot.port);
302 break;
303 }
304 case KStorageBus_PCIe:
305 {
306 int iMaxPort = uiCommon().virtualBox().GetPlatformProperties(KPlatformArchitecture_x86).GetMaxPortCountForStorageBus(storageSlot.bus);
307 if (storageSlot.port < 0 || storageSlot.port > iMaxPort)
308 {
309 AssertMsgFailed(("No text for bus=%d & port=%d", storageSlot.bus, storageSlot.port));
310 break;
311 }
312 if (storageSlot.device != 0)
313 {
314 AssertMsgFailed(("No text for bus=%d & port=%d & device=%d", storageSlot.bus, storageSlot.port, storageSlot.device));
315 break;
316 }
317 strResult = QApplication::translate("UICommon", "NVMe Port %1", "StorageSlot").arg(storageSlot.port);
318 break;
319 }
320 case KStorageBus_VirtioSCSI:
321 {
322 int iMaxPort = uiCommon().virtualBox().GetPlatformProperties(KPlatformArchitecture_x86).GetMaxPortCountForStorageBus(storageSlot.bus);
323 if (storageSlot.port < 0 || storageSlot.port > iMaxPort)
324 {
325 AssertMsgFailed(("No text for bus=%d & port=%d", storageSlot.bus, storageSlot.port));
326 break;
327 }
328 if (storageSlot.device != 0)
329 {
330 AssertMsgFailed(("No text for bus=%d & port=%d & device=%d", storageSlot.bus, storageSlot.port, storageSlot.device));
331 break;
332 }
333 strResult = QApplication::translate("UICommon", "virtio-scsi Port %1", "StorageSlot").arg(storageSlot.port);
334 break;
335 }
336 default:
337 {
338 AssertMsgFailed(("No text for bus=%d & port=%d & device=%d", storageSlot.bus, storageSlot.port, storageSlot.device));
339 break;
340 }
341 }
342 return strResult;
343}
344
345/* StorageSlot <= QString: */
346template<> StorageSlot fromString<StorageSlot>(const QString &strStorageSlot)
347{
348 /* Prepare a hash of known port templates: */
349 QHash<int, QString> templates;
350 templates[0] = QApplication::translate("UICommon", "IDE Primary Device 0", "StorageSlot");
351 templates[1] = QApplication::translate("UICommon", "IDE Primary Device 1", "StorageSlot");
352 templates[2] = QApplication::translate("UICommon", "IDE Secondary Device 0", "StorageSlot");
353 templates[3] = QApplication::translate("UICommon", "IDE Secondary Device 1", "StorageSlot");
354 templates[4] = QApplication::translate("UICommon", "SATA Port %1", "StorageSlot");
355 templates[5] = QApplication::translate("UICommon", "SCSI Port %1", "StorageSlot");
356 templates[6] = QApplication::translate("UICommon", "SAS Port %1", "StorageSlot");
357 templates[7] = QApplication::translate("UICommon", "Floppy Device %1", "StorageSlot");
358 templates[8] = QApplication::translate("UICommon", "USB Port %1", "StorageSlot");
359 templates[9] = QApplication::translate("UICommon", "NVMe Port %1", "StorageSlot");
360 templates[10] = QApplication::translate("UICommon", "virtio-scsi Port %1", "StorageSlot");
361
362 /* Search for a template index strStorageSlot corresponds to: */
363 int iIndex = -1;
364 QRegExp regExp;
365 for (int i = 0; i < templates.size(); ++i)
366 {
367 regExp = QRegExp(i >= 0 && i <= 3 ? templates.value(i) : templates.value(i).arg("(\\d+)"));
368 if (regExp.indexIn(strStorageSlot) != -1)
369 {
370 iIndex = i;
371 break;
372 }
373 }
374
375 /* Compose result: */
376 StorageSlot result;
377
378 /* First we determine bus type: */
379 switch (iIndex)
380 {
381 case 0:
382 case 1:
383 case 2:
384 case 3: result.bus = KStorageBus_IDE; break;
385 case 4: result.bus = KStorageBus_SATA; break;
386 case 5: result.bus = KStorageBus_SCSI; break;
387 case 6: result.bus = KStorageBus_SAS; break;
388 case 7: result.bus = KStorageBus_Floppy; break;
389 case 8: result.bus = KStorageBus_USB; break;
390 case 9: result.bus = KStorageBus_PCIe; break;
391 case 10: result.bus = KStorageBus_VirtioSCSI; break;
392 default: AssertMsgFailed(("No storage bus for text='%s'", strStorageSlot.toUtf8().constData())); break;
393 }
394
395 /* Second we determine port/device pair: */
396 switch (iIndex)
397 {
398 case 0:
399 case 1:
400 case 2:
401 case 3:
402 {
403 if (result.bus == KStorageBus_Null)
404 break;
405 const int iMaxPort = uiCommon().virtualBox().GetPlatformProperties(KPlatformArchitecture_x86).GetMaxPortCountForStorageBus(result.bus);
406 const int iMaxDevice = uiCommon().virtualBox().GetPlatformProperties(KPlatformArchitecture_x86).GetMaxDevicesPerPortForStorageBus(result.bus);
407 const LONG iPort = iIndex / iMaxPort;
408 const LONG iDevice = iIndex % iMaxPort;
409 if (iPort < 0 || iPort > iMaxPort)
410 {
411 AssertMsgFailed(("No storage port for text='%s'", strStorageSlot.toUtf8().constData()));
412 break;
413 }
414 if (iDevice < 0 || iDevice > iMaxDevice)
415 {
416 AssertMsgFailed(("No storage device for text='%s'", strStorageSlot.toUtf8().constData()));
417 break;
418 }
419 result.port = iPort;
420 result.device = iDevice;
421 break;
422 }
423 case 4:
424 case 5:
425 case 6:
426 case 7:
427 case 8:
428 case 9:
429 case 10:
430 {
431 if (result.bus == KStorageBus_Null)
432 break;
433 const int iMaxPort = uiCommon().virtualBox().GetPlatformProperties(KPlatformArchitecture_x86).GetMaxPortCountForStorageBus(result.bus);
434 const LONG iPort = regExp.cap(1).toInt();
435 const LONG iDevice = 0;
436 if (iPort < 0 || iPort > iMaxPort)
437 {
438 AssertMsgFailed(("No storage port for text='%s'", strStorageSlot.toUtf8().constData()));
439 break;
440 }
441 result.port = iPort;
442 result.device = iDevice;
443 break;
444 }
445 default:
446 {
447 AssertMsgFailed(("No storage slot for text='%s'", strStorageSlot.toUtf8().constData()));
448 break;
449 }
450 }
451
452 /* Return result: */
453 return result;
454}
455
456/* DesktopWatchdogPolicy_SynthTest <= QString: */
457template<> DesktopWatchdogPolicy_SynthTest fromInternalString<DesktopWatchdogPolicy_SynthTest>(const QString &strPolicyType)
458{
459 if (strPolicyType.compare("Disabled", Qt::CaseInsensitive) == 0)
460 return DesktopWatchdogPolicy_SynthTest_Disabled;
461 if (strPolicyType.compare("ManagerOnly", Qt::CaseInsensitive) == 0)
462 return DesktopWatchdogPolicy_SynthTest_ManagerOnly;
463 if (strPolicyType.compare("MachineOnly", Qt::CaseInsensitive) == 0)
464 return DesktopWatchdogPolicy_SynthTest_MachineOnly;
465 if (strPolicyType.compare("Both", Qt::CaseInsensitive) == 0)
466 return DesktopWatchdogPolicy_SynthTest_Both;
467 return DesktopWatchdogPolicy_SynthTest_Both;
468}
469
470/* QString <= UIExtraDataMetaDefs::DialogType: */
471template<> QString toInternalString(const UIExtraDataMetaDefs::DialogType &enmDialogType)
472{
473 QString strResult;
474 switch (enmDialogType)
475 {
476 case UIExtraDataMetaDefs::DialogType_VISOCreator: strResult = "VISOCreator"; break;
477 case UIExtraDataMetaDefs::DialogType_BootFailure: strResult = "BootFailure"; break;
478 case UIExtraDataMetaDefs::DialogType_All: strResult = "All"; break;
479 default:
480 {
481 AssertMsgFailed(("No text for dialog type=%d", enmDialogType));
482 break;
483 }
484 }
485 return strResult;
486}
487
488/* UIExtraDataMetaDefs::DialogType <= QString: */
489template<> UIExtraDataMetaDefs::DialogType fromInternalString<UIExtraDataMetaDefs::DialogType>(const QString &strDialogType)
490{
491 if (strDialogType.compare("VISOCreator", Qt::CaseInsensitive) == 0)
492 return UIExtraDataMetaDefs::DialogType_VISOCreator;
493 if (strDialogType.compare("BootFailure", Qt::CaseInsensitive) == 0)
494 return UIExtraDataMetaDefs::DialogType_BootFailure;
495 if (strDialogType.compare("All", Qt::CaseInsensitive) == 0)
496 return UIExtraDataMetaDefs::DialogType_All;
497 return UIExtraDataMetaDefs::DialogType_Invalid;
498}
499
500/* QString <= UIExtraDataMetaDefs::MenuType: */
501template<> QString toInternalString(const UIExtraDataMetaDefs::MenuType &menuType)
502{
503 QString strResult;
504 switch (menuType)
505 {
506 case UIExtraDataMetaDefs::MenuType_Application: strResult = "Application"; break;
507 case UIExtraDataMetaDefs::MenuType_Machine: strResult = "Machine"; break;
508 case UIExtraDataMetaDefs::MenuType_View: strResult = "View"; break;
509 case UIExtraDataMetaDefs::MenuType_Input: strResult = "Input"; break;
510 case UIExtraDataMetaDefs::MenuType_Devices: strResult = "Devices"; break;
511#ifdef VBOX_WITH_DEBUGGER_GUI
512 case UIExtraDataMetaDefs::MenuType_Debug: strResult = "Debug"; break;
513#endif /* VBOX_WITH_DEBUGGER_GUI */
514#ifdef RT_OS_DARWIN
515 case UIExtraDataMetaDefs::MenuType_Window: strResult = "Window"; break;
516#endif /* RT_OS_DARWIN */
517 case UIExtraDataMetaDefs::MenuType_Help: strResult = "Help"; break;
518 case UIExtraDataMetaDefs::MenuType_All: strResult = "All"; break;
519 default:
520 {
521 AssertMsgFailed(("No text for indicator type=%d", menuType));
522 break;
523 }
524 }
525 return strResult;
526}
527
528/* UIExtraDataMetaDefs::MenuType <= QString: */
529template<> UIExtraDataMetaDefs::MenuType fromInternalString<UIExtraDataMetaDefs::MenuType>(const QString &strMenuType)
530{
531 if (strMenuType.compare("Application", Qt::CaseInsensitive) == 0) return UIExtraDataMetaDefs::MenuType_Application;
532 if (strMenuType.compare("Machine", Qt::CaseInsensitive) == 0) return UIExtraDataMetaDefs::MenuType_Machine;
533 if (strMenuType.compare("View", Qt::CaseInsensitive) == 0) return UIExtraDataMetaDefs::MenuType_View;
534 if (strMenuType.compare("Input", Qt::CaseInsensitive) == 0) return UIExtraDataMetaDefs::MenuType_Input;
535 if (strMenuType.compare("Devices", Qt::CaseInsensitive) == 0) return UIExtraDataMetaDefs::MenuType_Devices;
536#ifdef VBOX_WITH_DEBUGGER_GUI
537 if (strMenuType.compare("Debug", Qt::CaseInsensitive) == 0) return UIExtraDataMetaDefs::MenuType_Debug;
538#endif
539#ifdef RT_OS_DARWIN
540 if (strMenuType.compare("Window", Qt::CaseInsensitive) == 0) return UIExtraDataMetaDefs::MenuType_Window;
541#endif
542 if (strMenuType.compare("Help", Qt::CaseInsensitive) == 0) return UIExtraDataMetaDefs::MenuType_Help;
543 if (strMenuType.compare("All", Qt::CaseInsensitive) == 0) return UIExtraDataMetaDefs::MenuType_All;
544 return UIExtraDataMetaDefs::MenuType_Invalid;
545}
546
547/* QString <= UIExtraDataMetaDefs::MenuApplicationActionType: */
548template<> QString toInternalString(const UIExtraDataMetaDefs::MenuApplicationActionType &menuApplicationActionType)
549{
550 QString strResult;
551 switch (menuApplicationActionType)
552 {
553#ifdef VBOX_WS_MAC
554 case UIExtraDataMetaDefs::MenuApplicationActionType_About: strResult = "About"; break;
555#endif /* VBOX_WS_MAC */
556 case UIExtraDataMetaDefs::MenuApplicationActionType_Preferences: strResult = "Preferences"; break;
557#ifdef VBOX_GUI_WITH_NETWORK_MANAGER
558 case UIExtraDataMetaDefs::MenuApplicationActionType_NetworkAccessManager: strResult = "NetworkAccessManager"; break;
559 case UIExtraDataMetaDefs::MenuApplicationActionType_CheckForUpdates: strResult = "CheckForUpdates"; break;
560#endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
561 case UIExtraDataMetaDefs::MenuApplicationActionType_ResetWarnings: strResult = "ResetWarnings"; break;
562 case UIExtraDataMetaDefs::MenuApplicationActionType_Close: strResult = "Close"; break;
563 case UIExtraDataMetaDefs::MenuApplicationActionType_All: strResult = "All"; break;
564 default:
565 {
566 AssertMsgFailed(("No text for action type=%d", menuApplicationActionType));
567 break;
568 }
569 }
570 return strResult;
571}
572
573/* UIExtraDataMetaDefs::MenuApplicationActionType <= QString: */
574template<> UIExtraDataMetaDefs::MenuApplicationActionType
575fromInternalString<UIExtraDataMetaDefs::MenuApplicationActionType>(const QString &strMenuApplicationActionType)
576{
577#ifdef VBOX_WS_MAC
578 if (strMenuApplicationActionType.compare("About", Qt::CaseInsensitive) == 0)
579 return UIExtraDataMetaDefs::MenuApplicationActionType_About;
580#endif
581 if (strMenuApplicationActionType.compare("Preferences", Qt::CaseInsensitive) == 0)
582 return UIExtraDataMetaDefs::MenuApplicationActionType_Preferences;
583#ifdef VBOX_GUI_WITH_NETWORK_MANAGER
584 if (strMenuApplicationActionType.compare("NetworkAccessManager", Qt::CaseInsensitive) == 0)
585 return UIExtraDataMetaDefs::MenuApplicationActionType_NetworkAccessManager;
586 if (strMenuApplicationActionType.compare("CheckForUpdates", Qt::CaseInsensitive) == 0)
587 return UIExtraDataMetaDefs::MenuApplicationActionType_CheckForUpdates;
588#endif
589 if (strMenuApplicationActionType.compare("ResetWarnings", Qt::CaseInsensitive) == 0)
590 return UIExtraDataMetaDefs::MenuApplicationActionType_ResetWarnings;
591 if (strMenuApplicationActionType.compare("Close", Qt::CaseInsensitive) == 0)
592 return UIExtraDataMetaDefs::MenuApplicationActionType_Close;
593 if (strMenuApplicationActionType.compare("All", Qt::CaseInsensitive) == 0)
594 return UIExtraDataMetaDefs::MenuApplicationActionType_All;
595 return UIExtraDataMetaDefs::MenuApplicationActionType_Invalid;
596}
597
598/* QString <= UIExtraDataMetaDefs::MenuHelpActionType: */
599template<> QString toInternalString(const UIExtraDataMetaDefs::MenuHelpActionType &menuHelpActionType)
600{
601 QString strResult;
602 switch (menuHelpActionType)
603 {
604 case UIExtraDataMetaDefs::MenuHelpActionType_Contents: strResult = "Contents"; break;
605 case UIExtraDataMetaDefs::MenuHelpActionType_WebSite: strResult = "WebSite"; break;
606 case UIExtraDataMetaDefs::MenuHelpActionType_BugTracker: strResult = "BugTracker"; break;
607 case UIExtraDataMetaDefs::MenuHelpActionType_Forums: strResult = "Forums"; break;
608 case UIExtraDataMetaDefs::MenuHelpActionType_Oracle: strResult = "Oracle"; break;
609 case UIExtraDataMetaDefs::MenuHelpActionType_OnlineDocumentation: strResult = "OnlineDocumentation"; break;
610#ifndef VBOX_WS_MAC
611 case UIExtraDataMetaDefs::MenuHelpActionType_About: strResult = "About"; break;
612#endif /* !VBOX_WS_MAC */
613 case UIExtraDataMetaDefs::MenuHelpActionType_All: strResult = "All"; break;
614 default:
615 {
616 AssertMsgFailed(("No text for action type=%d", menuHelpActionType));
617 break;
618 }
619 }
620 return strResult;
621}
622
623/* UIExtraDataMetaDefs::MenuHelpActionType <= QString: */
624template<> UIExtraDataMetaDefs::MenuHelpActionType
625fromInternalString<UIExtraDataMetaDefs::MenuHelpActionType>(const QString &strMenuHelpActionType)
626{
627 if (strMenuHelpActionType.compare("Contents", Qt::CaseInsensitive) == 0)
628 return UIExtraDataMetaDefs::MenuHelpActionType_Contents;
629 if (strMenuHelpActionType.compare("WebSite", Qt::CaseInsensitive) == 0)
630 return UIExtraDataMetaDefs::MenuHelpActionType_WebSite;
631 if (strMenuHelpActionType.compare("BugTracker", Qt::CaseInsensitive) == 0)
632 return UIExtraDataMetaDefs::MenuHelpActionType_BugTracker;
633 if (strMenuHelpActionType.compare("Forums", Qt::CaseInsensitive) == 0)
634 return UIExtraDataMetaDefs::MenuHelpActionType_Forums;
635 if (strMenuHelpActionType.compare("Oracle", Qt::CaseInsensitive) == 0)
636 return UIExtraDataMetaDefs::MenuHelpActionType_Oracle;
637 if (strMenuHelpActionType.compare("OnlineDocumentation", Qt::CaseInsensitive) == 0)
638 return UIExtraDataMetaDefs::MenuHelpActionType_OnlineDocumentation;
639#ifndef VBOX_WS_MAC
640 if (strMenuHelpActionType.compare("About", Qt::CaseInsensitive) == 0)
641 return UIExtraDataMetaDefs::MenuHelpActionType_About;
642#endif
643 if (strMenuHelpActionType.compare("All", Qt::CaseInsensitive) == 0)
644 return UIExtraDataMetaDefs::MenuHelpActionType_All;
645 return UIExtraDataMetaDefs::MenuHelpActionType_Invalid;
646}
647
648/* QString <= UIExtraDataMetaDefs::RuntimeMenuMachineActionType: */
649template<> QString toInternalString(const UIExtraDataMetaDefs::RuntimeMenuMachineActionType &runtimeMenuMachineActionType)
650{
651 QString strResult;
652 switch (runtimeMenuMachineActionType)
653 {
654 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SettingsDialog: strResult = "SettingsDialog"; break;
655 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_TakeSnapshot: strResult = "TakeSnapshot"; break;
656 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_InformationDialog: strResult = "InformationDialog"; break;
657 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_FileManagerDialog: strResult = "FileManagerDialog"; break;
658 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_GuestProcessControlDialog: strResult = "GuestProcessControlDialog"; break;
659 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Pause: strResult = "Pause"; break;
660 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Reset: strResult = "Reset"; break;
661 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Detach: strResult = "Detach"; break;
662 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SaveState: strResult = "SaveState"; break;
663 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Shutdown: strResult = "Shutdown"; break;
664 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_PowerOff: strResult = "PowerOff"; break;
665 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_LogDialog: strResult = "LogDialog"; break;
666 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Nothing: strResult = "Nothing"; break;
667 case UIExtraDataMetaDefs::RuntimeMenuMachineActionType_All: strResult = "All"; break;
668 default:
669 {
670 AssertMsgFailed(("No text for action type=%d", runtimeMenuMachineActionType));
671 break;
672 }
673 }
674 return strResult;
675}
676
677/* UIExtraDataMetaDefs::RuntimeMenuMachineActionType <= QString: */
678template<> UIExtraDataMetaDefs::RuntimeMenuMachineActionType
679fromInternalString<UIExtraDataMetaDefs::RuntimeMenuMachineActionType>(const QString &strRuntimeMenuMachineActionType)
680{
681 if (strRuntimeMenuMachineActionType.compare("SettingsDialog", Qt::CaseInsensitive) == 0)
682 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SettingsDialog;
683 if (strRuntimeMenuMachineActionType.compare("TakeSnapshot", Qt::CaseInsensitive) == 0)
684 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_TakeSnapshot;
685 if (strRuntimeMenuMachineActionType.compare("InformationDialog", Qt::CaseInsensitive) == 0)
686 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_InformationDialog;
687 if (strRuntimeMenuMachineActionType.compare("FileManagerDialog", Qt::CaseInsensitive) == 0)
688 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_FileManagerDialog;
689 if (strRuntimeMenuMachineActionType.compare("GuestProcessControlDialog", Qt::CaseInsensitive) == 0)
690 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_GuestProcessControlDialog;
691 if (strRuntimeMenuMachineActionType.compare("Pause", Qt::CaseInsensitive) == 0)
692 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Pause;
693 if (strRuntimeMenuMachineActionType.compare("Reset", Qt::CaseInsensitive) == 0)
694 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Reset;
695 if (strRuntimeMenuMachineActionType.compare("Detach", Qt::CaseInsensitive) == 0)
696 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Detach;
697 if (strRuntimeMenuMachineActionType.compare("SaveState", Qt::CaseInsensitive) == 0)
698 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_SaveState;
699 if (strRuntimeMenuMachineActionType.compare("Shutdown", Qt::CaseInsensitive) == 0)
700 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Shutdown;
701 if (strRuntimeMenuMachineActionType.compare("PowerOff", Qt::CaseInsensitive) == 0)
702 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_PowerOff;
703 if (strRuntimeMenuMachineActionType.compare("LogDialog", Qt::CaseInsensitive) == 0)
704 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_LogDialog;
705 if (strRuntimeMenuMachineActionType.compare("Nothing", Qt::CaseInsensitive) == 0)
706 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Nothing;
707 if (strRuntimeMenuMachineActionType.compare("All", Qt::CaseInsensitive) == 0)
708 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_All;
709 return UIExtraDataMetaDefs::RuntimeMenuMachineActionType_Invalid;
710}
711
712/* QString <= UIExtraDataMetaDefs::RuntimeMenuViewActionType: */
713template<> QString toInternalString(const UIExtraDataMetaDefs::RuntimeMenuViewActionType &runtimeMenuViewActionType)
714{
715 QString strResult;
716 switch (runtimeMenuViewActionType)
717 {
718 case UIExtraDataMetaDefs::RuntimeMenuViewActionType_Fullscreen: strResult = "Fullscreen"; break;
719 case UIExtraDataMetaDefs::RuntimeMenuViewActionType_Seamless: strResult = "Seamless"; break;
720 case UIExtraDataMetaDefs::RuntimeMenuViewActionType_Scale: strResult = "Scale"; break;
721#ifndef VBOX_WS_MAC
722 case UIExtraDataMetaDefs::RuntimeMenuViewActionType_MinimizeWindow: strResult = "MinimizeWindow"; break;
723#endif /* !VBOX_WS_MAC */
724 case UIExtraDataMetaDefs::RuntimeMenuViewActionType_AdjustWindow: strResult = "AdjustWindow"; break;
725 case UIExtraDataMetaDefs::RuntimeMenuViewActionType_GuestAutoresize: strResult = "GuestAutoresize"; break;
726 case UIExtraDataMetaDefs::RuntimeMenuViewActionType_TakeScreenshot: strResult = "TakeScreenshot"; break;
727 case UIExtraDataMetaDefs::RuntimeMenuViewActionType_Recording: strResult = "Recording"; break;
728 case UIExtraDataMetaDefs::RuntimeMenuViewActionType_RecordingSettings: strResult = "RecordingSettings"; break;
729 case UIExtraDataMetaDefs::RuntimeMenuViewActionType_StartRecording: strResult = "StartRecording"; break;
730 case UIExtraDataMetaDefs::RuntimeMenuViewActionType_VRDEServer: strResult = "VRDEServer"; break;
731 case UIExtraDataMetaDefs::RuntimeMenuViewActionType_MenuBar: strResult = "MenuBar"; break;
732 case UIExtraDataMetaDefs::RuntimeMenuViewActionType_MenuBarSettings: strResult = "MenuBarSettings"; break;
733#ifndef VBOX_WS_MAC
734 case UIExtraDataMetaDefs::RuntimeMenuViewActionType_ToggleMenuBar: strResult = "ToggleMenuBar"; break;
735#endif /* !VBOX_WS_MAC */
736 case UIExtraDataMetaDefs::RuntimeMenuViewActionType_StatusBar: strResult = "StatusBar"; break;
737 case UIExtraDataMetaDefs::RuntimeMenuViewActionType_StatusBarSettings: strResult = "StatusBarSettings"; break;
738 case UIExtraDataMetaDefs::RuntimeMenuViewActionType_ToggleStatusBar: strResult = "ToggleStatusBar"; break;
739 case UIExtraDataMetaDefs::RuntimeMenuViewActionType_Resize: strResult = "Resize"; break;
740 case UIExtraDataMetaDefs::RuntimeMenuViewActionType_Remap: strResult = "Remap"; break;
741 case UIExtraDataMetaDefs::RuntimeMenuViewActionType_Rescale: strResult = "Rescale"; break;
742 case UIExtraDataMetaDefs::RuntimeMenuViewActionType_All: strResult = "All"; break;
743 default:
744 {
745 AssertMsgFailed(("No text for action type=%d", runtimeMenuViewActionType));
746 break;
747 }
748 }
749 return strResult;
750}
751
752/* UIExtraDataMetaDefs::RuntimeMenuViewActionType <= QString: */
753template<> UIExtraDataMetaDefs::RuntimeMenuViewActionType
754fromInternalString<UIExtraDataMetaDefs::RuntimeMenuViewActionType>(const QString &strRuntimeMenuViewActionType)
755{
756 if (strRuntimeMenuViewActionType.compare("Fullscreen", Qt::CaseInsensitive) == 0)
757 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_Fullscreen;
758 if (strRuntimeMenuViewActionType.compare("Seamless", Qt::CaseInsensitive) == 0)
759 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_Seamless;
760 if (strRuntimeMenuViewActionType.compare("Scale", Qt::CaseInsensitive) == 0)
761 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_Scale;
762#ifndef VBOX_WS_MAC
763 if (strRuntimeMenuViewActionType.compare("MinimizeWindow", Qt::CaseInsensitive) == 0)
764 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_MinimizeWindow;
765#endif /* !VBOX_WS_MAC */
766 if (strRuntimeMenuViewActionType.compare("AdjustWindow", Qt::CaseInsensitive) == 0)
767 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_AdjustWindow;
768 if (strRuntimeMenuViewActionType.compare("GuestAutoresize", Qt::CaseInsensitive) == 0)
769 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_GuestAutoresize;
770 if (strRuntimeMenuViewActionType.compare("TakeScreenshot", Qt::CaseInsensitive) == 0)
771 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_TakeScreenshot;
772 if (strRuntimeMenuViewActionType.compare("Recording", Qt::CaseInsensitive) == 0)
773 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_Recording;
774 if (strRuntimeMenuViewActionType.compare("RecordingSettings", Qt::CaseInsensitive) == 0)
775 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_RecordingSettings;
776 if (strRuntimeMenuViewActionType.compare("StartRecording", Qt::CaseInsensitive) == 0)
777 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_StartRecording;
778 if (strRuntimeMenuViewActionType.compare("VRDEServer", Qt::CaseInsensitive) == 0)
779 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_VRDEServer;
780 if (strRuntimeMenuViewActionType.compare("MenuBar", Qt::CaseInsensitive) == 0)
781 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_MenuBar;
782 if (strRuntimeMenuViewActionType.compare("MenuBarSettings", Qt::CaseInsensitive) == 0)
783 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_MenuBarSettings;
784#ifndef VBOX_WS_MAC
785 if (strRuntimeMenuViewActionType.compare("ToggleMenuBar", Qt::CaseInsensitive) == 0)
786 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_ToggleMenuBar;
787#endif /* !VBOX_WS_MAC */
788 if (strRuntimeMenuViewActionType.compare("StatusBar", Qt::CaseInsensitive) == 0)
789 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_StatusBar;
790 if (strRuntimeMenuViewActionType.compare("StatusBarSettings", Qt::CaseInsensitive) == 0)
791 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_StatusBarSettings;
792 if (strRuntimeMenuViewActionType.compare("ToggleStatusBar", Qt::CaseInsensitive) == 0)
793 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_ToggleStatusBar;
794 if (strRuntimeMenuViewActionType.compare("Resize", Qt::CaseInsensitive) == 0)
795 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_Resize;
796 if (strRuntimeMenuViewActionType.compare("Remap", Qt::CaseInsensitive) == 0)
797 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_Remap;
798 if (strRuntimeMenuViewActionType.compare("Rescale", Qt::CaseInsensitive) == 0)
799 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_Rescale;
800 if (strRuntimeMenuViewActionType.compare("All", Qt::CaseInsensitive) == 0)
801 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_All;
802 return UIExtraDataMetaDefs::RuntimeMenuViewActionType_Invalid;
803}
804
805/* QString <= UIExtraDataMetaDefs::RuntimeMenuInputActionType: */
806template<> QString toInternalString(const UIExtraDataMetaDefs::RuntimeMenuInputActionType &runtimeMenuInputActionType)
807{
808 QString strResult;
809 switch (runtimeMenuInputActionType)
810 {
811 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_Keyboard: strResult = "Keyboard"; break;
812 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_KeyboardSettings: strResult = "KeyboardSettings"; break;
813 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_SoftKeyboard: strResult = "SoftKeyboard"; break;
814 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCAD: strResult = "TypeCAD"; break;
815#ifdef VBOX_WS_NIX
816 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCABS: strResult = "TypeCABS"; break;
817#endif /* VBOX_WS_NIX */
818 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCtrlBreak: strResult = "TypeCtrlBreak"; break;
819 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeInsert: strResult = "TypeInsert"; break;
820 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypePrintScreen: strResult = "TypePrintScreen"; break;
821 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeAltPrintScreen: strResult = "TypeAltPrintScreen"; break;
822 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_Mouse: strResult = "Mouse"; break;
823 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_MouseIntegration: strResult = "MouseIntegration"; break;
824 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeHostKeyCombo: strResult = "TypeHostKeyCombo"; break;
825 case UIExtraDataMetaDefs::RuntimeMenuInputActionType_All: strResult = "All"; break;
826 default:
827 {
828 AssertMsgFailed(("No text for action type=%d", runtimeMenuInputActionType));
829 break;
830 }
831 }
832 return strResult;
833}
834
835/* UIExtraDataMetaDefs::RuntimeMenuInputActionType <= QString: */
836template<> UIExtraDataMetaDefs::RuntimeMenuInputActionType
837fromInternalString<UIExtraDataMetaDefs::RuntimeMenuInputActionType>(const QString &strRuntimeMenuInputActionType)
838{
839 if (strRuntimeMenuInputActionType.compare("Keyboard", Qt::CaseInsensitive) == 0)
840 return UIExtraDataMetaDefs::RuntimeMenuInputActionType_Keyboard;
841 if (strRuntimeMenuInputActionType.compare("KeyboardSettings", Qt::CaseInsensitive) == 0)
842 return UIExtraDataMetaDefs::RuntimeMenuInputActionType_KeyboardSettings;
843 if (strRuntimeMenuInputActionType.compare("SoftKeyboard", Qt::CaseInsensitive) == 0)
844 return UIExtraDataMetaDefs::RuntimeMenuInputActionType_SoftKeyboard;
845 if (strRuntimeMenuInputActionType.compare("TypeCAD", Qt::CaseInsensitive) == 0)
846 return UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCAD;
847#ifdef VBOX_WS_NIX
848 if (strRuntimeMenuInputActionType.compare("TypeCABS", Qt::CaseInsensitive) == 0)
849 return UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCABS;
850#endif /* VBOX_WS_NIX */
851 if (strRuntimeMenuInputActionType.compare("TypeCtrlBreak", Qt::CaseInsensitive) == 0)
852 return UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeCtrlBreak;
853 if (strRuntimeMenuInputActionType.compare("TypeInsert", Qt::CaseInsensitive) == 0)
854 return UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeInsert;
855 if (strRuntimeMenuInputActionType.compare("TypePrintScreen", Qt::CaseInsensitive) == 0)
856 return UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypePrintScreen;
857 if (strRuntimeMenuInputActionType.compare("TypeAltPrintScreen", Qt::CaseInsensitive) == 0)
858 return UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeAltPrintScreen;
859 if (strRuntimeMenuInputActionType.compare("Mouse", Qt::CaseInsensitive) == 0)
860 return UIExtraDataMetaDefs::RuntimeMenuInputActionType_Mouse;
861 if (strRuntimeMenuInputActionType.compare("MouseIntegration", Qt::CaseInsensitive) == 0)
862 return UIExtraDataMetaDefs::RuntimeMenuInputActionType_MouseIntegration;
863 if (strRuntimeMenuInputActionType.compare("TypeHostKeyCombo", Qt::CaseInsensitive) == 0)
864 return UIExtraDataMetaDefs::RuntimeMenuInputActionType_TypeHostKeyCombo;
865 if (strRuntimeMenuInputActionType.compare("All", Qt::CaseInsensitive) == 0)
866 return UIExtraDataMetaDefs::RuntimeMenuInputActionType_All;
867 return UIExtraDataMetaDefs::RuntimeMenuInputActionType_Invalid;
868}
869
870/* QString <= UIExtraDataMetaDefs::RuntimeMenuDevicesActionType: */
871template<> QString toInternalString(const UIExtraDataMetaDefs::RuntimeMenuDevicesActionType &runtimeMenuDevicesActionType)
872{
873 QString strResult;
874 switch (runtimeMenuDevicesActionType)
875 {
876 case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_HardDrives: strResult = "HardDrives"; break;
877 case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_HardDrivesSettings: strResult = "HardDrivesSettings"; break;
878 case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_OpticalDevices: strResult = "OpticalDevices"; break;
879 case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_FloppyDevices: strResult = "FloppyDevices"; break;
880 case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Audio: strResult = "Audio"; break;
881 case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_AudioOutput: strResult = "AudioOutput"; break;
882 case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_AudioInput: strResult = "AudioInput"; break;
883 case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Network: strResult = "Network"; break;
884 case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_NetworkSettings: strResult = "NetworkSettings"; break;
885 case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_USBDevices: strResult = "USBDevices"; break;
886 case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_USBDevicesSettings: strResult = "USBDevicesSettings"; break;
887 case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_WebCams: strResult = "WebCams"; break;
888 case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedClipboard: strResult = "SharedClipboard"; break;
889 case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_DragAndDrop: strResult = "DragAndDrop"; break;
890 case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedFolders: strResult = "SharedFolders"; break;
891 case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedFoldersSettings: strResult = "SharedFoldersSettings"; break;
892 case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_InsertGuestAdditionsDisk: strResult = "InsertGuestAdditionsDisk"; break;
893 case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_UpgradeGuestAdditions: strResult = "UpgradeGuestAdditions"; break;
894 case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Nothing: strResult = "Nothing"; break;
895 case UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_All: strResult = "All"; break;
896 default:
897 {
898 AssertMsgFailed(("No text for action type=%d", runtimeMenuDevicesActionType));
899 break;
900 }
901 }
902 return strResult;
903}
904
905/* UIExtraDataMetaDefs::RuntimeMenuDevicesActionType <= QString: */
906template<> UIExtraDataMetaDefs::RuntimeMenuDevicesActionType
907fromInternalString<UIExtraDataMetaDefs::RuntimeMenuDevicesActionType>(const QString &strRuntimeMenuDevicesActionType)
908{
909 if (strRuntimeMenuDevicesActionType.compare("HardDrives", Qt::CaseInsensitive) == 0)
910 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_HardDrives;
911 if (strRuntimeMenuDevicesActionType.compare("HardDrivesSettings", Qt::CaseInsensitive) == 0)
912 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_HardDrivesSettings;
913 if (strRuntimeMenuDevicesActionType.compare("OpticalDevices", Qt::CaseInsensitive) == 0)
914 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_OpticalDevices;
915 if (strRuntimeMenuDevicesActionType.compare("FloppyDevices", Qt::CaseInsensitive) == 0)
916 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_FloppyDevices;
917 if (strRuntimeMenuDevicesActionType.compare("Audio", Qt::CaseInsensitive) == 0)
918 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Audio;
919 if (strRuntimeMenuDevicesActionType.compare("AudioOutput", Qt::CaseInsensitive) == 0)
920 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_AudioOutput;
921 if (strRuntimeMenuDevicesActionType.compare("AudioInput", Qt::CaseInsensitive) == 0)
922 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_AudioInput;
923 if (strRuntimeMenuDevicesActionType.compare("Network", Qt::CaseInsensitive) == 0)
924 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Network;
925 if (strRuntimeMenuDevicesActionType.compare("NetworkSettings", Qt::CaseInsensitive) == 0)
926 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_NetworkSettings;
927 if (strRuntimeMenuDevicesActionType.compare("USBDevices", Qt::CaseInsensitive) == 0)
928 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_USBDevices;
929 if (strRuntimeMenuDevicesActionType.compare("USBDevicesSettings", Qt::CaseInsensitive) == 0)
930 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_USBDevicesSettings;
931 if (strRuntimeMenuDevicesActionType.compare("WebCams", Qt::CaseInsensitive) == 0)
932 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_WebCams;
933 if (strRuntimeMenuDevicesActionType.compare("SharedClipboard", Qt::CaseInsensitive) == 0)
934 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedClipboard;
935 if (strRuntimeMenuDevicesActionType.compare("DragAndDrop", Qt::CaseInsensitive) == 0)
936 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_DragAndDrop;
937 if (strRuntimeMenuDevicesActionType.compare("SharedFolders", Qt::CaseInsensitive) == 0)
938 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedFolders;
939 if (strRuntimeMenuDevicesActionType.compare("SharedFoldersSettings", Qt::CaseInsensitive) == 0)
940 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_SharedFoldersSettings;
941 if (strRuntimeMenuDevicesActionType.compare("InsertGuestAdditionsDisk", Qt::CaseInsensitive) == 0)
942 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_InsertGuestAdditionsDisk;
943 if (strRuntimeMenuDevicesActionType.compare("UpgradeGuestAdditions", Qt::CaseInsensitive) == 0)
944 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_UpgradeGuestAdditions;
945 if (strRuntimeMenuDevicesActionType.compare("Nothing", Qt::CaseInsensitive) == 0)
946 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Nothing;
947 if (strRuntimeMenuDevicesActionType.compare("All", Qt::CaseInsensitive) == 0)
948 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_All;
949 return UIExtraDataMetaDefs::RuntimeMenuDevicesActionType_Invalid;
950}
951
952#ifdef VBOX_WITH_DEBUGGER_GUI
953/* QString <= UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType: */
954template<> QString toInternalString(const UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType &runtimeMenuDebuggerActionType)
955{
956 QString strResult;
957 switch (runtimeMenuDebuggerActionType)
958 {
959 case UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_Statistics: strResult = "Statistics"; break;
960 case UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_CommandLine: strResult = "CommandLine"; break;
961 case UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_Logging: strResult = "Logging"; break;
962 case UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_GuestControlConsole: strResult = "GuestControlConsole"; break;
963 case UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_All: strResult = "All"; break;
964 default:
965 {
966 AssertMsgFailed(("No text for action type=%d", runtimeMenuDebuggerActionType));
967 break;
968 }
969 }
970 return strResult;
971}
972
973/* UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType <= QString: */
974template<> UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType
975fromInternalString<UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType>(const QString &strRuntimeMenuDebuggerActionType)
976{
977 if (strRuntimeMenuDebuggerActionType.compare("Statistics", Qt::CaseInsensitive) == 0)
978 return UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_Statistics;
979 if (strRuntimeMenuDebuggerActionType.compare("CommandLine", Qt::CaseInsensitive) == 0)
980 return UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_CommandLine;
981 if (strRuntimeMenuDebuggerActionType.compare("Logging", Qt::CaseInsensitive) == 0)
982 return UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_Logging;
983 if (strRuntimeMenuDebuggerActionType.compare("GuestControlConsole", Qt::CaseInsensitive) == 0)
984 return UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_GuestControlConsole;
985 if (strRuntimeMenuDebuggerActionType.compare("All", Qt::CaseInsensitive) == 0)
986 return UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_All;
987 return UIExtraDataMetaDefs::RuntimeMenuDebuggerActionType_Invalid;
988}
989#endif /* VBOX_WITH_DEBUGGER_GUI */
990
991#ifdef VBOX_WS_MAC
992/* QString <= UIExtraDataMetaDefs::MenuWindowActionType: */
993template<> QString toInternalString(const UIExtraDataMetaDefs::MenuWindowActionType &menuWindowActionType)
994{
995 QString strResult;
996 switch (menuWindowActionType)
997 {
998 case UIExtraDataMetaDefs::MenuWindowActionType_Minimize: strResult = "Minimize"; break;
999 case UIExtraDataMetaDefs::MenuWindowActionType_Switch: strResult = "Switch"; break;
1000 case UIExtraDataMetaDefs::MenuWindowActionType_All: strResult = "All"; break;
1001 default:
1002 {
1003 AssertMsgFailed(("No text for action type=%d", menuWindowActionType));
1004 break;
1005 }
1006 }
1007 return strResult;
1008}
1009
1010/* UIExtraDataMetaDefs::MenuWindowActionType <= QString: */
1011template<> UIExtraDataMetaDefs::MenuWindowActionType
1012fromInternalString<UIExtraDataMetaDefs::MenuWindowActionType>(const QString &strMenuWindowActionType)
1013{
1014 if (strMenuWindowActionType.compare("Minimize", Qt::CaseInsensitive) == 0)
1015 return UIExtraDataMetaDefs::MenuWindowActionType_Minimize;
1016 if (strMenuWindowActionType.compare("Switch", Qt::CaseInsensitive) == 0)
1017 return UIExtraDataMetaDefs::MenuWindowActionType_Switch;
1018 if (strMenuWindowActionType.compare("All", Qt::CaseInsensitive) == 0)
1019 return UIExtraDataMetaDefs::MenuWindowActionType_All;
1020 return UIExtraDataMetaDefs::MenuWindowActionType_Invalid;
1021}
1022#endif /* VBOX_WS_MAC */
1023
1024/* QString <= UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral: */
1025template<> QString toString(const UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral &enmDetailsElementOptionTypeGeneral)
1026{
1027 QString strResult;
1028 switch (enmDetailsElementOptionTypeGeneral)
1029 {
1030 case UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_Name: strResult = QApplication::translate("UICommon", "Name"); break;
1031 case UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_OS: strResult = QApplication::translate("UICommon", "OS"); break;
1032 case UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_Location: strResult = QApplication::translate("UICommon", "Location"); break;
1033 case UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_Groups: strResult = QApplication::translate("UICommon", "Groups"); break;
1034 default:
1035 {
1036 AssertMsgFailed(("No text for details element option type=%d", enmDetailsElementOptionTypeGeneral));
1037 break;
1038 }
1039 }
1040 return strResult;
1041}
1042
1043/* QString <= UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral: */
1044template<> QString toInternalString(const UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral &enmDetailsElementOptionTypeGeneral)
1045{
1046 QString strResult;
1047 switch (enmDetailsElementOptionTypeGeneral)
1048 {
1049 case UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_Name: strResult = "Name"; break;
1050 case UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_OS: strResult = "OS"; break;
1051 case UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_Location: strResult = "Location"; break;
1052 case UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_Groups: strResult = "Groups"; break;
1053 default:
1054 {
1055 AssertMsgFailed(("No text for details element option type=%d", enmDetailsElementOptionTypeGeneral));
1056 break;
1057 }
1058 }
1059 return strResult;
1060}
1061
1062/* UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral <= QString: */
1063template<> UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral
1064fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral>(const QString &strDetailsElementOptionTypeGeneral)
1065{
1066 if (strDetailsElementOptionTypeGeneral.compare("Name", Qt::CaseInsensitive) == 0)
1067 return UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_Name;
1068 if (strDetailsElementOptionTypeGeneral.compare("OS", Qt::CaseInsensitive) == 0)
1069 return UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_OS;
1070 if (strDetailsElementOptionTypeGeneral.compare("Location", Qt::CaseInsensitive) == 0)
1071 return UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_Location;
1072 if (strDetailsElementOptionTypeGeneral.compare("Groups", Qt::CaseInsensitive) == 0)
1073 return UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_Groups;
1074 return UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_Invalid;
1075}
1076
1077/* QString <= UIExtraDataMetaDefs::DetailsElementOptionTypeSystem: */
1078template<> QString toString(const UIExtraDataMetaDefs::DetailsElementOptionTypeSystem &enmDetailsElementOptionTypeSystem)
1079{
1080 QString strResult;
1081 switch (enmDetailsElementOptionTypeSystem)
1082 {
1083 case UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_RAM: strResult = QApplication::translate("UICommon", "RAM"); break;
1084 case UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_CPUCount: strResult = QApplication::translate("UICommon", "CPU Count"); break;
1085 case UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_CPUExecutionCap: strResult = QApplication::translate("UICommon", "CPU Execution Cap"); break;
1086 case UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_BootOrder: strResult = QApplication::translate("UICommon", "Boot Order"); break;
1087 case UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_ChipsetType: strResult = QApplication::translate("UICommon", "Chipset Type"); break;
1088 case UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_TpmType: strResult = QApplication::translate("UICommon", "TPM Type"); break;
1089 case UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_Firmware: strResult = QApplication::translate("UICommon", "Firmware"); break;
1090 case UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_SecureBoot: strResult = QApplication::translate("UICommon", "Secure Boot"); break;
1091 case UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_Acceleration: strResult = QApplication::translate("UICommon", "Acceleration"); break;
1092 default:
1093 {
1094 AssertMsgFailed(("No text for details element option type=%d", enmDetailsElementOptionTypeSystem));
1095 break;
1096 }
1097 }
1098 return strResult;
1099}
1100
1101/* QString <= UIExtraDataMetaDefs::DetailsElementOptionTypeSystem: */
1102template<> QString toInternalString(const UIExtraDataMetaDefs::DetailsElementOptionTypeSystem &enmDetailsElementOptionTypeSystem)
1103{
1104 QString strResult;
1105 switch (enmDetailsElementOptionTypeSystem)
1106 {
1107 case UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_RAM: strResult = "RAM"; break;
1108 case UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_CPUCount: strResult = "CPUCount"; break;
1109 case UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_CPUExecutionCap: strResult = "CPUExecutionCap"; break;
1110 case UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_BootOrder: strResult = "BootOrder"; break;
1111 case UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_ChipsetType: strResult = "ChipsetType"; break;
1112 case UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_TpmType: strResult = "TPMType"; break;
1113 case UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_Firmware: strResult = "Firmware"; break;
1114 case UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_SecureBoot: strResult = "SecureBoot"; break;
1115 case UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_Acceleration: strResult = "Acceleration"; break;
1116 default:
1117 {
1118 AssertMsgFailed(("No text for details element option type=%d", enmDetailsElementOptionTypeSystem));
1119 break;
1120 }
1121 }
1122 return strResult;
1123}
1124
1125/* UIExtraDataMetaDefs::DetailsElementOptionTypeSystem <= QString: */
1126template<> UIExtraDataMetaDefs::DetailsElementOptionTypeSystem
1127fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeSystem>(const QString &strDetailsElementOptionTypeSystem)
1128{
1129 if (strDetailsElementOptionTypeSystem.compare("RAM", Qt::CaseInsensitive) == 0)
1130 return UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_RAM;
1131 if (strDetailsElementOptionTypeSystem.compare("CPUCount", Qt::CaseInsensitive) == 0)
1132 return UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_CPUCount;
1133 if (strDetailsElementOptionTypeSystem.compare("CPUExecutionCap", Qt::CaseInsensitive) == 0)
1134 return UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_CPUExecutionCap;
1135 if (strDetailsElementOptionTypeSystem.compare("BootOrder", Qt::CaseInsensitive) == 0)
1136 return UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_BootOrder;
1137 if (strDetailsElementOptionTypeSystem.compare("ChipsetType", Qt::CaseInsensitive) == 0)
1138 return UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_ChipsetType;
1139 if (strDetailsElementOptionTypeSystem.compare("TPMType", Qt::CaseInsensitive) == 0)
1140 return UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_TpmType;
1141 if (strDetailsElementOptionTypeSystem.compare("Firmware", Qt::CaseInsensitive) == 0)
1142 return UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_Firmware;
1143 if (strDetailsElementOptionTypeSystem.compare("SecureBoot", Qt::CaseInsensitive) == 0)
1144 return UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_SecureBoot;
1145 if (strDetailsElementOptionTypeSystem.compare("Acceleration", Qt::CaseInsensitive) == 0)
1146 return UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_Acceleration;
1147 return UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_Invalid;
1148}
1149
1150/* QString <= UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay: */
1151template<> QString toString(const UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay &enmDetailsElementOptionTypeDisplay)
1152{
1153 QString strResult;
1154 switch (enmDetailsElementOptionTypeDisplay)
1155 {
1156 case UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_VRAM: strResult = QApplication::translate("UICommon", "VRAM"); break;
1157 case UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_ScreenCount: strResult = QApplication::translate("UICommon", "Screen Count"); break;
1158 case UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_ScaleFactor: strResult = QApplication::translate("UICommon", "Scale Factor"); break;
1159 case UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_GraphicsController: strResult = QApplication::translate("UICommon", "Graphics Controller"); break;
1160 case UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_Acceleration: strResult = QApplication::translate("UICommon", "Acceleration"); break;
1161 case UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_VRDE: strResult = QApplication::translate("UICommon", "VRDE"); break;
1162 case UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_Recording: strResult = QApplication::translate("UICommon", "Recording"); break;
1163 default:
1164 {
1165 AssertMsgFailed(("No text for details element option type=%d", enmDetailsElementOptionTypeDisplay));
1166 break;
1167 }
1168 }
1169 return strResult;
1170}
1171
1172/* QString <= UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay: */
1173template<> QString toInternalString(const UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay &enmDetailsElementOptionTypeDisplay)
1174{
1175 QString strResult;
1176 switch (enmDetailsElementOptionTypeDisplay)
1177 {
1178 case UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_VRAM: strResult = "VRAM"; break;
1179 case UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_ScreenCount: strResult = "ScreenCount"; break;
1180 case UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_ScaleFactor: strResult = "ScaleFactor"; break;
1181 case UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_GraphicsController: strResult = "GraphicsController"; break;
1182 case UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_Acceleration: strResult = "Acceleration"; break;
1183 case UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_VRDE: strResult = "VRDE"; break;
1184 case UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_Recording: strResult = "Recording"; break;
1185 default:
1186 {
1187 AssertMsgFailed(("No text for details element option type=%d", enmDetailsElementOptionTypeDisplay));
1188 break;
1189 }
1190 }
1191 return strResult;
1192}
1193
1194/* UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay <= QString: */
1195template<> UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay
1196fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay>(const QString &strDetailsElementOptionTypeDisplay)
1197{
1198 if (strDetailsElementOptionTypeDisplay.compare("VRAM", Qt::CaseInsensitive) == 0)
1199 return UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_VRAM;
1200 if (strDetailsElementOptionTypeDisplay.compare("ScreenCount", Qt::CaseInsensitive) == 0)
1201 return UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_ScreenCount;
1202 if (strDetailsElementOptionTypeDisplay.compare("ScaleFactor", Qt::CaseInsensitive) == 0)
1203 return UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_ScaleFactor;
1204 if (strDetailsElementOptionTypeDisplay.compare("GraphicsController", Qt::CaseInsensitive) == 0)
1205 return UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_GraphicsController;
1206 if (strDetailsElementOptionTypeDisplay.compare("Acceleration", Qt::CaseInsensitive) == 0)
1207 return UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_Acceleration;
1208 if (strDetailsElementOptionTypeDisplay.compare("VRDE", Qt::CaseInsensitive) == 0)
1209 return UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_VRDE;
1210 if (strDetailsElementOptionTypeDisplay.compare("Recording", Qt::CaseInsensitive) == 0)
1211 return UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_Recording;
1212 return UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_Invalid;
1213}
1214
1215/* QString <= UIExtraDataMetaDefs::DetailsElementOptionTypeStorage: */
1216template<> QString toString(const UIExtraDataMetaDefs::DetailsElementOptionTypeStorage &enmDetailsElementOptionTypeStorage)
1217{
1218 QString strResult;
1219 switch (enmDetailsElementOptionTypeStorage)
1220 {
1221 case UIExtraDataMetaDefs::DetailsElementOptionTypeStorage_HardDisks: strResult = QApplication::translate("UICommon", "Hard Disks"); break;
1222 case UIExtraDataMetaDefs::DetailsElementOptionTypeStorage_OpticalDevices: strResult = QApplication::translate("UICommon", "Optical Devices"); break;
1223 case UIExtraDataMetaDefs::DetailsElementOptionTypeStorage_FloppyDevices: strResult = QApplication::translate("UICommon", "Floppy Devices"); break;
1224 default:
1225 {
1226 AssertMsgFailed(("No text for details element option type=%d", enmDetailsElementOptionTypeStorage));
1227 break;
1228 }
1229 }
1230 return strResult;
1231}
1232
1233/* QString <= UIExtraDataMetaDefs::DetailsElementOptionTypeStorage: */
1234template<> QString toInternalString(const UIExtraDataMetaDefs::DetailsElementOptionTypeStorage &enmDetailsElementOptionTypeStorage)
1235{
1236 QString strResult;
1237 switch (enmDetailsElementOptionTypeStorage)
1238 {
1239 case UIExtraDataMetaDefs::DetailsElementOptionTypeStorage_HardDisks: strResult = "HardDisks"; break;
1240 case UIExtraDataMetaDefs::DetailsElementOptionTypeStorage_OpticalDevices: strResult = "OpticalDevices"; break;
1241 case UIExtraDataMetaDefs::DetailsElementOptionTypeStorage_FloppyDevices: strResult = "FloppyDevices"; break;
1242 default:
1243 {
1244 AssertMsgFailed(("No text for details element option type=%d", enmDetailsElementOptionTypeStorage));
1245 break;
1246 }
1247 }
1248 return strResult;
1249}
1250
1251/* UIExtraDataMetaDefs::DetailsElementOptionTypeStorage <= QString: */
1252template<> UIExtraDataMetaDefs::DetailsElementOptionTypeStorage
1253fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeStorage>(const QString &strDetailsElementOptionTypeStorage)
1254{
1255 if (strDetailsElementOptionTypeStorage.compare("HardDisks", Qt::CaseInsensitive) == 0)
1256 return UIExtraDataMetaDefs::DetailsElementOptionTypeStorage_HardDisks;
1257 if (strDetailsElementOptionTypeStorage.compare("OpticalDevices", Qt::CaseInsensitive) == 0)
1258 return UIExtraDataMetaDefs::DetailsElementOptionTypeStorage_OpticalDevices;
1259 if (strDetailsElementOptionTypeStorage.compare("FloppyDevices", Qt::CaseInsensitive) == 0)
1260 return UIExtraDataMetaDefs::DetailsElementOptionTypeStorage_FloppyDevices;
1261 return UIExtraDataMetaDefs::DetailsElementOptionTypeStorage_Invalid;
1262}
1263
1264/* QString <= UIExtraDataMetaDefs::DetailsElementOptionTypeAudio: */
1265template<> QString toString(const UIExtraDataMetaDefs::DetailsElementOptionTypeAudio &enmDetailsElementOptionTypeAudio)
1266{
1267 QString strResult;
1268 switch (enmDetailsElementOptionTypeAudio)
1269 {
1270 case UIExtraDataMetaDefs::DetailsElementOptionTypeAudio_Driver: strResult = QApplication::translate("UICommon", "Driver"); break;
1271 case UIExtraDataMetaDefs::DetailsElementOptionTypeAudio_Controller: strResult = QApplication::translate("UICommon", "Controller"); break;
1272 case UIExtraDataMetaDefs::DetailsElementOptionTypeAudio_IO: strResult = QApplication::translate("UICommon", "Input/Output"); break;
1273 default:
1274 {
1275 AssertMsgFailed(("No text for details element option type=%d", enmDetailsElementOptionTypeAudio));
1276 break;
1277 }
1278 }
1279 return strResult;
1280}
1281
1282/* QString <= UIExtraDataMetaDefs::DetailsElementOptionTypeAudio: */
1283template<> QString toInternalString(const UIExtraDataMetaDefs::DetailsElementOptionTypeAudio &enmDetailsElementOptionTypeAudio)
1284{
1285 QString strResult;
1286 switch (enmDetailsElementOptionTypeAudio)
1287 {
1288 case UIExtraDataMetaDefs::DetailsElementOptionTypeAudio_Driver: strResult = "Driver"; break;
1289 case UIExtraDataMetaDefs::DetailsElementOptionTypeAudio_Controller: strResult = "Controller"; break;
1290 case UIExtraDataMetaDefs::DetailsElementOptionTypeAudio_IO: strResult = "IO"; break;
1291 default:
1292 {
1293 AssertMsgFailed(("No text for details element option type=%d", enmDetailsElementOptionTypeAudio));
1294 break;
1295 }
1296 }
1297 return strResult;
1298}
1299
1300/* UIExtraDataMetaDefs::DetailsElementOptionTypeAudio <= QString: */
1301template<> UIExtraDataMetaDefs::DetailsElementOptionTypeAudio
1302fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeAudio>(const QString &strDetailsElementOptionTypeAudio)
1303{
1304 if (strDetailsElementOptionTypeAudio.compare("Driver", Qt::CaseInsensitive) == 0)
1305 return UIExtraDataMetaDefs::DetailsElementOptionTypeAudio_Driver;
1306 if (strDetailsElementOptionTypeAudio.compare("Controller", Qt::CaseInsensitive) == 0)
1307 return UIExtraDataMetaDefs::DetailsElementOptionTypeAudio_Controller;
1308 if (strDetailsElementOptionTypeAudio.compare("IO", Qt::CaseInsensitive) == 0)
1309 return UIExtraDataMetaDefs::DetailsElementOptionTypeAudio_IO;
1310 return UIExtraDataMetaDefs::DetailsElementOptionTypeAudio_Invalid;
1311}
1312
1313/* QString <= UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork: */
1314template<> QString toString(const UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork &enmDetailsElementOptionTypeNetwork)
1315{
1316 QString strResult;
1317 switch (enmDetailsElementOptionTypeNetwork)
1318 {
1319 case UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_NotAttached: strResult = QApplication::translate("UICommon", "Not Attached", "network adapter"); break;
1320 case UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_NAT: strResult = QApplication::translate("UICommon", "NAT"); break;
1321 case UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_BridgedAdapter: strResult = QApplication::translate("UICommon", "Bridged Adapter"); break;
1322 case UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_InternalNetwork: strResult = QApplication::translate("UICommon", "Internal Network"); break;
1323 case UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_HostOnlyAdapter: strResult = QApplication::translate("UICommon", "Host Only Adapter"); break;
1324 case UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_GenericDriver: strResult = QApplication::translate("UICommon", "Generic Driver"); break;
1325 case UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_NATNetwork: strResult = QApplication::translate("UICommon", "NAT Network"); break;
1326#ifdef VBOX_WITH_CLOUD_NET
1327 case UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_CloudNetwork: strResult = QApplication::translate("UICommon", "Cloud Network"); break;
1328#endif
1329#ifdef VBOX_WITH_VMNET
1330 case UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_HostOnlyNetwork: strResult = QApplication::translate("UICommon", "Host Only Network"); break;
1331#endif
1332 default:
1333 {
1334 AssertMsgFailed(("No text for details element option type=%d", enmDetailsElementOptionTypeNetwork));
1335 break;
1336 }
1337 }
1338 return strResult;
1339}
1340
1341/* QString <= UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork: */
1342template<> QString toInternalString(const UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork &enmDetailsElementOptionTypeNetwork)
1343{
1344 QString strResult;
1345 switch (enmDetailsElementOptionTypeNetwork)
1346 {
1347 case UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_NotAttached: strResult = "NotAttached"; break;
1348 case UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_NAT: strResult = "NAT"; break;
1349 case UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_BridgedAdapter: strResult = "BridgedAdapter"; break;
1350 case UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_InternalNetwork: strResult = "InternalNetwork"; break;
1351 case UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_HostOnlyAdapter: strResult = "HostOnlyAdapter"; break;
1352 case UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_GenericDriver: strResult = "GenericDriver"; break;
1353 case UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_NATNetwork: strResult = "NATNetwork"; break;
1354#ifdef VBOX_WITH_CLOUD_NET
1355 case UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_CloudNetwork: strResult = "CloudNetwork"; break;
1356#endif
1357#ifdef VBOX_WITH_VMNET
1358 case UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_HostOnlyNetwork: strResult = "HostOnlyNetwork"; break;
1359#endif
1360 default:
1361 {
1362 AssertMsgFailed(("No text for details element option type=%d", enmDetailsElementOptionTypeNetwork));
1363 break;
1364 }
1365 }
1366 return strResult;
1367}
1368
1369/* UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork <= QString: */
1370template<> UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork
1371fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork>(const QString &strDetailsElementOptionTypeNetwork)
1372{
1373 if (strDetailsElementOptionTypeNetwork.compare("NotAttached", Qt::CaseInsensitive) == 0)
1374 return UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_NotAttached;
1375 if (strDetailsElementOptionTypeNetwork.compare("NAT", Qt::CaseInsensitive) == 0)
1376 return UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_NAT;
1377 if (strDetailsElementOptionTypeNetwork.compare("BridgedAdapter", Qt::CaseInsensitive) == 0)
1378 return UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_BridgedAdapter;
1379 if (strDetailsElementOptionTypeNetwork.compare("InternalNetwork", Qt::CaseInsensitive) == 0)
1380 return UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_InternalNetwork;
1381 if (strDetailsElementOptionTypeNetwork.compare("HostOnlyAdapter", Qt::CaseInsensitive) == 0)
1382 return UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_HostOnlyAdapter;
1383 if (strDetailsElementOptionTypeNetwork.compare("GenericDriver", Qt::CaseInsensitive) == 0)
1384 return UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_GenericDriver;
1385 if (strDetailsElementOptionTypeNetwork.compare("NATNetwork", Qt::CaseInsensitive) == 0)
1386 return UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_NATNetwork;
1387#ifdef VBOX_WITH_CLOUD_NET
1388 if (strDetailsElementOptionTypeNetwork.compare("CloudNetwork", Qt::CaseInsensitive) == 0)
1389 return UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_CloudNetwork;
1390#endif
1391#ifdef VBOX_WITH_VMNET
1392 if (strDetailsElementOptionTypeNetwork.compare("HostOnlyNetwork", Qt::CaseInsensitive) == 0)
1393 return UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_HostOnlyNetwork;
1394#endif
1395 return UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_Invalid;
1396}
1397
1398/* QString <= UIExtraDataMetaDefs::DetailsElementOptionTypeSerial: */
1399template<> QString toString(const UIExtraDataMetaDefs::DetailsElementOptionTypeSerial &enmDetailsElementOptionTypeSerial)
1400{
1401 QString strResult;
1402 switch (enmDetailsElementOptionTypeSerial)
1403 {
1404 case UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_Disconnected: strResult = QApplication::translate("UICommon", "Disconnected", "serial port"); break;
1405 case UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_HostPipe: strResult = QApplication::translate("UICommon", "Host Pipe"); break;
1406 case UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_HostDevice: strResult = QApplication::translate("UICommon", "Host Device"); break;
1407 case UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_RawFile: strResult = QApplication::translate("UICommon", "Raw File"); break;
1408 case UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_TCP: strResult = QApplication::translate("UICommon", "TCP"); break;
1409 default:
1410 {
1411 AssertMsgFailed(("No text for details element option type=%d", enmDetailsElementOptionTypeSerial));
1412 break;
1413 }
1414 }
1415 return strResult;
1416}
1417
1418/* QString <= UIExtraDataMetaDefs::DetailsElementOptionTypeSerial: */
1419template<> QString toInternalString(const UIExtraDataMetaDefs::DetailsElementOptionTypeSerial &enmDetailsElementOptionTypeSerial)
1420{
1421 QString strResult;
1422 switch (enmDetailsElementOptionTypeSerial)
1423 {
1424 case UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_Disconnected: strResult = "Disconnected"; break;
1425 case UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_HostPipe: strResult = "HostPipe"; break;
1426 case UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_HostDevice: strResult = "HostDevice"; break;
1427 case UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_RawFile: strResult = "RawFile"; break;
1428 case UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_TCP: strResult = "TCP"; break;
1429 default:
1430 {
1431 AssertMsgFailed(("No text for details element option type=%d", enmDetailsElementOptionTypeSerial));
1432 break;
1433 }
1434 }
1435 return strResult;
1436}
1437
1438/* UIExtraDataMetaDefs::DetailsElementOptionTypeSerial <= QString: */
1439template<> UIExtraDataMetaDefs::DetailsElementOptionTypeSerial
1440fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeSerial>(const QString &strDetailsElementOptionTypeSerial)
1441{
1442 if (strDetailsElementOptionTypeSerial.compare("Disconnected", Qt::CaseInsensitive) == 0)
1443 return UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_Disconnected;
1444 if (strDetailsElementOptionTypeSerial.compare("HostPipe", Qt::CaseInsensitive) == 0)
1445 return UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_HostPipe;
1446 if (strDetailsElementOptionTypeSerial.compare("HostDevice", Qt::CaseInsensitive) == 0)
1447 return UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_HostDevice;
1448 if (strDetailsElementOptionTypeSerial.compare("RawFile", Qt::CaseInsensitive) == 0)
1449 return UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_RawFile;
1450 if (strDetailsElementOptionTypeSerial.compare("TCP", Qt::CaseInsensitive) == 0)
1451 return UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_TCP;
1452 return UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_Invalid;
1453}
1454
1455/* QString <= UIExtraDataMetaDefs::DetailsElementOptionTypeUsb: */
1456template<> QString toString(const UIExtraDataMetaDefs::DetailsElementOptionTypeUsb &enmDetailsElementOptionTypeUsb)
1457{
1458 QString strResult;
1459 switch (enmDetailsElementOptionTypeUsb)
1460 {
1461 case UIExtraDataMetaDefs::DetailsElementOptionTypeUsb_Controller: strResult = QApplication::translate("UICommon", "Controller"); break;
1462 case UIExtraDataMetaDefs::DetailsElementOptionTypeUsb_DeviceFilters: strResult = QApplication::translate("UICommon", "Device Filters"); break;
1463 default:
1464 {
1465 AssertMsgFailed(("No text for details element option type=%d", enmDetailsElementOptionTypeUsb));
1466 break;
1467 }
1468 }
1469 return strResult;
1470}
1471
1472/* QString <= UIExtraDataMetaDefs::DetailsElementOptionTypeUsb: */
1473template<> QString toInternalString(const UIExtraDataMetaDefs::DetailsElementOptionTypeUsb &enmDetailsElementOptionTypeUsb)
1474{
1475 QString strResult;
1476 switch (enmDetailsElementOptionTypeUsb)
1477 {
1478 case UIExtraDataMetaDefs::DetailsElementOptionTypeUsb_Controller: strResult = "Controller"; break;
1479 case UIExtraDataMetaDefs::DetailsElementOptionTypeUsb_DeviceFilters: strResult = "DeviceFilters"; break;
1480 default:
1481 {
1482 AssertMsgFailed(("No text for details element option type=%d", enmDetailsElementOptionTypeUsb));
1483 break;
1484 }
1485 }
1486 return strResult;
1487}
1488
1489/* UIExtraDataMetaDefs::DetailsElementOptionTypeUsb <= QString: */
1490template<> UIExtraDataMetaDefs::DetailsElementOptionTypeUsb
1491fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeUsb>(const QString &strDetailsElementOptionTypeUsb)
1492{
1493 if (strDetailsElementOptionTypeUsb.compare("Controller", Qt::CaseInsensitive) == 0)
1494 return UIExtraDataMetaDefs::DetailsElementOptionTypeUsb_Controller;
1495 if (strDetailsElementOptionTypeUsb.compare("DeviceFilters", Qt::CaseInsensitive) == 0)
1496 return UIExtraDataMetaDefs::DetailsElementOptionTypeUsb_DeviceFilters;
1497 return UIExtraDataMetaDefs::DetailsElementOptionTypeUsb_Invalid;
1498}
1499
1500/* QString <= UIExtraDataMetaDefs::DetailsElementOptionTypeSharedFolders: */
1501template<> QString toString(const UIExtraDataMetaDefs::DetailsElementOptionTypeSharedFolders &enmDetailsElementOptionTypeSharedFolders)
1502{
1503 QString strResult;
1504 switch (enmDetailsElementOptionTypeSharedFolders)
1505 {
1506 default:
1507 {
1508 AssertMsgFailed(("No text for details element option type=%d", enmDetailsElementOptionTypeSharedFolders));
1509 break;
1510 }
1511 }
1512 return strResult;
1513}
1514
1515/* QString <= UIExtraDataMetaDefs::DetailsElementOptionTypeSharedFolders: */
1516template<> QString toInternalString(const UIExtraDataMetaDefs::DetailsElementOptionTypeSharedFolders &enmDetailsElementOptionTypeSharedFolders)
1517{
1518 QString strResult;
1519 switch (enmDetailsElementOptionTypeSharedFolders)
1520 {
1521 default:
1522 {
1523 AssertMsgFailed(("No text for details element option type=%d", enmDetailsElementOptionTypeSharedFolders));
1524 break;
1525 }
1526 }
1527 return strResult;
1528}
1529
1530/* UIExtraDataMetaDefs::DetailsElementOptionTypeSharedFolders <= QString: */
1531template<> UIExtraDataMetaDefs::DetailsElementOptionTypeSharedFolders
1532fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeSharedFolders>(const QString &strDetailsElementOptionTypeSharedFolders)
1533{
1534 RT_NOREF(strDetailsElementOptionTypeSharedFolders);
1535 return UIExtraDataMetaDefs::DetailsElementOptionTypeSharedFolders_Invalid;
1536}
1537
1538/* QString <= UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface: */
1539template<> QString toString(const UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface &enmDetailsElementOptionTypeUserInterface)
1540{
1541 QString strResult;
1542 switch (enmDetailsElementOptionTypeUserInterface)
1543 {
1544 case UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_VisualState: strResult = QApplication::translate("UICommon", "Visual State"); break;
1545 case UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_MenuBar: strResult = QApplication::translate("UICommon", "Menu Bar"); break;
1546 case UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_StatusBar: strResult = QApplication::translate("UICommon", "Status Bar"); break;
1547 case UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_MiniToolbar: strResult = QApplication::translate("UICommon", "Mini Toolbar"); break;
1548 default:
1549 {
1550 AssertMsgFailed(("No text for details element option type=%d", enmDetailsElementOptionTypeUserInterface));
1551 break;
1552 }
1553 }
1554 return strResult;
1555}
1556
1557/* QString <= UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface: */
1558template<> QString toInternalString(const UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface &enmDetailsElementOptionTypeUserInterface)
1559{
1560 QString strResult;
1561 switch (enmDetailsElementOptionTypeUserInterface)
1562 {
1563 case UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_VisualState: strResult = "VisualState"; break;
1564 case UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_MenuBar: strResult = "MenuBar"; break;
1565 case UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_StatusBar: strResult = "StatusBar"; break;
1566 case UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_MiniToolbar: strResult = "MiniToolbar"; break;
1567 default:
1568 {
1569 AssertMsgFailed(("No text for details element option type=%d", enmDetailsElementOptionTypeUserInterface));
1570 break;
1571 }
1572 }
1573 return strResult;
1574}
1575
1576/* UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface <= QString: */
1577template<> UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface
1578fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface>(const QString &strDetailsElementOptionTypeUserInterface)
1579{
1580 if (strDetailsElementOptionTypeUserInterface.compare("VisualState", Qt::CaseInsensitive) == 0)
1581 return UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_VisualState;
1582 if (strDetailsElementOptionTypeUserInterface.compare("MenuBar", Qt::CaseInsensitive) == 0)
1583 return UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_MenuBar;
1584 if (strDetailsElementOptionTypeUserInterface.compare("StatusBar", Qt::CaseInsensitive) == 0)
1585 return UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_StatusBar;
1586 if (strDetailsElementOptionTypeUserInterface.compare("MiniToolbar", Qt::CaseInsensitive) == 0)
1587 return UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_MiniToolbar;
1588 return UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_Invalid;
1589}
1590
1591/* QString <= UIExtraDataMetaDefs::DetailsElementOptionTypeDescription: */
1592template<> QString toString(const UIExtraDataMetaDefs::DetailsElementOptionTypeDescription &enmDetailsElementOptionTypeDescription)
1593{
1594 QString strResult;
1595 switch (enmDetailsElementOptionTypeDescription)
1596 {
1597 default:
1598 {
1599 AssertMsgFailed(("No text for details element option type=%d", enmDetailsElementOptionTypeDescription));
1600 break;
1601 }
1602 }
1603 return strResult;
1604}
1605
1606/* QString <= UIExtraDataMetaDefs::DetailsElementOptionTypeDescription: */
1607template<> QString toInternalString(const UIExtraDataMetaDefs::DetailsElementOptionTypeDescription &enmDetailsElementOptionTypeDescription)
1608{
1609 QString strResult;
1610 switch (enmDetailsElementOptionTypeDescription)
1611 {
1612 default:
1613 {
1614 AssertMsgFailed(("No text for details element option type=%d", enmDetailsElementOptionTypeDescription));
1615 break;
1616 }
1617 }
1618 return strResult;
1619}
1620
1621/* UIExtraDataMetaDefs::DetailsElementOptionTypeDescription <= QString: */
1622template<> UIExtraDataMetaDefs::DetailsElementOptionTypeDescription
1623fromInternalString<UIExtraDataMetaDefs::DetailsElementOptionTypeDescription>(const QString &strDetailsElementOptionTypeDescription)
1624{
1625 RT_NOREF(strDetailsElementOptionTypeDescription);
1626 return UIExtraDataMetaDefs::DetailsElementOptionTypeDescription_Invalid;
1627}
1628
1629/* QString <= UIColorThemeType: */
1630template<> QString toString(const UIColorThemeType &colorThemeType)
1631{
1632 QString strResult;
1633 switch (colorThemeType)
1634 {
1635 case UIColorThemeType_Auto: strResult = QApplication::translate("UICommon", "Follow System Settings", "color theme"); break;
1636 case UIColorThemeType_Light: strResult = QApplication::translate("UICommon", "Light", "color theme"); break;
1637 case UIColorThemeType_Dark: strResult = QApplication::translate("UICommon", "Dark", "color theme"); break;
1638 default:
1639 {
1640 AssertMsgFailed(("No text for color theme type=%d", colorThemeType));
1641 break;
1642 }
1643 }
1644 return strResult;
1645}
1646
1647/* QString <= UIColorThemeType: */
1648template<> QString toInternalString(const UIColorThemeType &colorThemeType)
1649{
1650 QString strResult;
1651 switch (colorThemeType)
1652 {
1653 case UIColorThemeType_Auto: break;
1654 case UIColorThemeType_Light: strResult = "Light"; break;
1655 case UIColorThemeType_Dark: strResult = "Dark"; break;
1656 default:
1657 {
1658 AssertMsgFailed(("No text for color theme type=%d", colorThemeType));
1659 break;
1660 }
1661 }
1662 return strResult;
1663}
1664
1665/* UIColorThemeType <= QString: */
1666template<> UIColorThemeType fromInternalString<UIColorThemeType>(const QString &strColorThemeType)
1667{
1668 if (strColorThemeType.compare("Light", Qt::CaseInsensitive) == 0)
1669 return UIColorThemeType_Light;
1670 if (strColorThemeType.compare("Dark", Qt::CaseInsensitive) == 0)
1671 return UIColorThemeType_Dark;
1672 return UIColorThemeType_Auto;
1673}
1674
1675/* UILaunchMode <= QString: */
1676template<> UILaunchMode fromInternalString<UILaunchMode>(const QString &strDefaultFrontendType)
1677{
1678 if (strDefaultFrontendType.compare("Default", Qt::CaseInsensitive) == 0)
1679 return UILaunchMode_Default;
1680 if (strDefaultFrontendType.compare("Headless", Qt::CaseInsensitive) == 0)
1681 return UILaunchMode_Headless;
1682 if (strDefaultFrontendType.compare("Separate", Qt::CaseInsensitive) == 0)
1683 return UILaunchMode_Separate;
1684 return UILaunchMode_Invalid;
1685}
1686
1687/* QString <= UIToolType: */
1688template<> QString toInternalString(const UIToolType &enmToolType)
1689{
1690 QString strResult;
1691 switch (enmToolType)
1692 {
1693 case UIToolType_Welcome: strResult = "Welcome"; break;
1694 case UIToolType_Extensions: strResult = "Extensions"; break;
1695 case UIToolType_Media: strResult = "Media"; break;
1696 case UIToolType_Network: strResult = "Network"; break;
1697 case UIToolType_Cloud: strResult = "Cloud"; break;
1698 case UIToolType_CloudConsole: strResult = "CloudConsole"; break;
1699 case UIToolType_VMActivityOverview: strResult = "Activities"; break;
1700 case UIToolType_Details: strResult = "Details"; break;
1701 case UIToolType_Snapshots: strResult = "Snapshots"; break;
1702 case UIToolType_Logs: strResult = "Logs"; break;
1703 case UIToolType_VMActivity: strResult = "Activity"; break;
1704 case UIToolType_FileManager: strResult = "FileManager"; break;
1705 default:
1706 {
1707 AssertMsgFailed(("No text for tool type=%d", enmToolType));
1708 break;
1709 }
1710 }
1711 return strResult;
1712}
1713
1714/* UIToolType <= QString: */
1715template<> UIToolType fromInternalString<UIToolType>(const QString &strToolType)
1716{
1717 if (strToolType.compare("Welcome", Qt::CaseInsensitive) == 0)
1718 return UIToolType_Welcome;
1719 if (strToolType.compare("Extensions", Qt::CaseInsensitive) == 0)
1720 return UIToolType_Extensions;
1721 if (strToolType.compare("Media", Qt::CaseInsensitive) == 0)
1722 return UIToolType_Media;
1723 if (strToolType.compare("Network", Qt::CaseInsensitive) == 0)
1724 return UIToolType_Network;
1725 if (strToolType.compare("Cloud", Qt::CaseInsensitive) == 0)
1726 return UIToolType_Cloud;
1727 if (strToolType.compare("CloudConsole", Qt::CaseInsensitive) == 0)
1728 return UIToolType_CloudConsole;
1729 if (strToolType.compare("Activities", Qt::CaseInsensitive) == 0)
1730 return UIToolType_VMActivityOverview;
1731 if (strToolType.compare("Details", Qt::CaseInsensitive) == 0)
1732 return UIToolType_Details;
1733 if (strToolType.compare("Snapshots", Qt::CaseInsensitive) == 0)
1734 return UIToolType_Snapshots;
1735 if (strToolType.compare("Logs", Qt::CaseInsensitive) == 0)
1736 return UIToolType_Logs;
1737 if (strToolType.compare("Activity", Qt::CaseInsensitive) == 0)
1738 return UIToolType_VMActivity;
1739 if (strToolType.compare("FileManager", Qt::CaseInsensitive) == 0)
1740 return UIToolType_FileManager;
1741 return UIToolType_Invalid;
1742}
1743
1744/* QString <= UIVisualStateType: */
1745template<> QString toString(const UIVisualStateType &visualStateType)
1746{
1747 QString strResult;
1748 switch (visualStateType)
1749 {
1750 case UIVisualStateType_Normal: strResult = QApplication::translate("UICommon", "Normal (window)", "visual state"); break;
1751 case UIVisualStateType_Fullscreen: strResult = QApplication::translate("UICommon", "Full-screen", "visual state"); break;
1752 case UIVisualStateType_Seamless: strResult = QApplication::translate("UICommon", "Seamless", "visual state"); break;
1753 case UIVisualStateType_Scale: strResult = QApplication::translate("UICommon", "Scaled", "visual state"); break;
1754 default:
1755 {
1756 AssertMsgFailed(("No text for visual state type=%d", visualStateType));
1757 break;
1758 }
1759 }
1760 return strResult;
1761}
1762
1763/* QString <= UIVisualStateType: */
1764template<> QString toInternalString(const UIVisualStateType &visualStateType)
1765{
1766 QString strResult;
1767 switch (visualStateType)
1768 {
1769 case UIVisualStateType_Normal: strResult = "Normal"; break;
1770 case UIVisualStateType_Fullscreen: strResult = "Fullscreen"; break;
1771 case UIVisualStateType_Seamless: strResult = "Seamless"; break;
1772 case UIVisualStateType_Scale: strResult = "Scale"; break;
1773 case UIVisualStateType_All: strResult = "All"; break;
1774 default:
1775 {
1776 AssertMsgFailed(("No text for visual state type=%d", visualStateType));
1777 break;
1778 }
1779 }
1780 return strResult;
1781}
1782
1783/* UIVisualStateType <= QString: */
1784template<> UIVisualStateType fromInternalString<UIVisualStateType>(const QString &strVisualStateType)
1785{
1786 if (strVisualStateType.compare("Normal", Qt::CaseInsensitive) == 0)
1787 return UIVisualStateType_Normal;
1788 if (strVisualStateType.compare("Fullscreen", Qt::CaseInsensitive) == 0)
1789 return UIVisualStateType_Fullscreen;
1790 if (strVisualStateType.compare("Seamless", Qt::CaseInsensitive) == 0)
1791 return UIVisualStateType_Seamless;
1792 if (strVisualStateType.compare("Scale", Qt::CaseInsensitive) == 0)
1793 return UIVisualStateType_Scale;
1794 if (strVisualStateType.compare("All", Qt::CaseInsensitive) == 0)
1795 return UIVisualStateType_All;
1796 return UIVisualStateType_Invalid;
1797}
1798
1799/* QString <= DetailsElementType: */
1800template<> QString toString(const DetailsElementType &detailsElementType)
1801{
1802 QString strResult;
1803 switch (detailsElementType)
1804 {
1805 case DetailsElementType_General: strResult = QApplication::translate("UICommon", "General", "DetailsElementType"); break;
1806 case DetailsElementType_Preview: strResult = QApplication::translate("UICommon", "Preview", "DetailsElementType"); break;
1807 case DetailsElementType_System: strResult = QApplication::translate("UICommon", "System", "DetailsElementType"); break;
1808 case DetailsElementType_Display: strResult = QApplication::translate("UICommon", "Display", "DetailsElementType"); break;
1809 case DetailsElementType_Storage: strResult = QApplication::translate("UICommon", "Storage", "DetailsElementType"); break;
1810 case DetailsElementType_Audio: strResult = QApplication::translate("UICommon", "Audio", "DetailsElementType"); break;
1811 case DetailsElementType_Network: strResult = QApplication::translate("UICommon", "Network", "DetailsElementType"); break;
1812 case DetailsElementType_Serial: strResult = QApplication::translate("UICommon", "Serial ports", "DetailsElementType"); break;
1813 case DetailsElementType_USB: strResult = QApplication::translate("UICommon", "USB", "DetailsElementType"); break;
1814 case DetailsElementType_SF: strResult = QApplication::translate("UICommon", "Shared folders", "DetailsElementType"); break;
1815 case DetailsElementType_UI: strResult = QApplication::translate("UICommon", "User interface", "DetailsElementType"); break;
1816 case DetailsElementType_Description: strResult = QApplication::translate("UICommon", "Description", "DetailsElementType"); break;
1817 default:
1818 {
1819 AssertMsgFailed(("No text for details element type=%d", detailsElementType));
1820 break;
1821 }
1822 }
1823 return strResult;
1824}
1825
1826/* DetailsElementType <= QString: */
1827template<> DetailsElementType fromString<DetailsElementType>(const QString &strDetailsElementType)
1828{
1829 if (strDetailsElementType.compare(QApplication::translate("UICommon", "General", "DetailsElementType"), Qt::CaseInsensitive) == 0)
1830 return DetailsElementType_General;
1831 if (strDetailsElementType.compare(QApplication::translate("UICommon", "Preview", "DetailsElementType"), Qt::CaseInsensitive) == 0)
1832 return DetailsElementType_Preview;
1833 if (strDetailsElementType.compare(QApplication::translate("UICommon", "System", "DetailsElementType"), Qt::CaseInsensitive) == 0)
1834 return DetailsElementType_System;
1835 if (strDetailsElementType.compare(QApplication::translate("UICommon", "Display", "DetailsElementType"), Qt::CaseInsensitive) == 0)
1836 return DetailsElementType_Display;
1837 if (strDetailsElementType.compare(QApplication::translate("UICommon", "Storage", "DetailsElementType"), Qt::CaseInsensitive) == 0)
1838 return DetailsElementType_Storage;
1839 if (strDetailsElementType.compare(QApplication::translate("UICommon", "Audio", "DetailsElementType"), Qt::CaseInsensitive) == 0)
1840 return DetailsElementType_Audio;
1841 if (strDetailsElementType.compare(QApplication::translate("UICommon", "Network", "DetailsElementType"), Qt::CaseInsensitive) == 0)
1842 return DetailsElementType_Network;
1843 if (strDetailsElementType.compare(QApplication::translate("UICommon", "Serial ports", "DetailsElementType"), Qt::CaseInsensitive) == 0)
1844 return DetailsElementType_Serial;
1845 if (strDetailsElementType.compare(QApplication::translate("UICommon", "USB", "DetailsElementType"), Qt::CaseInsensitive) == 0)
1846 return DetailsElementType_USB;
1847 if (strDetailsElementType.compare(QApplication::translate("UICommon", "Shared folders", "DetailsElementType"), Qt::CaseInsensitive) == 0)
1848 return DetailsElementType_SF;
1849 if (strDetailsElementType.compare(QApplication::translate("UICommon", "User interface", "DetailsElementType"), Qt::CaseInsensitive) == 0)
1850 return DetailsElementType_UI;
1851 if (strDetailsElementType.compare(QApplication::translate("UICommon", "Description", "DetailsElementType"), Qt::CaseInsensitive) == 0)
1852 return DetailsElementType_Description;
1853 return DetailsElementType_Invalid;
1854}
1855
1856/* QString <= DetailsElementType: */
1857template<> QString toInternalString(const DetailsElementType &detailsElementType)
1858{
1859 QString strResult;
1860 switch (detailsElementType)
1861 {
1862 case DetailsElementType_General: strResult = "general"; break;
1863 case DetailsElementType_Preview: strResult = "preview"; break;
1864 case DetailsElementType_System: strResult = "system"; break;
1865 case DetailsElementType_Display: strResult = "display"; break;
1866 case DetailsElementType_Storage: strResult = "storage"; break;
1867 case DetailsElementType_Audio: strResult = "audio"; break;
1868 case DetailsElementType_Network: strResult = "network"; break;
1869 case DetailsElementType_Serial: strResult = "serialPorts"; break;
1870 case DetailsElementType_USB: strResult = "usb"; break;
1871 case DetailsElementType_SF: strResult = "sharedFolders"; break;
1872 case DetailsElementType_UI: strResult = "userInterface"; break;
1873 case DetailsElementType_Description: strResult = "description"; break;
1874 default:
1875 {
1876 AssertMsgFailed(("No text for details element type=%d", detailsElementType));
1877 break;
1878 }
1879 }
1880 return strResult;
1881}
1882
1883/* DetailsElementType <= QString: */
1884template<> DetailsElementType fromInternalString<DetailsElementType>(const QString &strDetailsElementType)
1885{
1886 if (strDetailsElementType.compare("general", Qt::CaseInsensitive) == 0)
1887 return DetailsElementType_General;
1888 if (strDetailsElementType.compare("preview", Qt::CaseInsensitive) == 0)
1889 return DetailsElementType_Preview;
1890 if (strDetailsElementType.compare("system", Qt::CaseInsensitive) == 0)
1891 return DetailsElementType_System;
1892 if (strDetailsElementType.compare("display", Qt::CaseInsensitive) == 0)
1893 return DetailsElementType_Display;
1894 if (strDetailsElementType.compare("storage", Qt::CaseInsensitive) == 0)
1895 return DetailsElementType_Storage;
1896 if (strDetailsElementType.compare("audio", Qt::CaseInsensitive) == 0)
1897 return DetailsElementType_Audio;
1898 if (strDetailsElementType.compare("network", Qt::CaseInsensitive) == 0)
1899 return DetailsElementType_Network;
1900 if (strDetailsElementType.compare("serialPorts", Qt::CaseInsensitive) == 0)
1901 return DetailsElementType_Serial;
1902 if (strDetailsElementType.compare("usb", Qt::CaseInsensitive) == 0)
1903 return DetailsElementType_USB;
1904 if (strDetailsElementType.compare("sharedFolders", Qt::CaseInsensitive) == 0)
1905 return DetailsElementType_SF;
1906 if (strDetailsElementType.compare("userInterface", Qt::CaseInsensitive) == 0)
1907 return DetailsElementType_UI;
1908 if (strDetailsElementType.compare("description", Qt::CaseInsensitive) == 0)
1909 return DetailsElementType_Description;
1910 return DetailsElementType_Invalid;
1911}
1912
1913/* QIcon <= DetailsElementType: */
1914template<> QIcon toIcon(const DetailsElementType &detailsElementType)
1915{
1916 switch (detailsElementType)
1917 {
1918 case DetailsElementType_General: return UIIconPool::iconSet(":/machine_16px.png");
1919 case DetailsElementType_Preview: return UIIconPool::iconSet(":/machine_16px.png");
1920 case DetailsElementType_System: return UIIconPool::iconSet(":/chipset_16px.png");
1921 case DetailsElementType_Display: return UIIconPool::iconSet(":/vrdp_16px.png");
1922 case DetailsElementType_Storage: return UIIconPool::iconSet(":/hd_16px.png");
1923 case DetailsElementType_Audio: return UIIconPool::iconSet(":/sound_16px.png");
1924 case DetailsElementType_Network: return UIIconPool::iconSet(":/nw_16px.png");
1925 case DetailsElementType_Serial: return UIIconPool::iconSet(":/serial_port_16px.png");
1926 case DetailsElementType_USB: return UIIconPool::iconSet(":/usb_16px.png");
1927 case DetailsElementType_SF: return UIIconPool::iconSet(":/sf_16px.png");
1928 case DetailsElementType_UI: return UIIconPool::iconSet(":/interface_16px.png");
1929 case DetailsElementType_Description: return UIIconPool::iconSet(":/description_16px.png");
1930 default:
1931 {
1932 AssertMsgFailed(("No icon for details element type=%d", detailsElementType));
1933 break;
1934 }
1935 }
1936 return QIcon();
1937}
1938
1939/* QString <= PreviewUpdateIntervalType: */
1940template<> QString toInternalString(const PreviewUpdateIntervalType &previewUpdateIntervalType)
1941{
1942 /* Return corresponding QString representation for passed enum value: */
1943 switch (previewUpdateIntervalType)
1944 {
1945 case PreviewUpdateIntervalType_Disabled: return "disabled";
1946 case PreviewUpdateIntervalType_500ms: return "500";
1947 case PreviewUpdateIntervalType_1000ms: return "1000";
1948 case PreviewUpdateIntervalType_2000ms: return "2000";
1949 case PreviewUpdateIntervalType_5000ms: return "5000";
1950 case PreviewUpdateIntervalType_10000ms: return "10000";
1951 default: AssertMsgFailed(("No text for '%d'", previewUpdateIntervalType)); break;
1952 }
1953 /* Return QString() by default: */
1954 return QString();
1955}
1956
1957/* PreviewUpdateIntervalType <= QString: */
1958template<> PreviewUpdateIntervalType fromInternalString<PreviewUpdateIntervalType>(const QString &strPreviewUpdateIntervalType)
1959{
1960 if (strPreviewUpdateIntervalType.compare("disabled", Qt::CaseInsensitive) == 0)
1961 return PreviewUpdateIntervalType_Disabled;
1962 if (strPreviewUpdateIntervalType.compare("500", Qt::CaseInsensitive) == 0)
1963 return PreviewUpdateIntervalType_500ms;
1964 if (strPreviewUpdateIntervalType.compare("1000", Qt::CaseInsensitive) == 0)
1965 return PreviewUpdateIntervalType_1000ms;
1966 if (strPreviewUpdateIntervalType.compare("2000", Qt::CaseInsensitive) == 0)
1967 return PreviewUpdateIntervalType_2000ms;
1968 if (strPreviewUpdateIntervalType.compare("5000", Qt::CaseInsensitive) == 0)
1969 return PreviewUpdateIntervalType_5000ms;
1970 if (strPreviewUpdateIntervalType.compare("10000", Qt::CaseInsensitive) == 0)
1971 return PreviewUpdateIntervalType_10000ms;
1972 /* 1000ms type for unknown input: */
1973 return PreviewUpdateIntervalType_1000ms;
1974}
1975
1976/* int <= PreviewUpdateIntervalType: */
1977template<> int toInternalInteger(const PreviewUpdateIntervalType &previewUpdateIntervalType)
1978{
1979 /* Return corresponding integer representation for passed enum value: */
1980 switch (previewUpdateIntervalType)
1981 {
1982 case PreviewUpdateIntervalType_Disabled: return 0;
1983 case PreviewUpdateIntervalType_500ms: return 500;
1984 case PreviewUpdateIntervalType_1000ms: return 1000;
1985 case PreviewUpdateIntervalType_2000ms: return 2000;
1986 case PreviewUpdateIntervalType_5000ms: return 5000;
1987 case PreviewUpdateIntervalType_10000ms: return 10000;
1988 default: AssertMsgFailed(("No value for '%d'", previewUpdateIntervalType)); break;
1989 }
1990 /* Return 0 by default: */
1991 return 0;
1992}
1993
1994/* PreviewUpdateIntervalType <= int: */
1995template<> PreviewUpdateIntervalType fromInternalInteger<PreviewUpdateIntervalType>(const int &iPreviewUpdateIntervalType)
1996{
1997 /* Add all the enum values into the hash: */
1998 QHash<int, PreviewUpdateIntervalType> hash;
1999 hash.insert(0, PreviewUpdateIntervalType_Disabled);
2000 hash.insert(500, PreviewUpdateIntervalType_500ms);
2001 hash.insert(1000, PreviewUpdateIntervalType_1000ms);
2002 hash.insert(2000, PreviewUpdateIntervalType_2000ms);
2003 hash.insert(5000, PreviewUpdateIntervalType_5000ms);
2004 hash.insert(10000, PreviewUpdateIntervalType_10000ms);
2005 /* Make sure hash contains incoming integer representation: */
2006 if (!hash.contains(iPreviewUpdateIntervalType))
2007 AssertMsgFailed(("No value for '%d'", iPreviewUpdateIntervalType));
2008 /* Return corresponding enum value for passed integer representation: */
2009 return hash.value(iPreviewUpdateIntervalType);
2010}
2011
2012/* QString <= UIDiskEncryptionCipherType: */
2013template<> QString toInternalString(const UIDiskEncryptionCipherType &enmDiskEncryptionCipherType)
2014{
2015 switch (enmDiskEncryptionCipherType)
2016 {
2017 case UIDiskEncryptionCipherType_XTS256: return "AES-XTS256-PLAIN64";
2018 case UIDiskEncryptionCipherType_XTS128: return "AES-XTS128-PLAIN64";
2019 default: break;
2020 }
2021 return QString();
2022}
2023
2024/* UIDiskEncryptionCipherType <= QString: */
2025template<> UIDiskEncryptionCipherType fromInternalString<UIDiskEncryptionCipherType>(const QString &strDiskEncryptionCipherType)
2026{
2027 if (strDiskEncryptionCipherType.compare("AES-XTS256-PLAIN64", Qt::CaseInsensitive) == 0)
2028 return UIDiskEncryptionCipherType_XTS256;
2029 if (strDiskEncryptionCipherType.compare("AES-XTS128-PLAIN64", Qt::CaseInsensitive) == 0)
2030 return UIDiskEncryptionCipherType_XTS128;
2031 return UIDiskEncryptionCipherType_Unchanged;
2032}
2033
2034/* QString <= UIDiskEncryptionCipherType: */
2035template<> QString toString(const UIDiskEncryptionCipherType &enmDiskEncryptionCipherType)
2036{
2037 switch (enmDiskEncryptionCipherType)
2038 {
2039 case UIDiskEncryptionCipherType_XTS256: return "AES-XTS256-PLAIN64";
2040 case UIDiskEncryptionCipherType_XTS128: return "AES-XTS128-PLAIN64";
2041 default: break;
2042 }
2043 return QApplication::translate("UICommon", "Leave Unchanged", "cipher type");
2044}
2045
2046/* UIDiskEncryptionCipherType <= QString: */
2047template<> UIDiskEncryptionCipherType fromString<UIDiskEncryptionCipherType>(const QString &strDiskEncryptionCipherType)
2048{
2049 if (strDiskEncryptionCipherType.compare("AES-XTS256-PLAIN64", Qt::CaseInsensitive) == 0)
2050 return UIDiskEncryptionCipherType_XTS256;
2051 if (strDiskEncryptionCipherType.compare("AES-XTS128-PLAIN64", Qt::CaseInsensitive) == 0)
2052 return UIDiskEncryptionCipherType_XTS128;
2053 return UIDiskEncryptionCipherType_Unchanged;
2054}
2055
2056/* QString <= GUIFeatureType: */
2057template<> QString toInternalString(const GUIFeatureType &guiFeatureType)
2058{
2059 QString strResult;
2060 switch (guiFeatureType)
2061 {
2062 case GUIFeatureType_NoSelector: strResult = "noSelector"; break;
2063#ifdef VBOX_WS_MAC
2064 case GUIFeatureType_NoUserElements: strResult = "noUserElements"; break;
2065#else
2066 case GUIFeatureType_NoMenuBar: strResult = "noMenuBar"; break;
2067#endif
2068 case GUIFeatureType_NoStatusBar: strResult = "noStatusBar"; break;
2069 default:
2070 {
2071 AssertMsgFailed(("No text for GUI feature type=%d", guiFeatureType));
2072 break;
2073 }
2074 }
2075 return strResult;
2076}
2077
2078/* GUIFeatureType <= QString: */
2079template<> GUIFeatureType fromInternalString<GUIFeatureType>(const QString &strGuiFeatureType)
2080{
2081 if (strGuiFeatureType.compare("noSelector", Qt::CaseInsensitive) == 0)
2082 return GUIFeatureType_NoSelector;
2083#ifdef VBOX_WS_MAC
2084 if (strGuiFeatureType.compare("noUserElements", Qt::CaseInsensitive) == 0)
2085 return GUIFeatureType_NoUserElements;
2086#else
2087 if (strGuiFeatureType.compare("noMenuBar", Qt::CaseInsensitive) == 0)
2088 return GUIFeatureType_NoMenuBar;
2089#endif
2090 if (strGuiFeatureType.compare("noStatusBar", Qt::CaseInsensitive) == 0)
2091 return GUIFeatureType_NoStatusBar;
2092 return GUIFeatureType_None;
2093}
2094
2095/* QString <= GlobalSettingsPageType: */
2096template<> QString toInternalString(const GlobalSettingsPageType &globalSettingsPageType)
2097{
2098 QString strResult;
2099 switch (globalSettingsPageType)
2100 {
2101 case GlobalSettingsPageType_General: strResult = "General"; break;
2102 case GlobalSettingsPageType_Input: strResult = "Input"; break;
2103#ifdef VBOX_GUI_WITH_NETWORK_MANAGER
2104 case GlobalSettingsPageType_Update: strResult = "Update"; break;
2105#endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
2106 case GlobalSettingsPageType_Language: strResult = "Language"; break;
2107 case GlobalSettingsPageType_Display: strResult = "Display"; break;
2108#ifdef VBOX_GUI_WITH_NETWORK_MANAGER
2109 case GlobalSettingsPageType_Proxy: strResult = "Proxy"; break;
2110#endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
2111 case GlobalSettingsPageType_Interface: strResult = "Interface"; break;
2112 default:
2113 {
2114 AssertMsgFailed(("No text for settings page type=%d", globalSettingsPageType));
2115 break;
2116 }
2117 }
2118 return strResult;
2119}
2120
2121/* GlobalSettingsPageType <= QString: */
2122template<> GlobalSettingsPageType fromInternalString<GlobalSettingsPageType>(const QString &strGlobalSettingsPageType)
2123{
2124 if (strGlobalSettingsPageType.compare("General", Qt::CaseInsensitive) == 0)
2125 return GlobalSettingsPageType_General;
2126 if (strGlobalSettingsPageType.compare("Input", Qt::CaseInsensitive) == 0)
2127 return GlobalSettingsPageType_Input;
2128#ifdef VBOX_GUI_WITH_NETWORK_MANAGER
2129 if (strGlobalSettingsPageType.compare("Update", Qt::CaseInsensitive) == 0)
2130 return GlobalSettingsPageType_Update;
2131#endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
2132 if (strGlobalSettingsPageType.compare("Language", Qt::CaseInsensitive) == 0)
2133 return GlobalSettingsPageType_Language;
2134 if (strGlobalSettingsPageType.compare("Display", Qt::CaseInsensitive) == 0)
2135 return GlobalSettingsPageType_Display;
2136#ifdef VBOX_GUI_WITH_NETWORK_MANAGER
2137 if (strGlobalSettingsPageType.compare("Proxy", Qt::CaseInsensitive) == 0)
2138 return GlobalSettingsPageType_Proxy;
2139#endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
2140 if (strGlobalSettingsPageType.compare("Interface", Qt::CaseInsensitive) == 0)
2141 return GlobalSettingsPageType_Interface;
2142 return GlobalSettingsPageType_Invalid;
2143}
2144
2145/* QPixmap <= GlobalSettingsPageType: */
2146template<> QPixmap toWarningPixmap(const GlobalSettingsPageType &type)
2147{
2148 switch (type)
2149 {
2150 case GlobalSettingsPageType_General: return UIIconPool::pixmap(":/machine_warning_16px.png");
2151 case GlobalSettingsPageType_Input: return UIIconPool::pixmap(":/hostkey_warning_16px.png");
2152#ifdef VBOX_GUI_WITH_NETWORK_MANAGER
2153 case GlobalSettingsPageType_Update: return UIIconPool::pixmap(":/refresh_warning_16px.png");
2154#endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
2155 case GlobalSettingsPageType_Language: return UIIconPool::pixmap(":/site_warning_16px.png");
2156 case GlobalSettingsPageType_Display: return UIIconPool::pixmap(":/vrdp_warning_16px.png");
2157#ifdef VBOX_GUI_WITH_NETWORK_MANAGER
2158 case GlobalSettingsPageType_Proxy: return UIIconPool::pixmap(":/proxy_warning_16px.png");
2159#endif /* VBOX_GUI_WITH_NETWORK_MANAGER */
2160 case GlobalSettingsPageType_Interface: return UIIconPool::pixmap(":/interface_warning_16px.png");
2161 default: AssertMsgFailed(("No pixmap for %d", type)); break;
2162 }
2163 return QPixmap();
2164}
2165
2166/* QString <= MachineSettingsPageType: */
2167template<> QString toInternalString(const MachineSettingsPageType &machineSettingsPageType)
2168{
2169 QString strResult;
2170 switch (machineSettingsPageType)
2171 {
2172 case MachineSettingsPageType_General: strResult = "General"; break;
2173 case MachineSettingsPageType_System: strResult = "System"; break;
2174 case MachineSettingsPageType_Display: strResult = "Display"; break;
2175 case MachineSettingsPageType_Storage: strResult = "Storage"; break;
2176 case MachineSettingsPageType_Audio: strResult = "Audio"; break;
2177 case MachineSettingsPageType_Network: strResult = "Network"; break;
2178 case MachineSettingsPageType_Ports: strResult = "Ports"; break;
2179 case MachineSettingsPageType_Serial: strResult = "Serial"; break;
2180 case MachineSettingsPageType_USB: strResult = "USB"; break;
2181 case MachineSettingsPageType_SF: strResult = "SharedFolders"; break;
2182 case MachineSettingsPageType_Interface: strResult = "Interface"; break;
2183 default:
2184 {
2185 AssertMsgFailed(("No text for settings page type=%d", machineSettingsPageType));
2186 break;
2187 }
2188 }
2189 return strResult;
2190}
2191
2192/* MachineSettingsPageType <= QString: */
2193template<> MachineSettingsPageType fromInternalString<MachineSettingsPageType>(const QString &strMachineSettingsPageType)
2194{
2195 if (strMachineSettingsPageType.compare("General", Qt::CaseInsensitive) == 0)
2196 return MachineSettingsPageType_General;
2197 if (strMachineSettingsPageType.compare("System", Qt::CaseInsensitive) == 0)
2198 return MachineSettingsPageType_System;
2199 if (strMachineSettingsPageType.compare("Display", Qt::CaseInsensitive) == 0)
2200 return MachineSettingsPageType_Display;
2201 if (strMachineSettingsPageType.compare("Storage", Qt::CaseInsensitive) == 0)
2202 return MachineSettingsPageType_Storage;
2203 if (strMachineSettingsPageType.compare("Audio", Qt::CaseInsensitive) == 0)
2204 return MachineSettingsPageType_Audio;
2205 if (strMachineSettingsPageType.compare("Network", Qt::CaseInsensitive) == 0)
2206 return MachineSettingsPageType_Network;
2207 if (strMachineSettingsPageType.compare("Ports", Qt::CaseInsensitive) == 0)
2208 return MachineSettingsPageType_Ports;
2209 if (strMachineSettingsPageType.compare("Serial", Qt::CaseInsensitive) == 0)
2210 return MachineSettingsPageType_Serial;
2211 if (strMachineSettingsPageType.compare("USB", Qt::CaseInsensitive) == 0)
2212 return MachineSettingsPageType_USB;
2213 if (strMachineSettingsPageType.compare("SharedFolders", Qt::CaseInsensitive) == 0)
2214 return MachineSettingsPageType_SF;
2215 if (strMachineSettingsPageType.compare("Interface", Qt::CaseInsensitive) == 0)
2216 return MachineSettingsPageType_Interface;
2217 return MachineSettingsPageType_Invalid;
2218}
2219
2220/* QPixmap <= MachineSettingsPageType: */
2221template<> QPixmap toWarningPixmap(const MachineSettingsPageType &type)
2222{
2223 switch (type)
2224 {
2225 case MachineSettingsPageType_General: return UIIconPool::pixmap(":/machine_warning_16px.png");
2226 case MachineSettingsPageType_System: return UIIconPool::pixmap(":/chipset_warning_16px.png");
2227 case MachineSettingsPageType_Display: return UIIconPool::pixmap(":/vrdp_warning_16px.png");
2228 case MachineSettingsPageType_Storage: return UIIconPool::pixmap(":/hd_warning_16px.png");
2229 case MachineSettingsPageType_Audio: return UIIconPool::pixmap(":/sound_warning_16px.png");
2230 case MachineSettingsPageType_Network: return UIIconPool::pixmap(":/nw_warning_16px.png");
2231 case MachineSettingsPageType_Ports: return UIIconPool::pixmap(":/serial_port_warning_16px.png");
2232 case MachineSettingsPageType_Serial: return UIIconPool::pixmap(":/serial_port_warning_16px.png");
2233 case MachineSettingsPageType_USB: return UIIconPool::pixmap(":/usb_warning_16px.png");
2234 case MachineSettingsPageType_SF: return UIIconPool::pixmap(":/sf_warning_16px.png");
2235 case MachineSettingsPageType_Interface: return UIIconPool::pixmap(":/interface_warning_16px.png");
2236 default: AssertMsgFailed(("No pixmap for %d", type)); break;
2237 }
2238 return QPixmap();
2239}
2240
2241/* QString <= UIRemoteMode: */
2242template<> QString toString(const UIRemoteMode &enmMode)
2243{
2244 QString strResult;
2245 switch (enmMode)
2246 {
2247 case UIRemoteMode_Any: strResult = QApplication::translate("UICommon", "Any", "USB filter remote"); break;
2248 case UIRemoteMode_On: strResult = QApplication::translate("UICommon", "Yes", "USB filter remote"); break;
2249 case UIRemoteMode_Off: strResult = QApplication::translate("UICommon", "No", "USB filter remote"); break;
2250 default:
2251 {
2252 AssertMsgFailed(("No text for USB filter remote mode=%d", enmMode));
2253 break;
2254 }
2255 }
2256 return strResult;
2257}
2258
2259/* QString <= WizardType: */
2260template<> QString toInternalString(const WizardType &wizardType)
2261{
2262 QString strResult;
2263 switch (wizardType)
2264 {
2265 case WizardType_NewVM: strResult = "NewVM"; break;
2266 case WizardType_CloneVM: strResult = "CloneVM"; break;
2267 case WizardType_ExportAppliance: strResult = "ExportAppliance"; break;
2268 case WizardType_ImportAppliance: strResult = "ImportAppliance"; break;
2269 case WizardType_NewCloudVM: strResult = "NewCloudVM"; break;
2270 case WizardType_AddCloudVM: strResult = "AddCloudVM"; break;
2271 case WizardType_NewVD: strResult = "NewVD"; break;
2272 case WizardType_CloneVD: strResult = "CloneVD"; break;
2273 default:
2274 {
2275 AssertMsgFailed(("No text for wizard type=%d", wizardType));
2276 break;
2277 }
2278 }
2279 return strResult;
2280}
2281
2282/* WizardType <= QString: */
2283template<> WizardType fromInternalString<WizardType>(const QString &strWizardType)
2284{
2285 if (strWizardType.compare("NewVM", Qt::CaseInsensitive) == 0)
2286 return WizardType_NewVM;
2287 if (strWizardType.compare("CloneVM", Qt::CaseInsensitive) == 0)
2288 return WizardType_CloneVM;
2289 if (strWizardType.compare("ExportAppliance", Qt::CaseInsensitive) == 0)
2290 return WizardType_ExportAppliance;
2291 if (strWizardType.compare("ImportAppliance", Qt::CaseInsensitive) == 0)
2292 return WizardType_ImportAppliance;
2293 if (strWizardType.compare("NewCloudVM", Qt::CaseInsensitive) == 0)
2294 return WizardType_NewCloudVM;
2295 if (strWizardType.compare("AddCloudVM", Qt::CaseInsensitive) == 0)
2296 return WizardType_AddCloudVM;
2297 if (strWizardType.compare("NewVD", Qt::CaseInsensitive) == 0)
2298 return WizardType_NewVD;
2299 if (strWizardType.compare("CloneVD", Qt::CaseInsensitive) == 0)
2300 return WizardType_CloneVD;
2301 return WizardType_Invalid;
2302}
2303
2304/* QString <= IndicatorType: */
2305template<> QString toInternalString(const IndicatorType &indicatorType)
2306{
2307 QString strResult;
2308 switch (indicatorType)
2309 {
2310 case IndicatorType_HardDisks: strResult = "HardDisks"; break;
2311 case IndicatorType_OpticalDisks: strResult = "OpticalDisks"; break;
2312 case IndicatorType_FloppyDisks: strResult = "FloppyDisks"; break;
2313 case IndicatorType_Audio: strResult = "Audio"; break;
2314 case IndicatorType_Network: strResult = "Network"; break;
2315 case IndicatorType_USB: strResult = "USB"; break;
2316 case IndicatorType_SharedFolders: strResult = "SharedFolders"; break;
2317 case IndicatorType_Display: strResult = "Display"; break;
2318 case IndicatorType_Recording: strResult = "Recording"; break;
2319 case IndicatorType_Features: strResult = "Features"; break;
2320 case IndicatorType_Mouse: strResult = "Mouse"; break;
2321 case IndicatorType_Keyboard: strResult = "Keyboard"; break;
2322 default:
2323 {
2324 AssertMsgFailed(("No text for indicator type=%d", indicatorType));
2325 break;
2326 }
2327 }
2328 return strResult;
2329}
2330
2331/* IndicatorType <= QString: */
2332template<> IndicatorType fromInternalString<IndicatorType>(const QString &strIndicatorType)
2333{
2334 if (strIndicatorType.compare("HardDisks", Qt::CaseInsensitive) == 0)
2335 return IndicatorType_HardDisks;
2336 if (strIndicatorType.compare("OpticalDisks", Qt::CaseInsensitive) == 0)
2337 return IndicatorType_OpticalDisks;
2338 if (strIndicatorType.compare("FloppyDisks", Qt::CaseInsensitive) == 0)
2339 return IndicatorType_FloppyDisks;
2340 if (strIndicatorType.compare("Audio", Qt::CaseInsensitive) == 0)
2341 return IndicatorType_Audio;
2342 if (strIndicatorType.compare("Network", Qt::CaseInsensitive) == 0)
2343 return IndicatorType_Network;
2344 if (strIndicatorType.compare("USB", Qt::CaseInsensitive) == 0)
2345 return IndicatorType_USB;
2346 if (strIndicatorType.compare("SharedFolders", Qt::CaseInsensitive) == 0)
2347 return IndicatorType_SharedFolders;
2348 if (strIndicatorType.compare("Display", Qt::CaseInsensitive) == 0)
2349 return IndicatorType_Display;
2350 if (strIndicatorType.compare("Recording", Qt::CaseInsensitive) == 0)
2351 return IndicatorType_Recording;
2352 if (strIndicatorType.compare("Features", Qt::CaseInsensitive) == 0)
2353 return IndicatorType_Features;
2354 if (strIndicatorType.compare("Mouse", Qt::CaseInsensitive) == 0)
2355 return IndicatorType_Mouse;
2356 if (strIndicatorType.compare("Keyboard", Qt::CaseInsensitive) == 0)
2357 return IndicatorType_Keyboard;
2358 return IndicatorType_Invalid;
2359}
2360
2361/* QString <= IndicatorType: */
2362template<> QString toString(const IndicatorType &indicatorType)
2363{
2364 QString strResult;
2365 switch (indicatorType)
2366 {
2367 case IndicatorType_HardDisks: strResult = QApplication::translate("UICommon", "Hard Disks", "IndicatorType"); break;
2368 case IndicatorType_OpticalDisks: strResult = QApplication::translate("UICommon", "Optical Disks", "IndicatorType"); break;
2369 case IndicatorType_FloppyDisks: strResult = QApplication::translate("UICommon", "Floppy Disks", "IndicatorType"); break;
2370 case IndicatorType_Audio: strResult = QApplication::translate("UICommon", "Audio", "IndicatorType"); break;
2371 case IndicatorType_Network: strResult = QApplication::translate("UICommon", "Network", "IndicatorType"); break;
2372 case IndicatorType_USB: strResult = QApplication::translate("UICommon", "USB", "IndicatorType"); break;
2373 case IndicatorType_SharedFolders: strResult = QApplication::translate("UICommon", "Shared Folders", "IndicatorType"); break;
2374 case IndicatorType_Display: strResult = QApplication::translate("UICommon", "Display", "IndicatorType"); break;
2375 case IndicatorType_Recording: strResult = QApplication::translate("UICommon", "Recording", "IndicatorType"); break;
2376 case IndicatorType_Features: strResult = QApplication::translate("UICommon", "Features", "IndicatorType"); break;
2377 case IndicatorType_Mouse: strResult = QApplication::translate("UICommon", "Mouse", "IndicatorType"); break;
2378 case IndicatorType_Keyboard: strResult = QApplication::translate("UICommon", "Keyboard", "IndicatorType"); break;
2379 default:
2380 {
2381 AssertMsgFailed(("No text for indicator type=%d", indicatorType));
2382 break;
2383 }
2384 }
2385 return strResult;
2386}
2387
2388/* QIcon <= IndicatorType: */
2389template<> QIcon toIcon(const IndicatorType &indicatorType)
2390{
2391 switch (indicatorType)
2392 {
2393 case IndicatorType_HardDisks: return UIIconPool::iconSet(":/hd_16px.png");
2394 case IndicatorType_OpticalDisks: return UIIconPool::iconSet(":/cd_16px.png");
2395 case IndicatorType_FloppyDisks: return UIIconPool::iconSet(":/fd_16px.png");
2396 case IndicatorType_Audio: return UIIconPool::iconSet(":/audio_16px.png");
2397 case IndicatorType_Network: return UIIconPool::iconSet(":/nw_16px.png");
2398 case IndicatorType_USB: return UIIconPool::iconSet(":/usb_16px.png");
2399 case IndicatorType_SharedFolders: return UIIconPool::iconSet(":/sf_16px.png");
2400 case IndicatorType_Display: return UIIconPool::iconSet(":/display_software_16px.png");
2401 case IndicatorType_Recording: return UIIconPool::iconSet(":/video_capture_16px.png");
2402 case IndicatorType_Features: return UIIconPool::iconSet(":/vtx_amdv_16px.png");
2403 case IndicatorType_Mouse: return UIIconPool::iconSet(":/mouse_16px.png");
2404 case IndicatorType_Keyboard: return UIIconPool::iconSet(":/hostkey_16px.png");
2405 default:
2406 {
2407 AssertMsgFailed(("No icon for indicator type=%d", indicatorType));
2408 break;
2409 }
2410 }
2411 return QIcon();
2412}
2413
2414/* QString <= MachineCloseAction: */
2415template<> QString toInternalString(const MachineCloseAction &machineCloseAction)
2416{
2417 QString strResult;
2418 switch (machineCloseAction)
2419 {
2420 case MachineCloseAction_Detach: strResult = "Detach"; break;
2421 case MachineCloseAction_SaveState: strResult = "SaveState"; break;
2422 case MachineCloseAction_Shutdown: strResult = "Shutdown"; break;
2423 case MachineCloseAction_PowerOff: strResult = "PowerOff"; break;
2424 case MachineCloseAction_PowerOff_RestoringSnapshot: strResult = "PowerOffRestoringSnapshot"; break;
2425 default:
2426 {
2427 AssertMsgFailed(("No text for indicator type=%d", machineCloseAction));
2428 break;
2429 }
2430 }
2431 return strResult;
2432}
2433
2434/* MachineCloseAction <= QString: */
2435template<> MachineCloseAction fromInternalString<MachineCloseAction>(const QString &strMachineCloseAction)
2436{
2437 if (strMachineCloseAction.compare("Detach", Qt::CaseInsensitive) == 0)
2438 return MachineCloseAction_Detach;
2439 if (strMachineCloseAction.compare("SaveState", Qt::CaseInsensitive) == 0)
2440 return MachineCloseAction_SaveState;
2441 if (strMachineCloseAction.compare("Shutdown", Qt::CaseInsensitive) == 0)
2442 return MachineCloseAction_Shutdown;
2443 if (strMachineCloseAction.compare("PowerOff", Qt::CaseInsensitive) == 0)
2444 return MachineCloseAction_PowerOff;
2445 if (strMachineCloseAction.compare("PowerOffRestoringSnapshot", Qt::CaseInsensitive) == 0)
2446 return MachineCloseAction_PowerOff_RestoringSnapshot;
2447 return MachineCloseAction_Invalid;
2448}
2449
2450/* QString <= MouseCapturePolicy: */
2451template<> QString toInternalString(const MouseCapturePolicy &mouseCapturePolicy)
2452{
2453 /* Return corresponding QString representation for passed enum value: */
2454 switch (mouseCapturePolicy)
2455 {
2456 case MouseCapturePolicy_Default: return "Default";
2457 case MouseCapturePolicy_HostComboOnly: return "HostComboOnly";
2458 case MouseCapturePolicy_Disabled: return "Disabled";
2459 default: AssertMsgFailed(("No text for '%d'", mouseCapturePolicy)); break;
2460 }
2461 /* Return QString() by default: */
2462 return QString();
2463}
2464
2465/* MouseCapturePolicy <= QString: */
2466template<> MouseCapturePolicy fromInternalString<MouseCapturePolicy>(const QString &strMouseCapturePolicy)
2467{
2468 if (strMouseCapturePolicy.compare("Default", Qt::CaseInsensitive) == 0)
2469 return MouseCapturePolicy_Default;
2470 if (strMouseCapturePolicy.compare("HostComboOnly", Qt::CaseInsensitive) == 0)
2471 return MouseCapturePolicy_HostComboOnly;
2472 if (strMouseCapturePolicy.compare("Disabled", Qt::CaseInsensitive) == 0)
2473 return MouseCapturePolicy_Disabled;
2474 return MouseCapturePolicy_Default;
2475}
2476
2477/* QString <= GuruMeditationHandlerType: */
2478template<> QString toInternalString(const GuruMeditationHandlerType &guruMeditationHandlerType)
2479{
2480 QString strResult;
2481 switch (guruMeditationHandlerType)
2482 {
2483 case GuruMeditationHandlerType_Default: strResult = "Default"; break;
2484 case GuruMeditationHandlerType_PowerOff: strResult = "PowerOff"; break;
2485 case GuruMeditationHandlerType_Ignore: strResult = "Ignore"; break;
2486 default:
2487 {
2488 AssertMsgFailed(("No text for indicator type=%d", guruMeditationHandlerType));
2489 break;
2490 }
2491 }
2492 return strResult;
2493}
2494
2495/* GuruMeditationHandlerType <= QString: */
2496template<> GuruMeditationHandlerType fromInternalString<GuruMeditationHandlerType>(const QString &strGuruMeditationHandlerType)
2497{
2498 if (strGuruMeditationHandlerType.compare("Default", Qt::CaseInsensitive) == 0)
2499 return GuruMeditationHandlerType_Default;
2500 if (strGuruMeditationHandlerType.compare("PowerOff", Qt::CaseInsensitive) == 0)
2501 return GuruMeditationHandlerType_PowerOff;
2502 if (strGuruMeditationHandlerType.compare("Ignore", Qt::CaseInsensitive) == 0)
2503 return GuruMeditationHandlerType_Ignore;
2504 return GuruMeditationHandlerType_Default;
2505}
2506
2507/* QString <= ScalingOptimizationType: */
2508template<> QString toInternalString(const ScalingOptimizationType &optimizationType)
2509{
2510 QString strResult;
2511 switch (optimizationType)
2512 {
2513 case ScalingOptimizationType_None: strResult = "None"; break;
2514 case ScalingOptimizationType_Performance: strResult = "Performance"; break;
2515 default:
2516 {
2517 AssertMsgFailed(("No text for type=%d", optimizationType));
2518 break;
2519 }
2520 }
2521 return strResult;
2522}
2523
2524/* ScalingOptimizationType <= QString: */
2525template<> ScalingOptimizationType fromInternalString<ScalingOptimizationType>(const QString &strOptimizationType)
2526{
2527 if (strOptimizationType.compare("None", Qt::CaseInsensitive) == 0)
2528 return ScalingOptimizationType_None;
2529 if (strOptimizationType.compare("Performance", Qt::CaseInsensitive) == 0)
2530 return ScalingOptimizationType_Performance;
2531 return ScalingOptimizationType_None;
2532}
2533
2534#ifndef VBOX_WS_MAC
2535
2536/* QString <= MiniToolbarAlignment: */
2537template<> QString toInternalString(const MiniToolbarAlignment &miniToolbarAlignment)
2538{
2539 /* Return corresponding QString representation for passed enum value: */
2540 switch (miniToolbarAlignment)
2541 {
2542 case MiniToolbarAlignment_Bottom: return "Bottom";
2543 case MiniToolbarAlignment_Top: return "Top";
2544 default: AssertMsgFailed(("No text for '%d'", miniToolbarAlignment)); break;
2545 }
2546 /* Return QString() by default: */
2547 return QString();
2548}
2549
2550/* MiniToolbarAlignment <= QString: */
2551template<> MiniToolbarAlignment fromInternalString<MiniToolbarAlignment>(const QString &strMiniToolbarAlignment)
2552{
2553 if (strMiniToolbarAlignment.compare("Bottom", Qt::CaseInsensitive) == 0)
2554 return MiniToolbarAlignment_Bottom;
2555 if (strMiniToolbarAlignment.compare("Top", Qt::CaseInsensitive) == 0)
2556 return MiniToolbarAlignment_Top;
2557 return MiniToolbarAlignment_Bottom;
2558}
2559
2560#endif /* !VBOX_WS_MAC */
2561
2562/* QString <= InformationElementType: */
2563template<> QString toString(const InformationElementType &informationElementType)
2564{
2565 QString strResult;
2566 switch (informationElementType)
2567 {
2568 case InformationElementType_General: strResult = QApplication::translate("UICommon", "General", "InformationElementType"); break;
2569 case InformationElementType_Preview: strResult = QApplication::translate("UICommon", "Preview", "InformationElementType"); break;
2570 case InformationElementType_System: strResult = QApplication::translate("UICommon", "System", "InformationElementType"); break;
2571 case InformationElementType_Display: strResult = QApplication::translate("UICommon", "Display", "InformationElementType"); break;
2572 case InformationElementType_Storage: strResult = QApplication::translate("UICommon", "Storage", "InformationElementType"); break;
2573 case InformationElementType_Audio: strResult = QApplication::translate("UICommon", "Audio", "InformationElementType"); break;
2574 case InformationElementType_Network: strResult = QApplication::translate("UICommon", "Network", "InformationElementType"); break;
2575 case InformationElementType_Serial: strResult = QApplication::translate("UICommon", "Serial ports", "InformationElementType"); break;
2576 case InformationElementType_USB: strResult = QApplication::translate("UICommon", "USB", "InformationElementType"); break;
2577 case InformationElementType_SharedFolders: strResult = QApplication::translate("UICommon", "Shared folders", "InformationElementType"); break;
2578 case InformationElementType_UI: strResult = QApplication::translate("UICommon", "User interface", "InformationElementType"); break;
2579 case InformationElementType_Description: strResult = QApplication::translate("UICommon", "Description", "InformationElementType"); break;
2580 case InformationElementType_RuntimeAttributes: strResult = QApplication::translate("UICommon", "Runtime attributes", "InformationElementType"); break;
2581 case InformationElementType_StorageStatistics: strResult = QApplication::translate("UICommon", "Storage statistics", "InformationElementType"); break;
2582 case InformationElementType_NetworkStatistics: strResult = QApplication::translate("UICommon", "Network statistics", "InformationElementType"); break;
2583 default:
2584 {
2585 AssertMsgFailed(("No text for information element type=%d", informationElementType));
2586 break;
2587 }
2588 }
2589 return strResult;
2590}
2591
2592/* InformationElementType <= QString: */
2593template<> InformationElementType fromString<InformationElementType>(const QString &strInformationElementType)
2594{
2595 if (strInformationElementType.compare(QApplication::translate("UICommon", "General", "InformationElementType"), Qt::CaseInsensitive) == 0)
2596 return InformationElementType_General;
2597 if (strInformationElementType.compare(QApplication::translate("UICommon", "Preview", "InformationElementType"), Qt::CaseInsensitive) == 0)
2598 return InformationElementType_Preview;
2599 if (strInformationElementType.compare(QApplication::translate("UICommon", "System", "InformationElementType"), Qt::CaseInsensitive) == 0)
2600 return InformationElementType_System;
2601 if (strInformationElementType.compare(QApplication::translate("UICommon", "Display", "InformationElementType"), Qt::CaseInsensitive) == 0)
2602 return InformationElementType_Display;
2603 if (strInformationElementType.compare(QApplication::translate("UICommon", "Storage", "InformationElementType"), Qt::CaseInsensitive) == 0)
2604 return InformationElementType_Storage;
2605 if (strInformationElementType.compare(QApplication::translate("UICommon", "Audio", "InformationElementType"), Qt::CaseInsensitive) == 0)
2606 return InformationElementType_Audio;
2607 if (strInformationElementType.compare(QApplication::translate("UICommon", "Network", "InformationElementType"), Qt::CaseInsensitive) == 0)
2608 return InformationElementType_Network;
2609 if (strInformationElementType.compare(QApplication::translate("UICommon", "Serial ports", "InformationElementType"), Qt::CaseInsensitive) == 0)
2610 return InformationElementType_Serial;
2611 if (strInformationElementType.compare(QApplication::translate("UICommon", "USB", "InformationElementType"), Qt::CaseInsensitive) == 0)
2612 return InformationElementType_USB;
2613 if (strInformationElementType.compare(QApplication::translate("UICommon", "Shared folders", "InformationElementType"), Qt::CaseInsensitive) == 0)
2614 return InformationElementType_SharedFolders;
2615 if (strInformationElementType.compare(QApplication::translate("UICommon", "User interface", "InformationElementType"), Qt::CaseInsensitive) == 0)
2616 return InformationElementType_UI;
2617 if (strInformationElementType.compare(QApplication::translate("UICommon", "Description", "InformationElementType"), Qt::CaseInsensitive) == 0)
2618 return InformationElementType_Description;
2619 if (strInformationElementType.compare(QApplication::translate("UICommon", "Runtime attributes", "InformationElementType"), Qt::CaseInsensitive) == 0)
2620 return InformationElementType_RuntimeAttributes;
2621 if (strInformationElementType.compare(QApplication::translate("UICommon", "Storage statistics", "InformationElementType"), Qt::CaseInsensitive) == 0)
2622 return InformationElementType_StorageStatistics;
2623 if (strInformationElementType.compare(QApplication::translate("UICommon", "Network statistics", "InformationElementType"), Qt::CaseInsensitive) == 0)
2624 return InformationElementType_NetworkStatistics;
2625 return InformationElementType_Invalid;
2626}
2627
2628/* QString <= InformationElementType: */
2629template<> QString toInternalString(const InformationElementType &informationElementType)
2630{
2631 QString strResult;
2632 switch (informationElementType)
2633 {
2634 case InformationElementType_General: strResult = "general"; break;
2635 case InformationElementType_Preview: strResult = "preview"; break;
2636 case InformationElementType_System: strResult = "system"; break;
2637 case InformationElementType_Display: strResult = "display"; break;
2638 case InformationElementType_Storage: strResult = "storage"; break;
2639 case InformationElementType_Audio: strResult = "audio"; break;
2640 case InformationElementType_Network: strResult = "network"; break;
2641 case InformationElementType_Serial: strResult = "serialPorts"; break;
2642 case InformationElementType_USB: strResult = "usb"; break;
2643 case InformationElementType_SharedFolders: strResult = "sharedFolders"; break;
2644 case InformationElementType_UI: strResult = "userInterface"; break;
2645 case InformationElementType_Description: strResult = "description"; break;
2646 case InformationElementType_RuntimeAttributes: strResult = "runtime-attributes"; break;
2647 default:
2648 {
2649 AssertMsgFailed(("No text for information element type=%d", informationElementType));
2650 break;
2651 }
2652 }
2653 return strResult;
2654}
2655
2656/* InformationElementType <= QString: */
2657template<> InformationElementType fromInternalString<InformationElementType>(const QString &strInformationElementType)
2658{
2659 if (strInformationElementType.compare("general", Qt::CaseInsensitive) == 0)
2660 return InformationElementType_General;
2661 if (strInformationElementType.compare("preview", Qt::CaseInsensitive) == 0)
2662 return InformationElementType_Preview;
2663 if (strInformationElementType.compare("system", Qt::CaseInsensitive) == 0)
2664 return InformationElementType_System;
2665 if (strInformationElementType.compare("display", Qt::CaseInsensitive) == 0)
2666 return InformationElementType_Display;
2667 if (strInformationElementType.compare("storage", Qt::CaseInsensitive) == 0)
2668 return InformationElementType_Storage;
2669 if (strInformationElementType.compare("audio", Qt::CaseInsensitive) == 0)
2670 return InformationElementType_Audio;
2671 if (strInformationElementType.compare("network", Qt::CaseInsensitive) == 0)
2672 return InformationElementType_Network;
2673 if (strInformationElementType.compare("serialPorts", Qt::CaseInsensitive) == 0)
2674 return InformationElementType_Serial;
2675 if (strInformationElementType.compare("usb", Qt::CaseInsensitive) == 0)
2676 return InformationElementType_USB;
2677 if (strInformationElementType.compare("sharedFolders", Qt::CaseInsensitive) == 0)
2678 return InformationElementType_SharedFolders;
2679 if (strInformationElementType.compare("userInterface", Qt::CaseInsensitive) == 0)
2680 return InformationElementType_UI;
2681 if (strInformationElementType.compare("description", Qt::CaseInsensitive) == 0)
2682 return InformationElementType_Description;
2683 if (strInformationElementType.compare("runtime-attributes", Qt::CaseInsensitive) == 0)
2684 return InformationElementType_RuntimeAttributes;
2685 return InformationElementType_Invalid;
2686}
2687
2688/* QIcon <= InformationElementType: */
2689template<> QIcon toIcon(const InformationElementType &informationElementType)
2690{
2691 switch (informationElementType)
2692 {
2693 case InformationElementType_General: return UIIconPool::iconSet(":/machine_16px.png");
2694 case InformationElementType_Preview: return UIIconPool::iconSet(":/machine_16px.png");
2695 case InformationElementType_System: return UIIconPool::iconSet(":/chipset_16px.png");
2696 case InformationElementType_Display: return UIIconPool::iconSet(":/vrdp_16px.png");
2697 case InformationElementType_Storage: return UIIconPool::iconSet(":/hd_16px.png");
2698 case InformationElementType_Audio: return UIIconPool::iconSet(":/sound_16px.png");
2699 case InformationElementType_Network: return UIIconPool::iconSet(":/nw_16px.png");
2700 case InformationElementType_Serial: return UIIconPool::iconSet(":/serial_port_16px.png");
2701 case InformationElementType_USB: return UIIconPool::iconSet(":/usb_16px.png");
2702 case InformationElementType_SharedFolders: return UIIconPool::iconSet(":/sf_16px.png");
2703 case InformationElementType_UI: return UIIconPool::iconSet(":/interface_16px.png");
2704 case InformationElementType_Description: return UIIconPool::iconSet(":/description_16px.png");
2705 case InformationElementType_RuntimeAttributes: return UIIconPool::iconSet(":/state_running_16px.png");
2706 case InformationElementType_StorageStatistics: return UIIconPool::iconSet(":/hd_16px.png");
2707 case InformationElementType_NetworkStatistics: return UIIconPool::iconSet(":/nw_16px.png");
2708 default:
2709 {
2710 AssertMsgFailed(("No icon for information element type=%d", informationElementType));
2711 break;
2712 }
2713 }
2714 return QIcon();
2715}
2716
2717/* QString <= MaximumGuestScreenSizePolicy: */
2718template<> QString toString(const MaximumGuestScreenSizePolicy &enmMaximumGuestScreenSizePolicy)
2719{
2720 QString strResult;
2721 switch (enmMaximumGuestScreenSizePolicy)
2722 {
2723 case MaximumGuestScreenSizePolicy_Any: strResult = QApplication::translate("UICommon", "None", "Maximum Guest Screen Size"); break;
2724 case MaximumGuestScreenSizePolicy_Fixed: strResult = QApplication::translate("UICommon", "Hint", "Maximum Guest Screen Size"); break;
2725 case MaximumGuestScreenSizePolicy_Automatic: strResult = QApplication::translate("UICommon", "Automatic", "Maximum Guest Screen Size"); break;
2726 default:
2727 {
2728 AssertMsgFailed(("No text for maximum guest resolution policy=%d", enmMaximumGuestScreenSizePolicy));
2729 break;
2730 }
2731 }
2732 return strResult;
2733}
2734
2735/* QString <= MaximumGuestScreenSizePolicy: */
2736template<> QString toInternalString(const MaximumGuestScreenSizePolicy &enmMaximumGuestScreenSizePolicy)
2737{
2738 QString strResult;
2739 switch (enmMaximumGuestScreenSizePolicy)
2740 {
2741 case MaximumGuestScreenSizePolicy_Automatic: strResult = ""; break;
2742 case MaximumGuestScreenSizePolicy_Any: strResult = "any"; break;
2743 default:
2744 {
2745 AssertMsgFailed(("No text for maximum guest resolution policy=%d", enmMaximumGuestScreenSizePolicy));
2746 break;
2747 }
2748 }
2749 return strResult;
2750}
2751
2752/* MaximumGuestScreenSizePolicy <= QString: */
2753template<> MaximumGuestScreenSizePolicy
2754fromInternalString<MaximumGuestScreenSizePolicy>(const QString &strMaximumGuestScreenSizePolicy)
2755{
2756 if ( strMaximumGuestScreenSizePolicy.isEmpty()
2757 || strMaximumGuestScreenSizePolicy.compare("auto", Qt::CaseInsensitive) == 0)
2758 return MaximumGuestScreenSizePolicy_Automatic;
2759 if (strMaximumGuestScreenSizePolicy.compare("any", Qt::CaseInsensitive) == 0)
2760 return MaximumGuestScreenSizePolicy_Any;
2761 /* Fixed type for value which can be parsed: */
2762 if (QRegularExpression("[1-9]\\d*,[1-9]\\d*").match(strMaximumGuestScreenSizePolicy).hasMatch())
2763 return MaximumGuestScreenSizePolicy_Fixed;
2764 return MaximumGuestScreenSizePolicy_Any;
2765}
2766
2767/* QString <= UIMediumFormat: */
2768template<> QString toString(const UIMediumFormat &enmUIMediumFormat)
2769{
2770 QString strResult;
2771 switch (enmUIMediumFormat)
2772 {
2773 case UIMediumFormat_VDI: strResult = QApplication::translate("UICommon", "VDI (VirtualBox Disk Image)", "UIMediumFormat"); break;
2774 case UIMediumFormat_VMDK: strResult = QApplication::translate("UICommon", "VMDK (Virtual Machine Disk)", "UIMediumFormat"); break;
2775 case UIMediumFormat_VHD: strResult = QApplication::translate("UICommon", "VHD (Virtual Hard Disk)", "UIMediumFormat"); break;
2776 case UIMediumFormat_Parallels: strResult = QApplication::translate("UICommon", "HDD (Parallels Hard Disk)", "UIMediumFormat"); break;
2777 case UIMediumFormat_QED: strResult = QApplication::translate("UICommon", "QED (QEMU enhanced disk)", "UIMediumFormat"); break;
2778 case UIMediumFormat_QCOW: strResult = QApplication::translate("UICommon", "QCOW (QEMU Copy-On-Write)", "UIMediumFormat"); break;
2779 default:
2780 {
2781 AssertMsgFailed(("No text for medium format=%d", enmUIMediumFormat));
2782 break;
2783 }
2784 }
2785 return strResult;
2786}
2787
2788/* QString <= UIMediumFormat: */
2789template<> QString toInternalString(const UIMediumFormat &enmUIMediumFormat)
2790{
2791 QString strResult;
2792 switch (enmUIMediumFormat)
2793 {
2794 case UIMediumFormat_VDI: strResult = "VDI"; break;
2795 case UIMediumFormat_VMDK: strResult = "VMDK"; break;
2796 case UIMediumFormat_VHD: strResult = "VHD"; break;
2797 case UIMediumFormat_Parallels: strResult = "Parallels"; break;
2798 case UIMediumFormat_QED: strResult = "QED"; break;
2799 case UIMediumFormat_QCOW: strResult = "QCOW"; break;
2800 default:
2801 {
2802 AssertMsgFailed(("No text for medium format=%d", enmUIMediumFormat));
2803 break;
2804 }
2805 }
2806 return strResult;
2807}
2808
2809/* UIMediumFormat <= QString: */
2810template<> UIMediumFormat fromInternalString<UIMediumFormat>(const QString &strUIMediumFormat)
2811{
2812 if (strUIMediumFormat.compare("VDI", Qt::CaseInsensitive) == 0)
2813 return UIMediumFormat_VDI;
2814 if (strUIMediumFormat.compare("VMDK", Qt::CaseInsensitive) == 0)
2815 return UIMediumFormat_VMDK;
2816 if (strUIMediumFormat.compare("VHD", Qt::CaseInsensitive) == 0)
2817 return UIMediumFormat_VHD;
2818 if (strUIMediumFormat.compare("Parallels", Qt::CaseInsensitive) == 0)
2819 return UIMediumFormat_Parallels;
2820 if (strUIMediumFormat.compare("QED", Qt::CaseInsensitive) == 0)
2821 return UIMediumFormat_QED;
2822 if (strUIMediumFormat.compare("QCOW", Qt::CaseInsensitive) == 0)
2823 return UIMediumFormat_QCOW;
2824 return UIMediumFormat_VDI;
2825}
2826
2827/* QString <= UISettingsDefs::RecordingMode: */
2828template<> QString toString(const UISettingsDefs::RecordingMode &enmRecordingMode)
2829{
2830 QString strResult;
2831 switch (enmRecordingMode)
2832 {
2833 case UISettingsDefs::RecordingMode_None: strResult = QApplication::translate("UICommon", "None", "UISettingsDefs::RecordingMode"); break;
2834 case UISettingsDefs::RecordingMode_VideoAudio: strResult = QApplication::translate("UICommon", "Video/Audio", "UISettingsDefs::RecordingMode"); break;
2835 case UISettingsDefs::RecordingMode_VideoOnly: strResult = QApplication::translate("UICommon", "Video Only", "UISettingsDefs::RecordingMode"); break;
2836 case UISettingsDefs::RecordingMode_AudioOnly: strResult = QApplication::translate("UICommon", "Audio Only", "UISettingsDefs::RecordingMode"); break;
2837 default:
2838 {
2839 AssertMsgFailed(("No text for recording mode format=%d", enmRecordingMode));
2840 break;
2841 }
2842 }
2843 return strResult;
2844}
2845
2846template<> QString toInternalString(const VMActivityOverviewColumn &enmVMActivityOverviewColumn)
2847{
2848 QString strResult;
2849 switch (enmVMActivityOverviewColumn)
2850 {
2851 case VMActivityOverviewColumn_Name: strResult = "VMName"; break;
2852 case VMActivityOverviewColumn_CPUGuestLoad: strResult = "CPUGuestLoad"; break;
2853 case VMActivityOverviewColumn_CPUVMMLoad: strResult = "CPUVMMLoad"; break;
2854 case VMActivityOverviewColumn_RAMUsedAndTotal: strResult = "RAMUsedAndTotal"; break;
2855 case VMActivityOverviewColumn_RAMUsedPercentage: strResult = "RAMUsedPercentage"; break;
2856 case VMActivityOverviewColumn_NetworkUpRate: strResult = "NetworkUpRate"; break;
2857 case VMActivityOverviewColumn_NetworkDownRate: strResult = "NetworkDownRate"; break;
2858 case VMActivityOverviewColumn_NetworkUpTotal: strResult = "NetworkUpTotal"; break;
2859 case VMActivityOverviewColumn_NetworkDownTotal: strResult = "NetworkDownTotal"; break;
2860 case VMActivityOverviewColumn_DiskIOReadRate: strResult = "DiskIOReadRate"; break;
2861 case VMActivityOverviewColumn_DiskIOWriteRate: strResult = "DiskIOWriteRate"; break;
2862 case VMActivityOverviewColumn_DiskIOReadTotal: strResult = "DiskIOReadTotal"; break;
2863 case VMActivityOverviewColumn_DiskIOWriteTotal: strResult = "DiskIOWriteTotal"; break;
2864 case VMActivityOverviewColumn_VMExits: strResult = "VMExits"; break;
2865 default:
2866 {
2867 AssertMsgFailed(("No text for VM Activity Overview Column=%d", enmVMActivityOverviewColumn));
2868 break;
2869 }
2870 }
2871 return strResult;
2872}
2873
2874template<> VMActivityOverviewColumn fromInternalString<VMActivityOverviewColumn>(const QString &strVMActivityOverviewColumn)
2875{
2876 if (strVMActivityOverviewColumn.compare("VMName", Qt::CaseInsensitive) == 0)
2877 return VMActivityOverviewColumn_Name;
2878 if (strVMActivityOverviewColumn.compare("CPUGuestLoad", Qt::CaseInsensitive) == 0)
2879 return VMActivityOverviewColumn_CPUGuestLoad;
2880 if (strVMActivityOverviewColumn.compare("CPUVMMLoad", Qt::CaseInsensitive) == 0)
2881 return VMActivityOverviewColumn_CPUVMMLoad;
2882 if (strVMActivityOverviewColumn.compare("RAMUsedAndTotal", Qt::CaseInsensitive) == 0)
2883 return VMActivityOverviewColumn_RAMUsedAndTotal;
2884 if (strVMActivityOverviewColumn.compare("RAMUsedPercentage", Qt::CaseInsensitive) == 0)
2885 return VMActivityOverviewColumn_RAMUsedPercentage;
2886 if (strVMActivityOverviewColumn.compare("NetworkUpRate", Qt::CaseInsensitive) == 0)
2887 return VMActivityOverviewColumn_NetworkUpRate;
2888 if (strVMActivityOverviewColumn.compare("NetworkDownRate", Qt::CaseInsensitive) == 0)
2889 return VMActivityOverviewColumn_NetworkDownRate;
2890 if (strVMActivityOverviewColumn.compare("NetworkUpTotal", Qt::CaseInsensitive) == 0)
2891 return VMActivityOverviewColumn_NetworkUpTotal;
2892 if (strVMActivityOverviewColumn.compare("NetworkDownTotal", Qt::CaseInsensitive) == 0)
2893 return VMActivityOverviewColumn_NetworkDownTotal;
2894 if (strVMActivityOverviewColumn.compare("DiskIOReadRate", Qt::CaseInsensitive) == 0)
2895 return VMActivityOverviewColumn_DiskIOReadRate;
2896 if (strVMActivityOverviewColumn.compare("DiskIOWriteRate", Qt::CaseInsensitive) == 0)
2897 return VMActivityOverviewColumn_DiskIOWriteRate;
2898 if (strVMActivityOverviewColumn.compare("DiskIOReadTotal", Qt::CaseInsensitive) == 0)
2899 return VMActivityOverviewColumn_DiskIOReadTotal;
2900 if (strVMActivityOverviewColumn.compare("DiskIOWriteTotal", Qt::CaseInsensitive) == 0)
2901 return VMActivityOverviewColumn_DiskIOWriteTotal;
2902 if (strVMActivityOverviewColumn.compare("VMExits", Qt::CaseInsensitive) == 0)
2903 return VMActivityOverviewColumn_VMExits;
2904 return VMActivityOverviewColumn_Max;
2905}
Note: See TracBrowser for help on using the repository browser.

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