VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDetailsGenerator.cpp@ 105259

Last change on this file since 105259 was 105259, checked in by vboxsync, 9 months ago

FE/Qt: NLS stuff: Reworking how we representing 3D acceleration feature being enabled; No more other display accelerations in any case.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
  • Property svn:mergeinfo set to (toggle deleted branches)
    /branches/VBox-3.0/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.cpp58652,​70973
    /branches/VBox-3.2/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.cpp66309,​66318
    /branches/VBox-4.0/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.cpp70873
    /branches/VBox-4.1/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.cpp74233
    /branches/VBox-4.2/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElement.cpp91503-91504,​91506-91508,​91510,​91514-91515,​91521
    /branches/VBox-4.3/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElement.cpp91223
    /branches/VBox-4.3/trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElement.cpp91223
    /branches/dsen/gui/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.cpp79076-79078,​79089,​79109-79110,​79112-79113,​79127-79130,​79134,​79141,​79151,​79155,​79157-79159,​79193,​79197
    /branches/dsen/gui2/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElement.cpp79562-79569,​79572-79573,​79578,​79581-79582,​79590-79591,​79598-79599,​79602-79603,​79605-79606,​79632,​79635,​79637,​79644
    /branches/dsen/gui3/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElement.cpp79645-79692
    /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.cpp79225,​79271
File size: 73.1 KB
Line 
1/* $Id: UIDetailsGenerator.cpp 105259 2024-07-10 14:00:00Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIDetailsGenerator 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 <QDir>
31#include <QRegularExpression>
32
33/* GUI includes: */
34#include "UIBootOrderEditor.h"
35#include "UIConverter.h"
36#include "UIDetailsGenerator.h"
37#include "UIErrorString.h"
38#include "UIGlobalSession.h"
39#include "UIGuestOSType.h"
40#include "UIMedium.h"
41#include "UIMediumTools.h"
42#include "UITranslator.h"
43#include "UIUSBTools.h"
44
45/* COM includes: */
46#include "CAudioAdapter.h"
47#include "CAudioSettings.h"
48#include "CBooleanFormValue.h"
49#include "CChoiceFormValue.h"
50#include "CCloudMachine.h"
51#include "CConsole.h"
52#include "CFirmwareSettings.h"
53#include "CForm.h"
54#include "CFormValue.h"
55#include "CGraphicsAdapter.h"
56#include "CGuest.h"
57#include "CMachine.h"
58#include "CMediumAttachment.h"
59#include "CNetworkAdapter.h"
60#include "CNvramStore.h"
61#include "CPlatform.h"
62#include "CPlatformX86.h"
63#include "CPlatformProperties.h"
64#include "CProgress.h"
65#include "CRangedIntegerFormValue.h"
66#include "CRangedInteger64FormValue.h"
67#include "CRecordingScreenSettings.h"
68#include "CRecordingSettings.h"
69#include "CSerialPort.h"
70#include "CSharedFolder.h"
71#include "CStorageController.h"
72#include "CStringFormValue.h"
73#include "CTrustedPlatformModule.h"
74#include "CUefiVariableStore.h"
75#include "CUSBController.h"
76#include "CUSBDevice.h"
77#include "CUSBDeviceFilter.h"
78#include "CUSBDeviceFilters.h"
79#include "CVRDEServer.h"
80
81/* VirtualBox interface declarations: */
82#include <iprt/time.h>
83#include <VBox/com/VirtualBox.h>
84
85
86const QString UIDetailsGenerator::e_strTableRow1 = QString("<tr><td colspan='2'><nobr><b>%1</b></nobr></td></tr>");
87const QString UIDetailsGenerator::e_strTableRow2 = QString("<tr><td><nobr>%1:</nobr></td><td><nobr>%2</nobr></td></tr>");
88const QString UIDetailsGenerator::e_strTableRow3 = QString("<tr><td><nobr>&nbsp;%1:</nobr></td><td><nobr>%2</nobr></td></tr>");
89
90
91UITextTable UIDetailsGenerator::generateMachineInformationGeneral(CMachine &comMachine,
92 const UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral &fOptions)
93{
94 UITextTable table;
95
96 if (comMachine.isNull())
97 return table;
98
99 if (!comMachine.GetAccessible())
100 {
101 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
102 return table;
103 }
104
105 /* Name: */
106 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_Name)
107 {
108 /* Configure hovering anchor: */
109 const QString strAnchorType = QString("machine_name");
110 const QString strName = comMachine.GetName();
111 table << UITextTableLine(QApplication::translate("UIDetails", "Name", "details (general)"),
112 QString("<a href=#%1,%2>%2</a>")
113 .arg(strAnchorType,
114 strName));
115 }
116
117 /* Operating system: */
118 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_OS)
119 {
120 /* Configure hovering anchor: */
121 const QString strAnchorType = QString("os_type");
122 const QString strOsTypeId = comMachine.GetOSTypeId();
123 table << UITextTableLine(QApplication::translate("UIDetails", "Operating System", "details (general)"),
124 QString("<a href=#%1,%2>%3</a>")
125 .arg(strAnchorType,
126 strOsTypeId,
127 gpGlobalSession->guestOSTypeManager().getDescription(strOsTypeId)));
128 }
129
130 /* Settings file location: */
131 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_Location)
132 {
133 /* Configure hovering anchor: */
134 const QString strAnchorType = QString("machine_location");
135 const QString strMachineLocation = comMachine.GetSettingsFilePath();
136 table << UITextTableLine(QApplication::translate("UIDetails", "Settings File Location", "details (general)"),
137 QString("<a href=#%1,%2>%3</a>")
138 .arg(strAnchorType,
139 strMachineLocation,
140 QDir::toNativeSeparators(QFileInfo(strMachineLocation).absolutePath())));
141 }
142
143 /* Groups: */
144 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_Groups)
145 {
146 QStringList groups = comMachine.GetGroups().toList();
147 /* Do not show groups for machine which is in root group only: */
148 if (groups.size() == 1)
149 groups.removeAll("/");
150 /* If group list still not empty: */
151 if (!groups.isEmpty())
152 {
153 /* For every group: */
154 for (int i = 0; i < groups.size(); ++i)
155 {
156 /* Trim first '/' symbol: */
157 QString &strGroup = groups[i];
158 if (strGroup.startsWith("/") && strGroup != "/")
159 strGroup.remove(0, 1);
160 }
161 table << UITextTableLine(QApplication::translate("UIDetails", "Groups", "details (general)"), groups.join(", "));
162 }
163 }
164
165 return table;
166}
167
168UITextTable UIDetailsGenerator::generateMachineInformationGeneral(CCloudMachine &comCloudMachine,
169 const UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral &)
170{
171 UITextTable table;
172
173 if (comCloudMachine.isNull())
174 return table;
175
176 if (!comCloudMachine.GetAccessible())
177 {
178 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
179 return table;
180 }
181
182 /* Acquire details form: */
183 CForm comForm = comCloudMachine.GetDetailsForm();
184 /* Ignore cloud machine errors: */
185 if (comCloudMachine.isOk())
186 {
187 /* Common anchor for all fields: */
188 const QString strAnchorType = "cloud";
189
190 /* For each form value: */
191 const QVector<CFormValue> values = comForm.GetValues();
192 foreach (const CFormValue &comIteratedValue, values)
193 {
194 /* Ignore invisible values: */
195 if (!comIteratedValue.GetVisible())
196 continue;
197
198 /* Acquire label: */
199 const QString strLabel = comIteratedValue.GetLabel();
200 /* Generate value: */
201 const QString strValue = generateFormValueInformation(comIteratedValue);
202
203 /* Generate table string: */
204 table << UITextTableLine(strLabel, QString("<a href=#%1,%2>%3</a>").arg(strAnchorType, strLabel, strValue));
205 }
206 }
207
208 return table;
209}
210
211QString UIDetailsGenerator::generateFormValueInformation(const CFormValue &comFormValue, bool fFull /* = false */)
212{
213 /* Handle possible form value types: */
214 QString strResult;
215 switch (comFormValue.GetType())
216 {
217 case KFormValueType_Boolean:
218 {
219 CBooleanFormValue comValue(comFormValue);
220 const bool fBool = comValue.GetSelected();
221 strResult = fBool ? QApplication::translate("UIDetails", "Enabled", "details (cloud value)")
222 : QApplication::translate("UIDetails", "Disabled", "details (cloud value)");
223 break;
224 }
225 case KFormValueType_String:
226 {
227 CStringFormValue comValue(comFormValue);
228 const QString strValue = comValue.GetString();
229 const QString strClipboardValue = comValue.GetClipboardString();
230 strResult = fFull && !strClipboardValue.isEmpty() ? strClipboardValue : strValue;
231 break;
232 }
233 case KFormValueType_Choice:
234 {
235 AssertMsgFailed(("Aren't we decided to convert all choices to strings?\n"));
236 CChoiceFormValue comValue(comFormValue);
237 const QVector<QString> possibleValues = comValue.GetValues();
238 const int iCurrentIndex = comValue.GetSelectedIndex();
239 strResult = possibleValues.value(iCurrentIndex);
240 break;
241 }
242 case KFormValueType_RangedInteger:
243 {
244 CRangedIntegerFormValue comValue(comFormValue);
245 strResult = QString("%1 %2")
246 .arg(comValue.GetInteger())
247 .arg(QApplication::translate("UITranslator", comValue.GetSuffix().toUtf8().constData()));
248 break;
249 }
250 case KFormValueType_RangedInteger64:
251 {
252 CRangedInteger64FormValue comValue(comFormValue);
253 strResult = QString("%1 %2")
254 .arg(comValue.GetInteger())
255 .arg(QApplication::translate("UITranslator", comValue.GetSuffix().toUtf8().constData()));
256 break;
257 }
258 default:
259 break;
260 }
261 /* Return result: */
262 return strResult;
263}
264
265UITextTable UIDetailsGenerator::generateMachineInformationSystem(CMachine &comMachine,
266 const UIExtraDataMetaDefs::DetailsElementOptionTypeSystem &fOptions)
267{
268 UITextTable table;
269
270 if (comMachine.isNull())
271 return table;
272
273 if (!comMachine.GetAccessible())
274 {
275 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
276 return table;
277 }
278
279 /* Base memory: */
280 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_RAM)
281 {
282 /* Configure hovering anchor: */
283 const QString strAnchorType = QString("base_memory");
284 const int iBaseMemory = comMachine.GetMemorySize();
285 table << UITextTableLine(QApplication::translate("UIDetails", "Base Memory", "details (system)"),
286 QString("<a href=#%1,%2>%3</a>")
287 .arg(strAnchorType)
288 .arg(iBaseMemory)
289 .arg(QApplication::translate("UIDetails", "%1 MB").arg(iBaseMemory)));
290 }
291
292 /* Processors: */
293 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_CPUCount)
294 {
295 const int cCPU = comMachine.GetCPUCount();
296 if (cCPU > 1)
297 table << UITextTableLine(QApplication::translate("UIDetails", "Processors", "details (system)"),
298 QString::number(cCPU));
299 }
300
301 /* Execution cap: */
302 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_CPUExecutionCap)
303 {
304 const int iCPUExecutionCap = comMachine.GetCPUExecutionCap();
305 if (iCPUExecutionCap < 100)
306 table << UITextTableLine(QApplication::translate("UIDetails", "Execution Cap", "details (system)"),
307 QApplication::translate("UIDetails", "%1%", "details").arg(iCPUExecutionCap));
308 }
309
310 /* Boot order: */
311 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_BootOrder)
312 {
313 /* Configure hovering anchor: */
314 const QString strAnchorType = QString("boot_order");
315 const UIBootItemDataList bootItems = loadBootItems(comMachine);
316 table << UITextTableLine(QApplication::translate("UIDetails", "Boot Order", "details (system)"),
317 QString("<a href=#%1,%2>%3</a>")
318 .arg(strAnchorType,
319 bootItemsToSerializedString(bootItems),
320 bootItemsToReadableString(bootItems)));
321 }
322
323 /* Chipset type: */
324 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_ChipsetType)
325 {
326 CPlatform comPlatform = comMachine.GetPlatform();
327 const KChipsetType enmChipsetType = comPlatform.GetChipsetType();
328 if (enmChipsetType == KChipsetType_ICH9)
329 table << UITextTableLine(QApplication::translate("UIDetails", "Chipset Type", "details (system)"),
330 gpConverter->toString(enmChipsetType));
331 }
332
333 /* TPM type: */
334 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_TpmType)
335 {
336 CTrustedPlatformModule comModule = comMachine.GetTrustedPlatformModule();
337 const KTpmType enmTpmType = comModule.GetType();
338 if (enmTpmType != KTpmType_None)
339 table << UITextTableLine(QApplication::translate("UIDetails", "TPM Type", "details (system)"),
340 gpConverter->toString(enmTpmType));
341 }
342
343 /* EFI: */
344 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_Firmware)
345 {
346 CFirmwareSettings comFirmwareSettings = comMachine.GetFirmwareSettings();
347 switch (comFirmwareSettings.GetFirmwareType())
348 {
349 case KFirmwareType_EFI:
350 case KFirmwareType_EFI32:
351 case KFirmwareType_EFI64:
352 case KFirmwareType_EFIDUAL:
353 {
354 table << UITextTableLine(QApplication::translate("UIDetails", "EFI", "details (system)"),
355 QApplication::translate("UIDetails", "Enabled", "details (system/EFI)"));
356 break;
357 }
358 default:
359 break;
360 }
361 }
362
363 /* Secure Boot: */
364 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_SecureBoot)
365 {
366 CNvramStore comStoreLvl1 = comMachine.GetNonVolatileStore();
367 if (comStoreLvl1.isNotNull())
368 {
369 CUefiVariableStore comStoreLvl2 = comStoreLvl1.GetUefiVariableStore();
370 /// @todo this comStoreLvl2.isNotNull() will never work for
371 /// now since VM reference is immutable in Details pane
372 if ( comStoreLvl2.isNotNull()
373 && comStoreLvl2.GetSecureBootEnabled())
374 {
375 table << UITextTableLine(QApplication::translate("UIDetails", "Secure Boot", "details (system)"),
376 QApplication::translate("UIDetails", "Enabled", "details (system/secure boot)"));
377 }
378 }
379 }
380
381 /* Acceleration: */
382 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_Acceleration)
383 {
384 const CPlatform comPlatform = comMachine.GetPlatform();
385 switch (comPlatform.GetArchitecture())
386 {
387 case KPlatformArchitecture_x86:
388 {
389 CPlatformX86 comPlatformX86 = comPlatform.GetX86();
390 QStringList acceleration;
391 if (gpGlobalSession->virtualBox().GetHost().GetProcessorFeature(KProcessorFeature_HWVirtEx))
392 {
393 /* Nested Paging: */
394 if (comPlatformX86.GetHWVirtExProperty(KHWVirtExPropertyType_NestedPaging))
395 acceleration << QApplication::translate("UIDetails", "Nested Paging", "details (system)");
396 }
397 /* Nested VT-x/AMD-V: */
398 if (comPlatformX86.GetCPUProperty(KCPUPropertyTypeX86_HWVirt))
399 acceleration << QApplication::translate("UIDetails", "Nested VT-x/AMD-V", "details (system)");
400 /* PAE/NX: */
401 if (comPlatformX86.GetCPUProperty(KCPUPropertyTypeX86_PAE))
402 acceleration << QApplication::translate("UIDetails", "PAE/NX", "details (system)");
403
404 /* Paravirtualization provider: */
405 switch (comMachine.GetEffectiveParavirtProvider())
406 {
407 case KParavirtProvider_Minimal: acceleration << QApplication::translate("UIDetails", "Minimal Paravirtualization", "details (system)"); break;
408 case KParavirtProvider_HyperV: acceleration << QApplication::translate("UIDetails", "Hyper-V Paravirtualization", "details (system)"); break;
409 case KParavirtProvider_KVM: acceleration << QApplication::translate("UIDetails", "KVM Paravirtualization", "details (system)"); break;
410 default: break;
411 }
412 if (!acceleration.isEmpty())
413 table << UITextTableLine(QApplication::translate("UIDetails", "Acceleration", "details (system)"),
414 acceleration.join(", "));
415 break;
416 }
417
418#ifdef VBOX_WITH_VIRT_ARMV8
419 case KPlatformArchitecture_ARM:
420 {
421 /** @todo BUGBUG ARM stuff goes here. */
422 break;
423 }
424#endif
425
426 default:
427 break;
428 }
429 }
430
431 return table;
432}
433
434UITextTable UIDetailsGenerator::generateMachineInformationDisplay(CMachine &comMachine,
435 const UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay &fOptions)
436{
437 UITextTable table;
438
439 if (comMachine.isNull())
440 return table;
441
442 if (!comMachine.GetAccessible())
443 {
444 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
445 return table;
446 }
447
448 const CGraphicsAdapter comGraphics = comMachine.GetGraphicsAdapter();
449
450 /* Video memory: */
451 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_VRAM)
452 {
453 /* Configure hovering anchor: */
454 const QString strAnchorType = QString("video_memory");
455 const int iVideoMemory = comGraphics.GetVRAMSize();
456 table << UITextTableLine(QApplication::translate("UIDetails", "Video Memory", "details (display)"),
457 QString("<a href=#%1,%2>%3</a>")
458 .arg(strAnchorType)
459 .arg(iVideoMemory)
460 .arg(QApplication::translate("UIDetails", "%1 MB").arg(iVideoMemory)));
461 }
462
463 /* Screens: */
464 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_ScreenCount)
465 {
466 const int cGuestScreens = comGraphics.GetMonitorCount();
467 if (cGuestScreens > 1)
468 table << UITextTableLine(QApplication::translate("UIDetails", "Screens", "details (display)"),
469 QString::number(cGuestScreens));
470 }
471
472 /* Scale-factor: */
473 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_ScaleFactor)
474 {
475 const QString strScaleFactor = comMachine.GetExtraData(UIExtraDataDefs::GUI_ScaleFactor);
476 {
477 /* Try to convert loaded data to double: */
478 bool fOk = false;
479 double dValue = strScaleFactor.toDouble(&fOk);
480 /* Invent the default value: */
481 if (!fOk || !dValue)
482 dValue = 1.0;
483 /* Append information: */
484 if (dValue != 1.0)
485 table << UITextTableLine(QApplication::translate("UIDetails", "Scale-factor", "details (display)"),
486 QString::number(dValue, 'f', 2));
487 }
488 }
489
490 /* Graphics Controller: */
491 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_GraphicsController)
492 {
493 const QString strAnchorType = QString("graphics_controller_type");
494 const KGraphicsControllerType enmType = comGraphics.GetGraphicsControllerType();
495 table << UITextTableLine(QApplication::translate("UIDetails", "Graphics Controller", "details (display)"),
496 QString("<a href=#%1,%2>%3</a>")
497 .arg(strAnchorType)
498 .arg((int)enmType)
499 .arg(gpConverter->toString(enmType)));
500 }
501
502 /* 3D acceleration: */
503 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_Acceleration)
504 {
505 if (comGraphics.GetAccelerate3DEnabled())
506 table << UITextTableLine(QApplication::translate("UIDetails", "3D Acceleration", "details (display)"),
507 QApplication::translate("UIDetails", "Enabled", "details (display/3D Acceleration)"));
508 }
509
510 /* Remote desktop server: */
511 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_VRDE)
512 {
513 const CVRDEServer comServer = comMachine.GetVRDEServer();
514 if (!comServer.isNull())
515 {
516 if (comServer.GetEnabled())
517 table << UITextTableLine(QApplication::translate("UIDetails", "Remote Desktop Server Port", "details (display/vrde)"),
518 comServer.GetVRDEProperty("TCP/Ports"));
519 else
520 table << UITextTableLine(QApplication::translate("UIDetails", "Remote Desktop Server", "details (display/vrde)"),
521 QApplication::translate("UIDetails", "Disabled", "details (display/vrde/VRDE server)"));
522 }
523 }
524
525 /* Recording: */
526 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_Recording)
527 {
528 CRecordingSettings comRecordingSettings = comMachine.GetRecordingSettings();
529 if (comRecordingSettings.GetEnabled())
530 {
531 /* For now all screens have the same config: */
532 const CRecordingScreenSettings comRecordingScreen0Settings = comRecordingSettings.GetScreenSettings(0);
533
534 /** @todo r=andy Refine these texts (wrt audio and/or video). */
535 table << UITextTableLine(QApplication::translate("UIDetails", "Recording File", "details (display/recording)"),
536 comRecordingScreen0Settings.GetFilename());
537 table << UITextTableLine(QApplication::translate("UIDetails", "Recording Attributes", "details (display/recording)"),
538 QApplication::translate("UIDetails", "Frame Size: %1x%2, Frame Rate: %3fps, Bit Rate: %4kbps")
539 .arg(comRecordingScreen0Settings.GetVideoWidth()).arg(comRecordingScreen0Settings.GetVideoHeight())
540 .arg(comRecordingScreen0Settings.GetVideoFPS()).arg(comRecordingScreen0Settings.GetVideoRate()));
541 }
542 else
543 {
544 table << UITextTableLine(QApplication::translate("UIDetails", "Recording", "details (display/recording)"),
545 QApplication::translate("UIDetails", "Disabled", "details (display/recording)"));
546 }
547 }
548
549 return table;
550}
551
552UITextTable UIDetailsGenerator::generateMachineInformationStorage(CMachine &comMachine,
553 const UIExtraDataMetaDefs::DetailsElementOptionTypeStorage &fOptions,
554 bool fLink /* = true */)
555{
556 UITextTable table;
557
558 if (comMachine.isNull())
559 return table;
560
561 if (!comMachine.GetAccessible())
562 {
563 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
564 return table;
565 }
566
567 /* Iterate over all the machine controllers: */
568 foreach (const CStorageController &comController, comMachine.GetStorageControllers())
569 {
570 /* Add controller information: */
571 const QString strControllerName = QApplication::translate("UIStorageSettingsEditor", "Controller: %1");
572 table << UITextTableLine(strControllerName.arg(comController.GetName()), QString());
573 /* Populate map (its sorted!): */
574 QMap<StorageSlot, QString> attachmentsMap;
575 foreach (const CMediumAttachment &attachment, comMachine.GetMediumAttachmentsOfController(comController.GetName()))
576 {
577 /* Acquire device type first of all: */
578 const KDeviceType enmDeviceType = attachment.GetType();
579
580 /* Ignore restricted device types: */
581 if ( ( !(fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeStorage_HardDisks)
582 && enmDeviceType == KDeviceType_HardDisk)
583 || ( !(fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeStorage_OpticalDevices)
584 && enmDeviceType == KDeviceType_DVD)
585 || ( !(fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeStorage_FloppyDevices)
586 && enmDeviceType == KDeviceType_Floppy))
587 continue;
588
589 /* Prepare current storage slot: */
590 const StorageSlot attachmentSlot(comController.GetBus(), attachment.GetPort(), attachment.GetDevice());
591 AssertMsg(comController.isOk(),
592 ("Unable to acquire controller data: %s\n",
593 UIErrorString::formatRC(comController.lastRC()).toUtf8().constData()));
594 if (!comController.isOk())
595 continue;
596
597 /* Prepare attachment information: */
598 QString strAttachmentInfo = UIMediumTools::storageDetails(attachment.GetMedium(), false, false);
599 /* That hack makes sure 'Inaccessible' word is always bold: */
600 { // hack
601 const QString strInaccessibleString(QApplication::translate("UIMedium", "Inaccessible", "medium"));
602 const QString strBoldInaccessibleString(QString("<b>%1</b>").arg(strInaccessibleString));
603 strAttachmentInfo.replace(strInaccessibleString, strBoldInaccessibleString);
604 } // hack
605
606 /* Append 'device slot name' with 'device type name' for optical devices only: */
607 QString strDeviceType = enmDeviceType == KDeviceType_DVD
608 ? QApplication::translate("UIDetails", "[Optical Drive]", "details (storage)")
609 : QString();
610 if (!strDeviceType.isNull())
611 strDeviceType.append(' ');
612
613 /* Insert that attachment information into the map: */
614 if (!strAttachmentInfo.isNull())
615 {
616 /* Configure hovering anchors: */
617 const QString strAnchorType = enmDeviceType == KDeviceType_DVD || enmDeviceType == KDeviceType_Floppy ? QString("mount") :
618 enmDeviceType == KDeviceType_HardDisk ? QString("attach") : QString();
619 const CMedium medium = attachment.GetMedium();
620 const QString strMediumLocation = medium.isNull() ? QString() : medium.GetLocation();
621 if (fLink)
622 attachmentsMap.insert(attachmentSlot,
623 QString("<a href=#%1,%2,%3,%4>%5</a>")
624 .arg(strAnchorType,
625 comController.GetName(),
626 gpConverter->toString(attachmentSlot),
627 strMediumLocation,
628 strDeviceType + strAttachmentInfo));
629 else
630 attachmentsMap.insert(attachmentSlot,
631 QString("%1")
632 .arg(strDeviceType + strAttachmentInfo));
633 }
634 }
635
636 /* Iterate over the sorted map: */
637 const QList<StorageSlot> storageSlots = attachmentsMap.keys();
638 const QList<QString> storageInfo = attachmentsMap.values();
639 for (int i = 0; i < storageSlots.size(); ++i)
640 table << UITextTableLine(QString(" ") + gpConverter->toString(storageSlots[i]), storageInfo[i]);
641 }
642 if (table.isEmpty())
643 table << UITextTableLine(QApplication::translate("UIDetails", "Not Attached", "details (storage)"), QString());
644
645 return table;
646}
647
648UITextTable UIDetailsGenerator::generateMachineInformationAudio(CMachine &comMachine,
649 const UIExtraDataMetaDefs::DetailsElementOptionTypeAudio &fOptions)
650{
651 UITextTable table;
652
653 if (comMachine.isNull())
654 return table;
655
656 if (!comMachine.GetAccessible())
657 {
658 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
659 return table;
660 }
661
662 const CAudioSettings comAudioSettings = comMachine.GetAudioSettings();
663 const CAudioAdapter comAdapter = comAudioSettings.GetAdapter();
664 if (comAdapter.GetEnabled())
665 {
666 /* Host driver: */
667 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeAudio_Driver)
668 {
669 const QString strAnchorType = QString("audio_host_driver_type");
670 const KAudioDriverType enmType = comAdapter.GetAudioDriver();
671 table << UITextTableLine(QApplication::translate("UIDetails", "Host Driver", "details (audio)"),
672 QString("<a href=#%1,%2>%3</a>")
673 .arg(strAnchorType)
674 .arg((int)enmType)
675 .arg(gpConverter->toString(enmType)));
676 }
677
678 /* Controller: */
679 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeAudio_Controller)
680 {
681 const QString strAnchorType = QString("audio_controller_type");
682 const KAudioControllerType enmType = comAdapter.GetAudioController();
683 table << UITextTableLine(QApplication::translate("UIDetails", "Controller", "details (audio)"),
684 QString("<a href=#%1,%2>%3</a>")
685 .arg(strAnchorType)
686 .arg((int)enmType)
687 .arg(gpConverter->toString(enmType)));
688 }
689
690#ifdef VBOX_WITH_AUDIO_INOUT_INFO
691 /* Audio I/O: */
692 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeAudio_IO)
693 {
694 table << UITextTableLine(QApplication::translate("UIDetails", "Audio Input", "details (audio)"),
695 comAdapter.GetEnabledIn() ?
696 QApplication::translate("UIDetails", "Enabled", "details (audio/input)") :
697 QApplication::translate("UIDetails", "Disabled", "details (audio/input)"));
698 table << UITextTableLine(QApplication::translate("UIDetails", "Audio Output", "details (audio)"),
699 comAdapter.GetEnabledOut() ?
700 QApplication::translate("UIDetails", "Enabled", "details (audio/output)") :
701 QApplication::translate("UIDetails", "Disabled", "details (audio/output)"));
702 }
703#endif /* VBOX_WITH_AUDIO_INOUT_INFO */
704 }
705 else
706 table << UITextTableLine(QApplication::translate("UIDetails", "Disabled", "details (audio)"),
707 QString());
708
709 return table;
710}
711
712UITextTable UIDetailsGenerator::generateMachineInformationNetwork(CMachine &comMachine,
713 const UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork &fOptions)
714{
715 UITextTable table;
716
717 if (comMachine.isNull())
718 return table;
719
720 if (!comMachine.GetAccessible())
721 {
722 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
723 return table;
724 }
725
726 /* Iterate over all the adapters: */
727 CPlatform comPlatform = comMachine.GetPlatform();
728 const KPlatformArchitecture enmArch = comPlatform.GetArchitecture();
729 const KChipsetType enmChipsetType = comPlatform.GetChipsetType();
730 CPlatformProperties comProperties = gpGlobalSession->virtualBox().GetPlatformProperties(enmArch);
731 const ulong cMaxNetworkAdapters = comProperties.GetMaxNetworkAdapters(enmChipsetType);
732 for (ulong uSlot = 0; uSlot < cMaxNetworkAdapters; ++uSlot)
733 {
734 const QString strAnchorType = QString("network_attachment_type");
735 const CNetworkAdapter comAdapter = comMachine.GetNetworkAdapter(uSlot);
736
737 /* Skip disabled adapters: */
738 if (!comAdapter.GetEnabled())
739 continue;
740
741 /* Gather adapter information: */
742 const KNetworkAttachmentType enmAttachmentType = comAdapter.GetAttachmentType();
743 const QString strAttachmentTemplate = gpConverter->toString(comAdapter.GetAdapterType()).replace(QRegularExpression("\\s\\(.+\\)"),
744 " (<a href=#%1,%2;%3;%4>%5</a>)");
745 QString strAttachmentType;
746 switch (enmAttachmentType)
747 {
748 case KNetworkAttachmentType_NAT:
749 {
750 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_NAT)
751 strAttachmentType = strAttachmentTemplate
752 .arg(strAnchorType)
753 .arg(uSlot)
754 .arg((int)KNetworkAttachmentType_NAT)
755 .arg(QString())
756 .arg(gpConverter->toString(KNetworkAttachmentType_NAT));
757 break;
758 }
759 case KNetworkAttachmentType_Bridged:
760 {
761 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_BridgedAdapter)
762 {
763 const QString strName = comAdapter.GetBridgedInterface();
764 strAttachmentType = strAttachmentTemplate
765 .arg(strAnchorType)
766 .arg(uSlot)
767 .arg((int)KNetworkAttachmentType_Bridged)
768 .arg(strName)
769 .arg(QApplication::translate("UIDetails", "Bridged Adapter, %1", "details (network)")
770 .arg(strName));
771 }
772 break;
773 }
774 case KNetworkAttachmentType_Internal:
775 {
776 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_InternalNetwork)
777 {
778 const QString strName = comAdapter.GetInternalNetwork();
779 strAttachmentType = strAttachmentTemplate
780 .arg(strAnchorType)
781 .arg(uSlot)
782 .arg((int)KNetworkAttachmentType_Internal)
783 .arg(strName)
784 .arg(QApplication::translate("UIDetails", "Internal Network, '%1'", "details (network)")
785 .arg(strName));
786 }
787 break;
788 }
789 case KNetworkAttachmentType_HostOnly:
790 {
791 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_HostOnlyAdapter)
792 {
793 const QString strName = comAdapter.GetHostOnlyInterface();
794 strAttachmentType = strAttachmentTemplate
795 .arg(strAnchorType)
796 .arg(uSlot)
797 .arg((int)KNetworkAttachmentType_HostOnly)
798 .arg(strName)
799 .arg(QApplication::translate("UIDetails", "Host-only Adapter, '%1'", "details (network)")
800 .arg(strName));
801 }
802 break;
803 }
804#ifdef VBOX_WITH_VMNET
805 case KNetworkAttachmentType_HostOnlyNetwork:
806 {
807 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_HostOnlyNetwork)
808 {
809 const QString strName = comAdapter.GetHostOnlyNetwork();
810 strAttachmentType = strAttachmentTemplate
811 .arg(strAnchorType)
812 .arg(uSlot)
813 .arg((int)KNetworkAttachmentType_HostOnly)
814 .arg(strName)
815 .arg(QApplication::translate("UIDetails", "Host-only Network, '%1'", "details (network)")
816 .arg(strName));
817 }
818 break;
819 }
820#endif /* VBOX_WITH_VMNET */
821 case KNetworkAttachmentType_Generic:
822 {
823 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_GenericDriver)
824 {
825 const QString strName = comAdapter.GetGenericDriver();
826 const QString strGenericDriverProperties(summarizeGenericProperties(comAdapter));
827 strAttachmentType = strGenericDriverProperties.isNull()
828 ? strAttachmentTemplate
829 .arg(strAnchorType)
830 .arg(uSlot)
831 .arg((int)KNetworkAttachmentType_Generic)
832 .arg(strName)
833 .arg(QApplication::translate("UIDetails", "Generic Driver, '%1'", "details (network)")
834 .arg(strName))
835 : strAttachmentTemplate
836 .arg(strAnchorType)
837 .arg(uSlot)
838 .arg((int)KNetworkAttachmentType_Generic)
839 .arg(strName)
840 .arg(QApplication::translate("UIDetails", "Generic Driver, '%1' { %2 }", "details (network)")
841 .arg(strName, strGenericDriverProperties));
842 }
843 break;
844 }
845 case KNetworkAttachmentType_NATNetwork:
846 {
847 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_NATNetwork)
848 {
849 const QString strName = comAdapter.GetNATNetwork();
850 strAttachmentType = strAttachmentTemplate
851 .arg(strAnchorType)
852 .arg(uSlot)
853 .arg((int)KNetworkAttachmentType_NATNetwork)
854 .arg(strName)
855 .arg(QApplication::translate("UIDetails", "NAT Network, '%1'", "details (network)")
856 .arg(strName));
857 }
858 break;
859 }
860#ifdef VBOX_WITH_CLOUD_NET
861 case KNetworkAttachmentType_Cloud:
862 {
863 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_CloudNetwork)
864 {
865 const QString strName = comAdapter.GetCloudNetwork();
866 strAttachmentType = strAttachmentTemplate
867 .arg(strAnchorType)
868 .arg(uSlot)
869 .arg((int)KNetworkAttachmentType_Cloud)
870 .arg(strName)
871 .arg(QApplication::translate("UIDetails", "Cloud Network, '%1'", "details (network)")
872 .arg(strName));
873 }
874 break;
875 }
876#endif /* VBOX_WITH_CLOUD_NET */
877 default:
878 {
879 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_NotAttached)
880 strAttachmentType = strAttachmentTemplate
881 .arg(strAnchorType)
882 .arg(uSlot)
883 .arg((int)enmAttachmentType)
884 .arg(QString())
885 .arg(gpConverter->toString(enmAttachmentType));
886 break;
887 }
888 }
889 if (!strAttachmentType.isNull())
890 table << UITextTableLine(QApplication::translate("UIDetails", "Adapter %1", "details (network)").arg(comAdapter.GetSlot() + 1), strAttachmentType);
891 }
892 if (table.isEmpty())
893 table << UITextTableLine(QApplication::translate("UIDetails", "Disabled", "details (network/adapter)"), QString());
894
895 return table;
896}
897
898UITextTable UIDetailsGenerator::generateMachineInformationSerial(CMachine &comMachine,
899 const UIExtraDataMetaDefs::DetailsElementOptionTypeSerial &fOptions)
900{
901 UITextTable table;
902
903 if (comMachine.isNull())
904 return table;
905
906 if (!comMachine.GetAccessible())
907 {
908 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
909 return table;
910 }
911
912 /* Iterate over all the ports: */
913 CPlatform comPlatform = comMachine.GetPlatform();
914 const KPlatformArchitecture enmArch = comPlatform.GetArchitecture();
915 CPlatformProperties comProperties = gpGlobalSession->virtualBox().GetPlatformProperties(enmArch);
916 const ulong cMaxSerialPorts = comProperties.GetSerialPortCount();
917 for (ulong uSlot = 0; uSlot < cMaxSerialPorts; ++uSlot)
918 {
919 const CSerialPort comPort = comMachine.GetSerialPort(uSlot);
920
921 /* Skip disabled adapters: */
922 if (!comPort.GetEnabled())
923 continue;
924
925 /* Gather port information: */
926 const KPortMode enmMode = comPort.GetHostMode();
927 const QString strModeTemplate = UITranslator::toCOMPortName(comPort.GetIRQ(), comPort.GetIOAddress()) + ", ";
928 QString strModeType;
929 switch (enmMode)
930 {
931 case KPortMode_HostPipe:
932 {
933 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_HostPipe)
934 strModeType = strModeTemplate + QString("%1 (%2)").arg(gpConverter->toString(enmMode)).arg(QDir::toNativeSeparators(comPort.GetPath()));
935 break;
936 }
937 case KPortMode_HostDevice:
938 {
939 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_HostDevice)
940 strModeType = strModeTemplate + QString("%1 (%2)").arg(gpConverter->toString(enmMode)).arg(QDir::toNativeSeparators(comPort.GetPath()));
941 break;
942 }
943 case KPortMode_RawFile:
944 {
945 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_RawFile)
946 strModeType = strModeTemplate + QString("%1 (%2)").arg(gpConverter->toString(enmMode)).arg(QDir::toNativeSeparators(comPort.GetPath()));
947 break;
948 }
949 case KPortMode_TCP:
950 {
951 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_TCP)
952 strModeType = strModeTemplate + QString("%1 (%2)").arg(gpConverter->toString(enmMode)).arg(QDir::toNativeSeparators(comPort.GetPath()));
953 break;
954 }
955 default:
956 {
957 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_Disconnected)
958 strModeType = strModeTemplate + gpConverter->toString(enmMode);
959 break;
960 }
961 }
962 if (!strModeType.isNull())
963 table << UITextTableLine(QApplication::translate("UIDetails", "Port %1", "details (serial)").arg(comPort.GetSlot() + 1), strModeType);
964 }
965 if (table.isEmpty())
966 table << UITextTableLine(QApplication::translate("UIDetails", "Disabled", "details (serial)"), QString());
967
968 return table;
969}
970
971UITextTable UIDetailsGenerator::generateMachineInformationUSB(CMachine &comMachine,
972 const UIExtraDataMetaDefs::DetailsElementOptionTypeUsb &fOptions)
973{
974 UITextTable table;
975
976 if (comMachine.isNull())
977 return table;
978
979 if (!comMachine.GetAccessible())
980 {
981 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
982 return table;
983 }
984
985 /* Iterate over all the USB filters: */
986 const CUSBDeviceFilters comFilterObject = comMachine.GetUSBDeviceFilters();
987 if (!comFilterObject.isNull() && comMachine.GetUSBProxyAvailable())
988 {
989 const QString strAnchorType = QString("usb_controller_type");
990 const CUSBControllerVector controllers = comMachine.GetUSBControllers();
991 if (!controllers.isEmpty())
992 {
993 /* USB controllers: */
994 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeUsb_Controller)
995 {
996 QStringList controllerInternal;
997 QStringList controllersReadable;
998 foreach (const CUSBController &comController, controllers)
999 {
1000 const KUSBControllerType enmType = comController.GetType();
1001 controllerInternal << QString::number((int)enmType);
1002 controllersReadable << gpConverter->toString(enmType);
1003 }
1004 table << UITextTableLine(QApplication::translate("UIDetails", "USB Controller", "details (usb)"),
1005 QString("<a href=#%1,%2>%3</a>")
1006 .arg(strAnchorType)
1007 .arg(controllerInternal.join(';'))
1008 .arg(controllersReadable.join(", ")));
1009 }
1010
1011 /* Device filters: */
1012 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeUsb_DeviceFilters)
1013 {
1014 const CUSBDeviceFilterVector filters = comFilterObject.GetDeviceFilters();
1015 uint uActive = 0;
1016 for (int i = 0; i < filters.size(); ++i)
1017 if (filters.at(i).GetActive())
1018 ++uActive;
1019 table << UITextTableLine(QApplication::translate("UIDetails", "Device Filters", "details (usb)"),
1020 QApplication::translate("UIDetails", "%1 (%2 active)", "details (usb)").arg(filters.size()).arg(uActive));
1021 }
1022 }
1023 else
1024 table << UITextTableLine(QString("<a href=#%1,%2>%3</a>")
1025 .arg(strAnchorType)
1026 .arg(QString::number((int)KUSBControllerType_Null))
1027 .arg(QApplication::translate("UIDetails", "Disabled", "details (usb)")),
1028 QString());
1029 }
1030 else
1031 table << UITextTableLine(QApplication::translate("UIDetails", "USB Controller Inaccessible", "details (usb)"), QString());
1032
1033 return table;
1034}
1035
1036UITextTable UIDetailsGenerator::generateMachineInformationSharedFolders(CMachine &comMachine,
1037 const UIExtraDataMetaDefs::DetailsElementOptionTypeSharedFolders &fOptions)
1038{
1039 Q_UNUSED(fOptions);
1040
1041 UITextTable table;
1042
1043 if (comMachine.isNull())
1044 return table;
1045
1046 if (!comMachine.GetAccessible())
1047 {
1048 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
1049 return table;
1050 }
1051
1052 /* Summary: */
1053 const ulong uCount = comMachine.GetSharedFolders().size();
1054 if (uCount > 0)
1055 table << UITextTableLine(QApplication::translate("UIDetails", "Shared Folders", "details (shared folders)"), QString::number(uCount));
1056 else
1057 table << UITextTableLine(QApplication::translate("UIDetails", "None", "details (shared folders)"), QString());
1058
1059 return table;
1060}
1061
1062UITextTable UIDetailsGenerator::generateMachineInformationUI(CMachine &comMachine,
1063 const UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface &fOptions)
1064{
1065 UITextTable table;
1066
1067 if (comMachine.isNull())
1068 return table;
1069
1070 if (!comMachine.GetAccessible())
1071 {
1072 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
1073 return table;
1074 }
1075
1076 /* Visual state: */
1077 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_VisualState)
1078 {
1079 const QString strAnchorType = QString("visual_state");
1080 const QString strEnabledFullscreen = comMachine.GetExtraData(UIExtraDataDefs::GUI_Fullscreen);
1081 const QString strEnabledSeamless = comMachine.GetExtraData(UIExtraDataDefs::GUI_Seamless);
1082 const QString strEnabledScale = comMachine.GetExtraData(UIExtraDataDefs::GUI_Scale);
1083 UIVisualStateType enmType = UIVisualStateType_Normal;
1084 if ( strEnabledFullscreen.compare("true", Qt::CaseInsensitive) == 0
1085 || strEnabledFullscreen.compare("yes", Qt::CaseInsensitive) == 0
1086 || strEnabledFullscreen.compare("on", Qt::CaseInsensitive) == 0
1087 || strEnabledFullscreen == "1")
1088 enmType = UIVisualStateType_Fullscreen;
1089 else
1090 if ( strEnabledSeamless.compare("true", Qt::CaseInsensitive) == 0
1091 || strEnabledSeamless.compare("yes", Qt::CaseInsensitive) == 0
1092 || strEnabledSeamless.compare("on", Qt::CaseInsensitive) == 0
1093 || strEnabledSeamless == "1")
1094 enmType = UIVisualStateType_Seamless;
1095 else
1096 if ( strEnabledScale.compare("true", Qt::CaseInsensitive) == 0
1097 || strEnabledScale.compare("yes", Qt::CaseInsensitive) == 0
1098 || strEnabledScale.compare("on", Qt::CaseInsensitive) == 0
1099 || strEnabledScale == "1")
1100 enmType = UIVisualStateType_Scale;
1101 const QString strVisualState = gpConverter->toString(enmType);
1102 table << UITextTableLine(QApplication::translate("UIDetails", "Visual State", "details (user interface)"),
1103 QString("<a href=#%1,%2>%3</a>")
1104 .arg(strAnchorType)
1105 .arg(enmType)
1106 .arg(strVisualState));
1107 }
1108
1109#ifndef VBOX_WS_MAC
1110 /* Menu-bar: */
1111 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_MenuBar)
1112 {
1113 const QString strAnchorType = QString("menu_bar");
1114 const QString strMenubarEnabled = comMachine.GetExtraData(UIExtraDataDefs::GUI_MenuBar_Enabled);
1115 const bool fEnabled = !( strMenubarEnabled.compare("false", Qt::CaseInsensitive) == 0
1116 || strMenubarEnabled.compare("no", Qt::CaseInsensitive) == 0
1117 || strMenubarEnabled.compare("off", Qt::CaseInsensitive) == 0
1118 || strMenubarEnabled == "0");
1119 table << UITextTableLine(QApplication::translate("UIDetails", "Menu-bar", "details (user interface)"),
1120 QString("<a href=#%1,%2>%3</a>")
1121 .arg(strAnchorType)
1122 .arg((int)fEnabled)
1123 .arg(fEnabled ? QApplication::translate("UIDetails", "Enabled", "details (user interface/menu-bar)")
1124 : QApplication::translate("UIDetails", "Disabled", "details (user interface/menu-bar)")));
1125 }
1126#endif /* !VBOX_WS_MAC */
1127
1128 /* Status-bar: */
1129 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_StatusBar)
1130 {
1131 const QString strAnchorType = QString("status_bar");
1132 const QString strStatusbarEnabled = comMachine.GetExtraData(UIExtraDataDefs::GUI_StatusBar_Enabled);
1133 const bool fEnabled = !( strStatusbarEnabled.compare("false", Qt::CaseInsensitive) == 0
1134 || strStatusbarEnabled.compare("no", Qt::CaseInsensitive) == 0
1135 || strStatusbarEnabled.compare("off", Qt::CaseInsensitive) == 0
1136 || strStatusbarEnabled == "0");
1137 table << UITextTableLine(QApplication::translate("UIDetails", "Status-bar", "details (user interface)"),
1138 QString("<a href=#%1,%2>%3</a>")
1139 .arg(strAnchorType)
1140 .arg((int)fEnabled)
1141 .arg(fEnabled ? QApplication::translate("UIDetails", "Enabled", "details (user interface/status-bar)")
1142 : QApplication::translate("UIDetails", "Disabled", "details (user interface/status-bar)")));
1143 }
1144
1145#ifndef VBOX_WS_MAC
1146 /* Mini-toolbar: */
1147 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_MiniToolbar)
1148 {
1149 const QString strAnchorType = QString("mini_toolbar");
1150 const QString strMiniToolbarEnabled = comMachine.GetExtraData(UIExtraDataDefs::GUI_ShowMiniToolBar);
1151 const bool fEnabled = !( strMiniToolbarEnabled.compare("false", Qt::CaseInsensitive) == 0
1152 || strMiniToolbarEnabled.compare("no", Qt::CaseInsensitive) == 0
1153 || strMiniToolbarEnabled.compare("off", Qt::CaseInsensitive) == 0
1154 || strMiniToolbarEnabled == "0");
1155 if (fEnabled)
1156 {
1157 /* Get mini-toolbar position: */
1158 const QString strMiniToolbarPosition = comMachine.GetExtraData(UIExtraDataDefs::GUI_MiniToolBarAlignment);
1159 {
1160 /* Try to convert loaded data to alignment: */
1161 switch (gpConverter->fromInternalString<MiniToolbarAlignment>(strMiniToolbarPosition))
1162 {
1163 case MiniToolbarAlignment_Top:
1164 table << UITextTableLine(QApplication::translate("UIDetails", "Mini-toolbar Position", "details (user interface)"),
1165 QString("<a href=#%1,%2>%3</a>")
1166 .arg(strAnchorType)
1167 .arg((int)MiniToolbarAlignment_Top)
1168 .arg(QApplication::translate("UIDetails", "Top", "details (user interface/mini-toolbar position)")));
1169 break;
1170 case MiniToolbarAlignment_Bottom:
1171 table << UITextTableLine(QApplication::translate("UIDetails", "Mini-toolbar Position", "details (user interface)"),
1172 QString("<a href=#%1,%2>%3</a>")
1173 .arg(strAnchorType)
1174 .arg((int)MiniToolbarAlignment_Bottom)
1175 .arg(QApplication::translate("UIDetails", "Bottom", "details (user interface/mini-toolbar position)")));
1176 break;
1177 default:
1178 break;
1179 }
1180 }
1181 }
1182 else
1183 table << UITextTableLine(QApplication::translate("UIDetails", "Mini-toolbar", "details (user interface)"),
1184 QString("<a href=#%1,%2>%3</a>")
1185 .arg(strAnchorType)
1186 .arg((int)MiniToolbarAlignment_Disabled)
1187 .arg(QApplication::translate("UIDetails", "Disabled", "details (user interface/mini-toolbar)")));
1188 }
1189#endif /* !VBOX_WS_MAC */
1190
1191 return table;
1192}
1193
1194UITextTable UIDetailsGenerator::generateMachineInformationDescription(CMachine &comMachine,
1195 const UIExtraDataMetaDefs::DetailsElementOptionTypeDescription &fOptions)
1196{
1197 Q_UNUSED(fOptions);
1198
1199 UITextTable table;
1200
1201 if (comMachine.isNull())
1202 return table;
1203
1204 if (!comMachine.GetAccessible())
1205 {
1206 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
1207 return table;
1208 }
1209
1210 /* Summary: */
1211 const QString strDescription = comMachine.GetDescription();
1212 if (!strDescription.isEmpty())
1213 table << UITextTableLine(strDescription, QString());
1214 else
1215 table << UITextTableLine(QApplication::translate("UIDetails", "None", "details (description)"), QString());
1216
1217 return table;
1218}
1219
1220void UIDetailsGenerator::acquireHardDiskStatusInfo(CMachine &comMachine, QString &strInfo,
1221 uint &cAttachmentsCount)
1222{
1223 /* Enumerate all the controllers: */
1224 foreach (const CStorageController &comController, comMachine.GetStorageControllers())
1225 {
1226 /* Enumerate all the attachments: */
1227 QString strAttData;
1228 foreach (const CMediumAttachment &comAttachment, comMachine.GetMediumAttachmentsOfController(comController.GetName()))
1229 {
1230 /* Skip unrelated attachments: */
1231 if (comAttachment.GetType() != KDeviceType_HardDisk)
1232 continue;
1233 /* Append attachment data: */
1234 strAttData += e_strTableRow3
1235 .arg(gpConverter->toString(StorageSlot(comController.GetBus(), comAttachment.GetPort(), comAttachment.GetDevice())))
1236 .arg(UIMedium(comAttachment.GetMedium(), UIMediumDeviceType_HardDisk).location());
1237 ++cAttachmentsCount;
1238 }
1239 /* Append controller data: */
1240 if (!strAttData.isNull())
1241 strInfo += e_strTableRow1.arg(comController.GetName()) + strAttData;
1242 }
1243}
1244
1245void UIDetailsGenerator::acquireOpticalDiskStatusInfo(CMachine &comMachine, QString &strInfo,
1246 uint &cAttachmentsCount, uint &cAttachmentsMountedCount)
1247{
1248 /* Enumerate all the controllers: */
1249 foreach (const CStorageController &comController, comMachine.GetStorageControllers())
1250 {
1251 QString strAttData;
1252 /* Enumerate all the attachments: */
1253 foreach (const CMediumAttachment &comAttachment, comMachine.GetMediumAttachmentsOfController(comController.GetName()))
1254 {
1255 /* Skip unrelated attachments: */
1256 if (comAttachment.GetType() != KDeviceType_DVD)
1257 continue;
1258 /* Append attachment data: */
1259 UIMedium vboxMedium(comAttachment.GetMedium(), UIMediumDeviceType_DVD);
1260 strAttData += e_strTableRow3
1261 .arg(gpConverter->toString(StorageSlot(comController.GetBus(), comAttachment.GetPort(), comAttachment.GetDevice())))
1262 .arg(vboxMedium.isNull() || vboxMedium.isHostDrive() ? vboxMedium.name() : vboxMedium.location());
1263 ++cAttachmentsCount;
1264 if (!vboxMedium.isNull())
1265 ++cAttachmentsMountedCount;
1266 }
1267 /* Append controller data: */
1268 if (!strAttData.isNull())
1269 strInfo += e_strTableRow1.arg(comController.GetName()) + strAttData;
1270 }
1271}
1272
1273void UIDetailsGenerator::acquireFloppyDiskStatusInfo(CMachine &comMachine, QString &strInfo,
1274 uint &cAttachmentsCount, uint &cAttachmentsMountedCount)
1275{
1276 /* Enumerate all the controllers: */
1277 foreach (const CStorageController &comController, comMachine.GetStorageControllers())
1278 {
1279 QString strAttData;
1280 /* Enumerate all the attachments: */
1281 foreach (const CMediumAttachment &comAttachment, comMachine.GetMediumAttachmentsOfController(comController.GetName()))
1282 {
1283 /* Skip unrelated attachments: */
1284 if (comAttachment.GetType() != KDeviceType_Floppy)
1285 continue;
1286 /* Append attachment data: */
1287 UIMedium vboxMedium(comAttachment.GetMedium(), UIMediumDeviceType_Floppy);
1288 strAttData += e_strTableRow3
1289 .arg(gpConverter->toString(StorageSlot(comController.GetBus(), comAttachment.GetPort(), comAttachment.GetDevice())))
1290 .arg(vboxMedium.isNull() || vboxMedium.isHostDrive() ? vboxMedium.name() : vboxMedium.location());
1291 ++cAttachmentsCount;
1292 if (!vboxMedium.isNull())
1293 ++cAttachmentsMountedCount;
1294 }
1295 /* Append controller data: */
1296 if (!strAttData.isNull())
1297 strInfo += e_strTableRow1.arg(comController.GetName()) + strAttData;
1298 }
1299}
1300
1301void UIDetailsGenerator::acquireAudioStatusInfo(CMachine &comMachine, QString &strInfo,
1302 bool &fAudioEnabled, bool &fEnabledOutput, bool &fEnabledInput)
1303{
1304 /* Get audio settings & adapter: */
1305 const CAudioSettings comAudioSettings = comMachine.GetAudioSettings();
1306 const CAudioAdapter comAdapter = comAudioSettings.GetAdapter();
1307 fAudioEnabled = comAdapter.GetEnabled();
1308 if (fAudioEnabled)
1309 {
1310 fEnabledOutput = comAdapter.GetEnabledOut();
1311 fEnabledInput = comAdapter.GetEnabledIn();
1312 strInfo = QString(e_strTableRow2).arg(QApplication::translate("UIDetails", "Audio Output", "details (audio)"),
1313 fEnabledOutput ?
1314 QApplication::translate("UIDetails", "Enabled", "details (audio/output)") :
1315 QApplication::translate("UIDetails", "Disabled", "details (audio/output)"))
1316 + QString(e_strTableRow2).arg(QApplication::translate("UIDetails", "Audio Input", "details (audio)"),
1317 fEnabledInput ?
1318 QApplication::translate("UIDetails", "Enabled", "details (audio/input)") :
1319 QApplication::translate("UIDetails", "Disabled", "details (audio/input)"));
1320 }
1321}
1322
1323void UIDetailsGenerator::acquireNetworkStatusInfo(CMachine &comMachine, QString &strInfo,
1324 bool &fAdaptersPresent, bool &fCablesDisconnected)
1325{
1326 /* Determine max amount of network adapters: */
1327 CPlatform comPlatform = comMachine.GetPlatform();
1328 const KPlatformArchitecture enmArch = comPlatform.GetArchitecture();
1329 const KChipsetType enmChipsetType = comPlatform.GetChipsetType();
1330 CPlatformProperties comProperties = gpGlobalSession->virtualBox().GetPlatformProperties(enmArch);
1331 const ulong cMaxNetworkAdapters = comProperties.GetMaxNetworkAdapters(enmChipsetType);
1332
1333 /* Gather adapter properties: */
1334 RTTIMESPEC time;
1335 uint64_t u64Now = RTTimeSpecGetNano(RTTimeNow(&time));
1336 QString strFlags, strCount;
1337 LONG64 iTimestamp;
1338 comMachine.GetGuestProperty("/VirtualBox/GuestInfo/Net/Count", strCount, iTimestamp, strFlags);
1339 bool fPropsValid = (u64Now - iTimestamp < UINT64_C(60000000000)); /* timeout beacon */
1340 QStringList ipList, macList;
1341 if (fPropsValid)
1342 {
1343 const ulong cAdapters = qMin(strCount.toULong(), cMaxNetworkAdapters);
1344 for (ulong i = 0; i < cAdapters; ++i)
1345 {
1346 ipList << comMachine.GetGuestPropertyValue(QString("/VirtualBox/GuestInfo/Net/%1/V4/IP").arg(i));
1347 macList << comMachine.GetGuestPropertyValue(QString("/VirtualBox/GuestInfo/Net/%1/MAC").arg(i));
1348 }
1349 }
1350
1351 /* Enumerate up to cMaxNetworkAdapters adapters: */
1352 for (ulong uSlot = 0; uSlot < cMaxNetworkAdapters; ++uSlot)
1353 {
1354 const CNetworkAdapter &comAdapter = comMachine.GetNetworkAdapter(uSlot);
1355 if (comMachine.isOk() && !comAdapter.isNull() && comAdapter.GetEnabled())
1356 {
1357 fAdaptersPresent = true;
1358 QString strGuestIp;
1359 if (fPropsValid)
1360 {
1361 const QString strGuestMac = comAdapter.GetMACAddress();
1362 const int iIp = macList.indexOf(strGuestMac);
1363 if (iIp >= 0)
1364 strGuestIp = ipList.at(iIp);
1365 }
1366 /* Check if the adapter's cable is connected: */
1367 const bool fCableConnected = comAdapter.GetCableConnected();
1368 if (fCablesDisconnected && fCableConnected)
1369 fCablesDisconnected = false;
1370 /* Append adapter data: */
1371 strInfo += e_strTableRow1
1372 .arg(QApplication::translate("UIIndicatorNetwork", "Adapter %1 (%2)")
1373 .arg(uSlot + 1).arg(gpConverter->toString(comAdapter.GetAttachmentType())));
1374 if (!strGuestIp.isEmpty())
1375 strInfo += e_strTableRow3
1376 .arg(QApplication::translate("UIIndicatorNetwork", "IP"), strGuestIp);
1377 strInfo += e_strTableRow3
1378 .arg(QApplication::translate("UIIndicatorNetwork", "Cable"))
1379 .arg(fCableConnected ?
1380 QApplication::translate("UIIndicatorNetwork", "Connected", "cable") :
1381 QApplication::translate("UIIndicatorNetwork", "Disconnected", "cable"));
1382 }
1383 }
1384}
1385
1386void UIDetailsGenerator::acquireUsbStatusInfo(CMachine &comMachine, CConsole &comConsole,
1387 QString &strInfo, bool &fUsbEnabled, uint &cUsbFilterCount)
1388{
1389 /* Check whether there is at least one USB controller with an available proxy: */
1390 fUsbEnabled = !comMachine.GetUSBDeviceFilters().isNull()
1391 && !comMachine.GetUSBControllers().isEmpty()
1392 && comMachine.GetUSBProxyAvailable();
1393 if (fUsbEnabled)
1394 {
1395 /* Enumerate all the USB devices: */
1396 foreach (const CUSBDevice &comUsbDevice, comConsole.GetUSBDevices())
1397 {
1398 ++cUsbFilterCount;
1399 strInfo += e_strTableRow1.arg(usbDetails(comUsbDevice));
1400 }
1401 /* Handle 'no-usb-devices' case: */
1402 if (strInfo.isNull())
1403 strInfo = e_strTableRow1
1404 .arg(QApplication::translate("UIIndicatorUSB", "No USB devices attached"));
1405 }
1406}
1407
1408void UIDetailsGenerator::acquireSharedFoldersStatusInfo(CMachine &comMachine, CConsole &comConsole, CGuest &comGuest,
1409 QString &strInfo, bool &fFoldersPresent)
1410{
1411 /* Enumerate all the folders: */
1412 QMap<QString, QString> folders;
1413 foreach (const CSharedFolder &comPermanentFolder, comMachine.GetSharedFolders())
1414 folders.insert(comPermanentFolder.GetName(), comPermanentFolder.GetHostPath());
1415 foreach (const CSharedFolder &comTemporaryFolder, comConsole.GetSharedFolders())
1416 folders.insert(comTemporaryFolder.GetName(), comTemporaryFolder.GetHostPath());
1417 fFoldersPresent = !folders.isEmpty();
1418
1419 /* Append attachment data: */
1420 for (QMap<QString, QString>::const_iterator it = folders.constBegin(); it != folders.constEnd(); ++it)
1421 {
1422 /* Select slashes depending on the OS type: */
1423 if (UIGuestOSTypeManager::isDOSType(comGuest.GetOSTypeId()))
1424 strInfo += e_strTableRow2.arg(QString("<b>\\\\vboxsvr\\%1</b>").arg(it.key()), it.value());
1425 else
1426 strInfo += e_strTableRow2.arg(QString("<b>%1</b>").arg(it.key()), it.value());
1427 }
1428
1429 /* Handle 'no-folders' case: */
1430 if (!fFoldersPresent)
1431 strInfo = e_strTableRow1
1432 .arg(QApplication::translate("UIIndicatorSharedFolders", "No shared folders"));
1433}
1434
1435void UIDetailsGenerator::acquireDisplayStatusInfo(CMachine &comMachine, QString &strInfo,
1436 bool &fAcceleration3D)
1437{
1438 /* Get graphics adapter: */
1439 CGraphicsAdapter comGraphics = comMachine.GetGraphicsAdapter();
1440
1441 /* Video Memory: */
1442 const ULONG uVRAMSize = comGraphics.GetVRAMSize();
1443 const QString strVRAMSize = QApplication::translate("UICommon", "<nobr>%1 MB</nobr>", "details report").arg(uVRAMSize);
1444 strInfo += e_strTableRow2
1445 .arg(QApplication::translate("UIIndicatorDisplay", "Video memory"), strVRAMSize);
1446
1447 /* Monitor Count: */
1448 const ULONG uMonitorCount = comGraphics.GetMonitorCount();
1449 if (uMonitorCount > 1)
1450 {
1451 const QString strMonitorCount = QString::number(uMonitorCount);
1452 strInfo += e_strTableRow2
1453 .arg(QApplication::translate("UIIndicatorDisplay", "Screens"), strMonitorCount);
1454 }
1455
1456 /* 3D acceleration: */
1457 fAcceleration3D = comGraphics.GetAccelerate3DEnabled();
1458 if (fAcceleration3D)
1459 strInfo += e_strTableRow2
1460 .arg(QApplication::translate("UIDetails", "3D Acceleration", "details (display)"),
1461 QApplication::translate("UIDetails", "Enabled", "details (display/3D Acceleration)"));
1462}
1463
1464void UIDetailsGenerator::acquireRecordingStatusInfo(CMachine &comMachine, QString &strInfo,
1465 bool &fRecordingEnabled)
1466{
1467 /* Get recording settings: */
1468 CRecordingSettings comRecordingSettings = comMachine.GetRecordingSettings();
1469 fRecordingEnabled = comRecordingSettings.GetEnabled();
1470 if (fRecordingEnabled)
1471 {
1472 /* For now all screens have the same config: */
1473 CRecordingScreenSettings comRecordingScreen0Settings = comRecordingSettings.GetScreenSettings(0);
1474 const bool fVideoEnabled = comRecordingScreen0Settings.IsFeatureEnabled(KRecordingFeature_Video);
1475 const bool fAudioEnabled = comRecordingScreen0Settings.IsFeatureEnabled(KRecordingFeature_Audio);
1476
1477 /* Compose tool-tip: */
1478 QString strToolTip;
1479 if (fVideoEnabled && fAudioEnabled)
1480 strToolTip = QApplication::translate("UIIndicatorRecording", "Video/audio recording file");
1481 else if (fAudioEnabled)
1482 strToolTip = QApplication::translate("UIIndicatorRecording", "Audio recording file");
1483 else if (fVideoEnabled)
1484 strToolTip = QApplication::translate("UIIndicatorRecording", "Video recording file");
1485 strInfo += e_strTableRow2
1486 .arg(strToolTip)
1487 .arg(comRecordingScreen0Settings.GetFilename());
1488 }
1489 /* Handle 'no-recording' case: */
1490 else
1491 {
1492 strInfo += e_strTableRow1
1493 .arg(QApplication::translate("UIIndicatorRecording", "Recording disabled"));
1494 }
1495}
1496
1497void UIDetailsGenerator::acquireFeaturesStatusInfo(CMachine &comMachine, QString &strInfo,
1498 KVMExecutionEngine &enmEngine,
1499 bool fNestedPagingEnabled, bool fUxEnabled,
1500 KParavirtProvider enmProvider)
1501{
1502 /* VT-x/AMD-V feature: */
1503 QString strExecutionEngine;
1504 switch (enmEngine)
1505 {
1506 case KVMExecutionEngine_Interpreter:
1507 strExecutionEngine = "IEM (Interpreter)"; /* no translation */
1508 break;
1509 case KVMExecutionEngine_Recompiler:
1510 strExecutionEngine = "IEM (Recompiler)"; /* no translation */
1511 break;
1512 case KVMExecutionEngine_HwVirt:
1513 strExecutionEngine = "VT-x/AMD-V"; /* no translation */
1514 break;
1515 case KVMExecutionEngine_NativeApi:
1516 strExecutionEngine = "native API"; /* no translation */
1517 break;
1518 default:
1519 AssertFailed();
1520 enmEngine = KVMExecutionEngine_NotSet;
1521 RT_FALL_THRU();
1522 case KVMExecutionEngine_NotSet:
1523 strExecutionEngine = QApplication::translate("UICommon", "not set", "details report (execution engine)");
1524 break;
1525 }
1526
1527 /* Nested Paging feature: */
1528 const QString strNestedPaging = fNestedPagingEnabled
1529 ? QApplication::translate("UICommon", "Active", "details report (Nested Paging)")
1530 : QApplication::translate("UICommon", "Inactive", "details report (Nested Paging)");
1531
1532 /* Unrestricted Execution feature: */
1533 const QString strUnrestrictExec = fUxEnabled
1534 ? QApplication::translate("UICommon", "Active", "details report (Unrestricted Execution)")
1535 : QApplication::translate("UICommon", "Inactive", "details report (Unrestricted Execution)");
1536
1537 /* CPU Execution Cap feature: */
1538 const QString strCPUExecCap = QString::number(comMachine.GetCPUExecutionCap());
1539
1540 /* Paravirtualization feature: */
1541 const QString strParavirt = gpConverter->toString(enmProvider);
1542
1543 /* Compose tool-tip: */
1544 strInfo += e_strTableRow2.arg(QApplication::translate("UICommon", "Execution engine", "details report"), strExecutionEngine);
1545 strInfo += e_strTableRow2.arg(QApplication::translate("UICommon", "Nested Paging"), strNestedPaging);
1546 strInfo += e_strTableRow2.arg(QApplication::translate("UICommon", "Unrestricted Execution"), strUnrestrictExec);
1547 strInfo += e_strTableRow2.arg(QApplication::translate("UICommon", "Execution Cap", "details report"), strCPUExecCap);
1548 strInfo += e_strTableRow2.arg(QApplication::translate("UICommon", "Paravirtualization Interface", "details report"), strParavirt);
1549
1550 /* Add CPU count optional info: */
1551 const int cCpuCount = comMachine.GetCPUCount();
1552 if (cCpuCount > 1)
1553 strInfo += e_strTableRow2.arg(QApplication::translate("UICommon", "Processors", "details report"), QString::number(cCpuCount));
1554}
1555
1556QString UIDetailsGenerator::summarizeGenericProperties(const CNetworkAdapter &comAdapter)
1557{
1558 QVector<QString> names;
1559 QVector<QString> props;
1560 props = comAdapter.GetProperties(QString(), names);
1561 QString strResult;
1562 for (int i = 0; i < names.size(); ++i)
1563 {
1564 strResult += names[i] + "=" + props[i];
1565 if (i < names.size() - 1)
1566 strResult += ", ";
1567 }
1568 return strResult;
1569}
Note: See TracBrowser for help on using the repository browser.

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