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