VirtualBox

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

Last change on this file since 83203 was 83203, checked in by vboxsync, 5 years ago

FE/Qt: bugref:9653: A bit of cleanup for UICloudMachine and UICloudNetworkingStuff stuff.

  • 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: 51.0 KB
Line 
1/* $Id: UIDetailsGenerator.cpp 83203 2020-03-04 16:37:11Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIDetailsGenerator implementation.
4 */
5
6/*
7 * Copyright (C) 2012-2020 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18/* Qt includes: */
19#include <QApplication>
20#include <QDir>
21
22/* GUI includes: */
23#include "UIBootOrderEditor.h"
24#include "UICloudMachine.h"
25#include "UIConverter.h"
26#include "UIDetailsGenerator.h"
27#include "UIErrorString.h"
28#include "UICommon.h"
29
30/* COM includes: */
31#include "COMEnums.h"
32#include "CAudioAdapter.h"
33#include "CGraphicsAdapter.h"
34#include "CMachine.h"
35#include "CMediumAttachment.h"
36#include "CNetworkAdapter.h"
37#include "CRecordingScreenSettings.h"
38#include "CRecordingSettings.h"
39#include "CSerialPort.h"
40#include "CSharedFolder.h"
41#include "CStorageController.h"
42#include "CSystemProperties.h"
43#include "CUSBController.h"
44#include "CUSBDeviceFilter.h"
45#include "CUSBDeviceFilters.h"
46#include "CVRDEServer.h"
47
48UITextTable UIDetailsGenerator::generateMachineInformationGeneral(CMachine &comMachine,
49 const UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral &fOptions)
50{
51 UITextTable table;
52
53 if (comMachine.isNull())
54 return table;
55
56 if (!comMachine.GetAccessible())
57 {
58 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
59 return table;
60 }
61
62 /* Name: */
63 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_Name)
64 {
65 /* Configure hovering anchor: */
66 const QString strAnchorType = QString("machine_name");
67 const QString strName = comMachine.GetName();
68 table << UITextTableLine(QApplication::translate("UIDetails", "Name", "details (general)"),
69 QString("<a href=#%1,%2>%2</a>")
70 .arg(strAnchorType,
71 strName));
72 }
73
74 /* Operating system: */
75 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_OS)
76 {
77 /* Configure hovering anchor: */
78 const QString strAnchorType = QString("os_type");
79 const QString strOsTypeId = comMachine.GetOSTypeId();
80 table << UITextTableLine(QApplication::translate("UIDetails", "Operating System", "details (general)"),
81 QString("<a href=#%1,%2>%3</a>")
82 .arg(strAnchorType,
83 strOsTypeId,
84 uiCommon().vmGuestOSTypeDescription(strOsTypeId)));
85 }
86
87 /* Settings file location: */
88 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_Location)
89 {
90 /* Configure hovering anchor: */
91 const QString strAnchorType = QString("machine_location");
92 const QString strMachineLocation = comMachine.GetSettingsFilePath();
93 table << UITextTableLine(QApplication::translate("UIDetails", "Settings File Location", "details (general)"),
94 QString("<a href=#%1,%2>%3</a>")
95 .arg(strAnchorType,
96 strMachineLocation,
97 QDir::toNativeSeparators(QFileInfo(strMachineLocation).absolutePath())));
98 }
99
100 /* Groups: */
101 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_Groups)
102 {
103 QStringList groups = comMachine.GetGroups().toList();
104 /* Do not show groups for machine which is in root group only: */
105 if (groups.size() == 1)
106 groups.removeAll("/");
107 /* If group list still not empty: */
108 if (!groups.isEmpty())
109 {
110 /* For every group: */
111 for (int i = 0; i < groups.size(); ++i)
112 {
113 /* Trim first '/' symbol: */
114 QString &strGroup = groups[i];
115 if (strGroup.startsWith("/") && strGroup != "/")
116 strGroup.remove(0, 1);
117 }
118 table << UITextTableLine(QApplication::translate("UIDetails", "Groups", "details (general)"), groups.join(", "));
119 }
120 }
121
122 return table;
123}
124
125UITextTable UIDetailsGenerator::generateMachineInformationGeneral(UICloudMachine &guiCloudMachine,
126 const UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral &fOptions)
127{
128 UITextTable table;
129
130 if (guiCloudMachine.isNull())
131 return table;
132
133 if (!guiCloudMachine.isAccessible())
134 {
135 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
136 return table;
137 }
138
139 /* Name: */
140 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_Name)
141 table << UITextTableLine(QApplication::translate("UIDetails", "Name", "details (general)"),
142 guiCloudMachine.name());
143
144 /* Operating system: */
145 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_OS)
146 table << UITextTableLine(QApplication::translate("UIDetails", "Operating System", "details (general)"),
147 uiCommon().vmGuestOSTypeDescription(guiCloudMachine.osType()));
148
149 /* Domain: */
150 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeGeneral_Location)
151 {
152 const QString strDomain = guiCloudMachine.domain();
153 const QString strResult = !strDomain.isEmpty()
154 ? strDomain
155 : QApplication::translate("UIDetails", "Checking ...", "details");
156 table << UITextTableLine(QApplication::translate("UIDetails", "Domain", "details (general)"), strResult);
157 }
158
159 return table;
160}
161
162UITextTable UIDetailsGenerator::generateMachineInformationSystem(CMachine &comMachine,
163 const UIExtraDataMetaDefs::DetailsElementOptionTypeSystem &fOptions)
164{
165 UITextTable table;
166
167 if (comMachine.isNull())
168 return table;
169
170 if (!comMachine.GetAccessible())
171 {
172 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
173 return table;
174 }
175
176 /* Base memory: */
177 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_RAM)
178 {
179 /* Configure hovering anchor: */
180 const QString strAnchorType = QString("base_memory");
181 const int iBaseMemory = comMachine.GetMemorySize();
182 table << UITextTableLine(QApplication::translate("UIDetails", "Base Memory", "details (system)"),
183 QString("<a href=#%1,%2>%3</a>")
184 .arg(strAnchorType)
185 .arg(iBaseMemory)
186 .arg(QApplication::translate("UIDetails", "%1 MB").arg(iBaseMemory)));
187 }
188
189 /* Processors: */
190 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_CPUCount)
191 {
192 const int cCPU = comMachine.GetCPUCount();
193 if (cCPU > 1)
194 table << UITextTableLine(QApplication::translate("UIDetails", "Processors", "details (system)"),
195 QString::number(cCPU));
196 }
197
198 /* Execution cap: */
199 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_CPUExecutionCap)
200 {
201 const int iCPUExecutionCap = comMachine.GetCPUExecutionCap();
202 if (iCPUExecutionCap < 100)
203 table << UITextTableLine(QApplication::translate("UIDetails", "Execution Cap", "details (system)"),
204 QApplication::translate("UIDetails", "%1%", "details").arg(iCPUExecutionCap));
205 }
206
207 /* Boot order: */
208 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_BootOrder)
209 {
210 /* Configure hovering anchor: */
211 const QString strAnchorType = QString("boot_order");
212 const UIBootItemDataList bootItems = loadBootItems(comMachine);
213 table << UITextTableLine(QApplication::translate("UIDetails", "Boot Order", "details (system)"),
214 QString("<a href=#%1,%2>%3</a>")
215 .arg(strAnchorType,
216 bootItemsToSerializedString(bootItems),
217 bootItemsToReadableString(bootItems)));
218 }
219
220 /* Chipset type: */
221 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_ChipsetType)
222 {
223 const KChipsetType enmChipsetType = comMachine.GetChipsetType();
224 if (enmChipsetType == KChipsetType_ICH9)
225 table << UITextTableLine(QApplication::translate("UIDetails", "Chipset Type", "details (system)"),
226 gpConverter->toString(enmChipsetType));
227 }
228
229 /* EFI: */
230 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_Firmware)
231 {
232 switch (comMachine.GetFirmwareType())
233 {
234 case KFirmwareType_EFI:
235 case KFirmwareType_EFI32:
236 case KFirmwareType_EFI64:
237 case KFirmwareType_EFIDUAL:
238 {
239 table << UITextTableLine(QApplication::translate("UIDetails", "EFI", "details (system)"),
240 QApplication::translate("UIDetails", "Enabled", "details (system/EFI)"));
241 break;
242 }
243 default:
244 {
245 // For NLS purpose:
246 QApplication::translate("UIDetails", "Disabled", "details (system/EFI)");
247 break;
248 }
249 }
250 }
251
252 /* Acceleration: */
253 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_Acceleration)
254 {
255 QStringList acceleration;
256 if (uiCommon().virtualBox().GetHost().GetProcessorFeature(KProcessorFeature_HWVirtEx))
257 {
258 /* VT-x/AMD-V: */
259 if (comMachine.GetHWVirtExProperty(KHWVirtExPropertyType_Enabled))
260 {
261 acceleration << QApplication::translate("UIDetails", "VT-x/AMD-V", "details (system)");
262 /* Nested Paging (only when hw virt is enabled): */
263 if (comMachine.GetHWVirtExProperty(KHWVirtExPropertyType_NestedPaging))
264 acceleration << QApplication::translate("UIDetails", "Nested Paging", "details (system)");
265 }
266 }
267 /* PAE/NX: */
268 if (comMachine.GetCPUProperty(KCPUPropertyType_PAE))
269 acceleration << QApplication::translate("UIDetails", "PAE/NX", "details (system)");
270 /* Paravirtualization provider: */
271 switch (comMachine.GetEffectiveParavirtProvider())
272 {
273 case KParavirtProvider_Minimal: acceleration << QApplication::translate("UIDetails", "Minimal Paravirtualization", "details (system)"); break;
274 case KParavirtProvider_HyperV: acceleration << QApplication::translate("UIDetails", "Hyper-V Paravirtualization", "details (system)"); break;
275 case KParavirtProvider_KVM: acceleration << QApplication::translate("UIDetails", "KVM Paravirtualization", "details (system)"); break;
276 default: break;
277 }
278 if (!acceleration.isEmpty())
279 table << UITextTableLine(QApplication::translate("UIDetails", "Acceleration", "details (system)"),
280 acceleration.join(", "));
281 }
282
283 return table;
284}
285
286UITextTable UIDetailsGenerator::generateMachineInformationSystem(UICloudMachine &guiCloudMachine,
287 const UIExtraDataMetaDefs::DetailsElementOptionTypeSystem &fOptions)
288{
289 UITextTable table;
290
291 if (guiCloudMachine.isNull())
292 return table;
293
294 if (!guiCloudMachine.isAccessible())
295 {
296 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
297 return table;
298 }
299
300 /* Shape: */
301 {
302 const QString strShape = guiCloudMachine.shape();
303 const QString strResult = !strShape.isEmpty()
304 ? strShape
305 : QApplication::translate("UIDetails", "Checking ...", "details");
306 table << UITextTableLine(QApplication::translate("UIDetails", "Shape", "details (system)"), strResult);
307 }
308
309 /* Base memory: */
310 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_RAM)
311 {
312 const int iMemorySize = guiCloudMachine.memorySize();
313 const QString strResult = iMemorySize > 0
314 ? QApplication::translate("UIDetails", "%1 MB").arg(iMemorySize)
315 : QApplication::translate("UIDetails", "Checking ...", "details");
316 table << UITextTableLine(QApplication::translate("UIDetails", "Base Memory", "details (system)"), strResult);
317 }
318
319 /* Processors: */
320 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_CPUCount)
321 {
322 const int cCpuCount = guiCloudMachine.cpuCount();
323 const QString strResult = cCpuCount > 0
324 ? QString::number(cCpuCount)
325 : QApplication::translate("UIDetails", "Checking ...", "details");
326 table << UITextTableLine(QApplication::translate("UIDetails", "Processors", "details (system)"), strResult);
327 }
328
329 /* Booting firmware: */
330 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeSystem_Firmware)
331 {
332 const QString strBottingFirmware = guiCloudMachine.bootingFirmware();
333 const QString strResult = !strBottingFirmware.isEmpty()
334 ? strBottingFirmware
335 : QApplication::translate("UIDetails", "Checking ...", "details");
336 table << UITextTableLine(QApplication::translate("UIDetails", "Booting Firmware", "details (system)"), strResult);
337 }
338
339 return table;
340}
341
342UITextTable UIDetailsGenerator::generateMachineInformationDisplay(CMachine &comMachine,
343 const UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay &fOptions)
344{
345 UITextTable table;
346
347 if (comMachine.isNull())
348 return table;
349
350 if (!comMachine.GetAccessible())
351 {
352 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
353 return table;
354 }
355
356 const CGraphicsAdapter comGraphics = comMachine.GetGraphicsAdapter();
357
358 /* Video memory: */
359 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_VRAM)
360 {
361 /* Configure hovering anchor: */
362 const QString strAnchorType = QString("video_memory");
363 const int iVideoMemory = comGraphics.GetVRAMSize();
364 table << UITextTableLine(QApplication::translate("UIDetails", "Video Memory", "details (display)"),
365 QString("<a href=#%1,%2>%3</a>")
366 .arg(strAnchorType)
367 .arg(iVideoMemory)
368 .arg(QApplication::translate("UIDetails", "%1 MB").arg(iVideoMemory)));
369 }
370
371 /* Screens: */
372 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_ScreenCount)
373 {
374 const int cGuestScreens = comGraphics.GetMonitorCount();
375 if (cGuestScreens > 1)
376 table << UITextTableLine(QApplication::translate("UIDetails", "Screens", "details (display)"),
377 QString::number(cGuestScreens));
378 }
379
380 /* Scale-factor: */
381 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_ScaleFactor)
382 {
383 const QString strScaleFactor = comMachine.GetExtraData(UIExtraDataDefs::GUI_ScaleFactor);
384 {
385 /* Try to convert loaded data to double: */
386 bool fOk = false;
387 double dValue = strScaleFactor.toDouble(&fOk);
388 /* Invent the default value: */
389 if (!fOk || !dValue)
390 dValue = 1.0;
391 /* Append information: */
392 if (dValue != 1.0)
393 table << UITextTableLine(QApplication::translate("UIDetails", "Scale-factor", "details (display)"),
394 QString::number(dValue, 'f', 2));
395 }
396 }
397
398 /* Graphics Controller: */
399 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_GraphicsController)
400 {
401 const QString strAnchorType = QString("graphics_controller_type");
402 const KGraphicsControllerType enmType = comGraphics.GetGraphicsControllerType();
403 table << UITextTableLine(QApplication::translate("UIDetails", "Graphics Controller", "details (display)"),
404 QString("<a href=#%1,%2>%3</a>")
405 .arg(strAnchorType)
406 .arg((int)enmType)
407 .arg(gpConverter->toString(enmType)));
408 }
409
410 /* Acceleration: */
411 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_Acceleration)
412 {
413 QStringList acceleration;
414#ifdef VBOX_WITH_VIDEOHWACCEL
415 /* 2D acceleration: */
416 if (comGraphics.GetAccelerate2DVideoEnabled())
417 acceleration << QApplication::translate("UIDetails", "2D Video", "details (display)");
418#endif
419 /* 3D acceleration: */
420 if (comGraphics.GetAccelerate3DEnabled())
421 acceleration << QApplication::translate("UIDetails", "3D", "details (display)");
422 if (!acceleration.isEmpty())
423 table << UITextTableLine(QApplication::translate("UIDetails", "Acceleration", "details (display)"),
424 acceleration.join(", "));
425 }
426
427 /* Remote desktop server: */
428 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_VRDE)
429 {
430 const CVRDEServer comServer = comMachine.GetVRDEServer();
431 if (!comServer.isNull())
432 {
433 if (comServer.GetEnabled())
434 table << UITextTableLine(QApplication::translate("UIDetails", "Remote Desktop Server Port", "details (display/vrde)"),
435 comServer.GetVRDEProperty("TCP/Ports"));
436 else
437 table << UITextTableLine(QApplication::translate("UIDetails", "Remote Desktop Server", "details (display/vrde)"),
438 QApplication::translate("UIDetails", "Disabled", "details (display/vrde/VRDE server)"));
439 }
440 }
441
442 /* Recording: */
443 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeDisplay_Recording)
444 {
445 CRecordingSettings comRecordingSettings = comMachine.GetRecordingSettings();
446 if (comRecordingSettings.GetEnabled())
447 {
448 /* For now all screens have the same config: */
449 const CRecordingScreenSettings comRecordingScreen0Settings = comRecordingSettings.GetScreenSettings(0);
450
451 /** @todo r=andy Refine these texts (wrt audio and/or video). */
452 table << UITextTableLine(QApplication::translate("UIDetails", "Recording File", "details (display/recording)"),
453 comRecordingScreen0Settings.GetFilename());
454 table << UITextTableLine(QApplication::translate("UIDetails", "Recording Attributes", "details (display/recording)"),
455 QApplication::translate("UIDetails", "Frame Size: %1x%2, Frame Rate: %3fps, Bit Rate: %4kbps")
456 .arg(comRecordingScreen0Settings.GetVideoWidth()).arg(comRecordingScreen0Settings.GetVideoHeight())
457 .arg(comRecordingScreen0Settings.GetVideoFPS()).arg(comRecordingScreen0Settings.GetVideoRate()));
458 }
459 else
460 {
461 table << UITextTableLine(QApplication::translate("UIDetails", "Recording", "details (display/recording)"),
462 QApplication::translate("UIDetails", "Disabled", "details (display/recording)"));
463 }
464 }
465
466 return table;
467}
468
469UITextTable UIDetailsGenerator::generateMachineInformationStorage(CMachine &comMachine,
470 const UIExtraDataMetaDefs::DetailsElementOptionTypeStorage &fOptions,
471 bool fLink /* = true */)
472{
473 UITextTable table;
474
475 if (comMachine.isNull())
476 return table;
477
478 if (!comMachine.GetAccessible())
479 {
480 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
481 return table;
482 }
483
484 /* Iterate over all the machine controllers: */
485 foreach (const CStorageController &comController, comMachine.GetStorageControllers())
486 {
487 /* Add controller information: */
488 const QString strControllerName = QApplication::translate("UIMachineSettingsStorage", "Controller: %1");
489 table << UITextTableLine(strControllerName.arg(comController.GetName()), QString());
490 /* Populate map (its sorted!): */
491 QMap<StorageSlot, QString> attachmentsMap;
492 foreach (const CMediumAttachment &attachment, comMachine.GetMediumAttachmentsOfController(comController.GetName()))
493 {
494 /* Acquire device type first of all: */
495 const KDeviceType enmDeviceType = attachment.GetType();
496
497 /* Ignore restricted device types: */
498 if ( ( !(fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeStorage_HardDisks)
499 && enmDeviceType == KDeviceType_HardDisk)
500 || ( !(fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeStorage_OpticalDevices)
501 && enmDeviceType == KDeviceType_DVD)
502 || ( !(fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeStorage_FloppyDevices)
503 && enmDeviceType == KDeviceType_Floppy))
504 continue;
505
506 /* Prepare current storage slot: */
507 const StorageSlot attachmentSlot(comController.GetBus(), attachment.GetPort(), attachment.GetDevice());
508 AssertMsg(comController.isOk(),
509 ("Unable to acquire controller data: %s\n",
510 UIErrorString::formatRC(comController.lastRC()).toUtf8().constData()));
511 if (!comController.isOk())
512 continue;
513
514 /* Prepare attachment information: */
515 QString strAttachmentInfo = uiCommon().details(attachment.GetMedium(), false, false);
516 /* That hack makes sure 'Inaccessible' word is always bold: */
517 { // hack
518 const QString strInaccessibleString(UICommon::tr("Inaccessible", "medium"));
519 const QString strBoldInaccessibleString(QString("<b>%1</b>").arg(strInaccessibleString));
520 strAttachmentInfo.replace(strInaccessibleString, strBoldInaccessibleString);
521 } // hack
522
523 /* Append 'device slot name' with 'device type name' for optical devices only: */
524 QString strDeviceType = enmDeviceType == KDeviceType_DVD
525 ? QApplication::translate("UIDetails", "[Optical Drive]", "details (storage)")
526 : QString();
527 if (!strDeviceType.isNull())
528 strDeviceType.append(' ');
529
530 /* Insert that attachment information into the map: */
531 if (!strAttachmentInfo.isNull())
532 {
533 /* Configure hovering anchors: */
534 const QString strAnchorType = enmDeviceType == KDeviceType_DVD || enmDeviceType == KDeviceType_Floppy ? QString("mount") :
535 enmDeviceType == KDeviceType_HardDisk ? QString("attach") : QString();
536 const CMedium medium = attachment.GetMedium();
537 const QString strMediumLocation = medium.isNull() ? QString() : medium.GetLocation();
538 if (fLink)
539 attachmentsMap.insert(attachmentSlot,
540 QString("<a href=#%1,%2,%3,%4>%5</a>")
541 .arg(strAnchorType,
542 comController.GetName(),
543 gpConverter->toString(attachmentSlot),
544 strMediumLocation,
545 strDeviceType + strAttachmentInfo));
546 else
547 attachmentsMap.insert(attachmentSlot,
548 QString("%1")
549 .arg(strDeviceType + strAttachmentInfo));
550 }
551 }
552
553 /* Iterate over the sorted map: */
554 const QList<StorageSlot> storageSlots = attachmentsMap.keys();
555 const QList<QString> storageInfo = attachmentsMap.values();
556 for (int i = 0; i < storageSlots.size(); ++i)
557 table << UITextTableLine(QString(" ") + gpConverter->toString(storageSlots[i]), storageInfo[i]);
558 }
559 if (table.isEmpty())
560 table << UITextTableLine(QApplication::translate("UIDetails", "Not Attached", "details (storage)"), QString());
561
562 return table;
563}
564
565UITextTable UIDetailsGenerator::generateMachineInformationStorage(UICloudMachine &guiCloudMachine,
566 const UIExtraDataMetaDefs::DetailsElementOptionTypeStorage &fOptions)
567{
568 UITextTable table;
569
570 if (guiCloudMachine.isNull())
571 return table;
572
573 if (!guiCloudMachine.isAccessible())
574 {
575 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
576 return table;
577 }
578
579 /* Image: */
580 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeStorage_HardDisks)
581 {
582 const QString strImageName = guiCloudMachine.imageName();
583 const QString strImageSize = guiCloudMachine.imageSize();
584 const QString strResult = !strImageName.isEmpty() && !strImageSize.isEmpty()
585 ? QString("%1 (%2)").arg(strImageName, strImageSize)
586 : QApplication::translate("UIDetails", "Checking ...", "details");
587 table << UITextTableLine(QApplication::translate("UIDetails", "Image", "details (storage)"), strResult);
588 }
589
590 return table;
591}
592
593UITextTable UIDetailsGenerator::generateMachineInformationAudio(CMachine &comMachine,
594 const UIExtraDataMetaDefs::DetailsElementOptionTypeAudio &fOptions)
595{
596 UITextTable table;
597
598 if (comMachine.isNull())
599 return table;
600
601 if (!comMachine.GetAccessible())
602 {
603 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
604 return table;
605 }
606
607 const CAudioAdapter comAudio = comMachine.GetAudioAdapter();
608 if (comAudio.GetEnabled())
609 {
610 /* Host driver: */
611 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeAudio_Driver)
612 {
613 const QString strAnchorType = QString("audio_host_driver_type");
614 const KAudioDriverType enmType = comAudio.GetAudioDriver();
615 table << UITextTableLine(QApplication::translate("UIDetails", "Host Driver", "details (audio)"),
616 QString("<a href=#%1,%2>%3</a>")
617 .arg(strAnchorType)
618 .arg((int)enmType)
619 .arg(gpConverter->toString(enmType)));
620 }
621
622 /* Controller: */
623 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeAudio_Controller)
624 {
625 const QString strAnchorType = QString("audio_controller_type");
626 const KAudioControllerType enmType = comAudio.GetAudioController();
627 table << UITextTableLine(QApplication::translate("UIDetails", "Controller", "details (audio)"),
628 QString("<a href=#%1,%2>%3</a>")
629 .arg(strAnchorType)
630 .arg((int)enmType)
631 .arg(gpConverter->toString(enmType)));
632 }
633
634#ifdef VBOX_WITH_AUDIO_INOUT_INFO
635 /* Audio I/O: */
636 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeAudio_IO)
637 {
638 table << UITextTableLine(QApplication::translate("UIDetails", "Audio Input", "details (audio)"),
639 comAudio.GetEnabledIn() ?
640 QApplication::translate("UIDetails", "Enabled", "details (audio/input)") :
641 QApplication::translate("UIDetails", "Disabled", "details (audio/input)"));
642 table << UITextTableLine(QApplication::translate("UIDetails", "Audio Output", "details (audio)"),
643 comAudio.GetEnabledOut() ?
644 QApplication::translate("UIDetails", "Enabled", "details (audio/output)") :
645 QApplication::translate("UIDetails", "Disabled", "details (audio/output)"));
646 }
647#endif /* VBOX_WITH_AUDIO_INOUT_INFO */
648 }
649 else
650 table << UITextTableLine(QApplication::translate("UIDetails", "Disabled", "details (audio)"),
651 QString());
652
653 return table;
654}
655
656QString summarizeGenericProperties(const CNetworkAdapter &comAdapter)
657{
658 QVector<QString> names;
659 QVector<QString> props;
660 props = comAdapter.GetProperties(QString(), names);
661 QString strResult;
662 for (int i = 0; i < names.size(); ++i)
663 {
664 strResult += names[i] + "=" + props[i];
665 if (i < names.size() - 1)
666 strResult += ", ";
667 }
668 return strResult;
669}
670
671UITextTable UIDetailsGenerator::generateMachineInformationNetwork(CMachine &comMachine,
672 const UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork &fOptions)
673{
674 UITextTable table;
675
676 if (comMachine.isNull())
677 return table;
678
679 if (!comMachine.GetAccessible())
680 {
681 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
682 return table;
683 }
684
685 /* Iterate over all the adapters: */
686 const ulong uCount = uiCommon().virtualBox().GetSystemProperties().GetMaxNetworkAdapters(comMachine.GetChipsetType());
687 for (ulong uSlot = 0; uSlot < uCount; ++uSlot)
688 {
689 const QString strAnchorType = QString("network_attachment_type");
690 const CNetworkAdapter comAdapter = comMachine.GetNetworkAdapter(uSlot);
691
692 /* Skip disabled adapters: */
693 if (!comAdapter.GetEnabled())
694 continue;
695
696 /* Gather adapter information: */
697 const KNetworkAttachmentType enmAttachmentType = comAdapter.GetAttachmentType();
698 const QString strAttachmentTemplate = gpConverter->toString(comAdapter.GetAdapterType()).replace(QRegExp("\\s\\(.+\\)"), " (<a href=#%1,%2;%3;%4>%5</a>)");
699 QString strAttachmentType;
700 switch (enmAttachmentType)
701 {
702 case KNetworkAttachmentType_NAT:
703 {
704 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_NAT)
705 strAttachmentType = strAttachmentTemplate
706 .arg(strAnchorType)
707 .arg(uSlot)
708 .arg((int)KNetworkAttachmentType_NAT)
709 .arg(QString())
710 .arg(gpConverter->toString(KNetworkAttachmentType_NAT));
711 break;
712 }
713 case KNetworkAttachmentType_Bridged:
714 {
715 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_BridgetAdapter)
716 {
717 const QString strName = comAdapter.GetBridgedInterface();
718 strAttachmentType = strAttachmentTemplate
719 .arg(strAnchorType)
720 .arg(uSlot)
721 .arg((int)KNetworkAttachmentType_Bridged)
722 .arg(strName)
723 .arg(QApplication::translate("UIDetails", "Bridged Adapter, %1", "details (network)")
724 .arg(strName));
725 }
726 break;
727 }
728 case KNetworkAttachmentType_Internal:
729 {
730 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_InternalNetwork)
731 {
732 const QString strName = comAdapter.GetInternalNetwork();
733 strAttachmentType = strAttachmentTemplate
734 .arg(strAnchorType)
735 .arg(uSlot)
736 .arg((int)KNetworkAttachmentType_Internal)
737 .arg(strName)
738 .arg(QApplication::translate("UIDetails", "Internal Network, '%1'", "details (network)")
739 .arg(strName));
740 }
741 break;
742 }
743 case KNetworkAttachmentType_HostOnly:
744 {
745 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_HostOnlyAdapter)
746 {
747 const QString strName = comAdapter.GetHostOnlyInterface();
748 strAttachmentType = strAttachmentTemplate
749 .arg(strAnchorType)
750 .arg(uSlot)
751 .arg((int)KNetworkAttachmentType_HostOnly)
752 .arg(strName)
753 .arg(QApplication::translate("UIDetails", "Host-only Adapter, '%1'", "details (network)")
754 .arg(strName));
755 }
756 break;
757 }
758 case KNetworkAttachmentType_Generic:
759 {
760 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_GenericDriver)
761 {
762 const QString strName = comAdapter.GetGenericDriver();
763 const QString strGenericDriverProperties(summarizeGenericProperties(comAdapter));
764 strAttachmentType = strGenericDriverProperties.isNull()
765 ? strAttachmentTemplate
766 .arg(strAnchorType)
767 .arg(uSlot)
768 .arg((int)KNetworkAttachmentType_Generic)
769 .arg(strName)
770 .arg(QApplication::translate("UIDetails", "Generic Driver, '%1'", "details (network)")
771 .arg(strName))
772 : strAttachmentTemplate
773 .arg(strAnchorType)
774 .arg(uSlot)
775 .arg((int)KNetworkAttachmentType_Generic)
776 .arg(strName)
777 .arg(QApplication::translate("UIDetails", "Generic Driver, '%1' { %2 }", "details (network)")
778 .arg(strName, strGenericDriverProperties));
779 }
780 break;
781 }
782 case KNetworkAttachmentType_NATNetwork:
783 {
784 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_NATNetwork)
785 {
786 const QString strName = comAdapter.GetNATNetwork();
787 strAttachmentType = strAttachmentTemplate
788 .arg(strAnchorType)
789 .arg(uSlot)
790 .arg((int)KNetworkAttachmentType_NATNetwork)
791 .arg(strName)
792 .arg(QApplication::translate("UIDetails", "NAT Network, '%1'", "details (network)")
793 .arg(strName));
794 }
795 break;
796 }
797 default:
798 {
799 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_NotAttached)
800 strAttachmentType = strAttachmentTemplate
801 .arg(strAnchorType)
802 .arg(uSlot)
803 .arg((int)enmAttachmentType)
804 .arg(QString())
805 .arg(gpConverter->toString(enmAttachmentType));
806 break;
807 }
808 }
809 if (!strAttachmentType.isNull())
810 table << UITextTableLine(QApplication::translate("UIDetails", "Adapter %1", "details (network)").arg(comAdapter.GetSlot() + 1), strAttachmentType);
811 }
812 if (table.isEmpty())
813 table << UITextTableLine(QApplication::translate("UIDetails", "Disabled", "details (network/adapter)"), QString());
814
815 return table;
816}
817
818UITextTable UIDetailsGenerator::generateMachineInformationSerial(CMachine &comMachine,
819 const UIExtraDataMetaDefs::DetailsElementOptionTypeSerial &fOptions)
820{
821 UITextTable table;
822
823 if (comMachine.isNull())
824 return table;
825
826 if (!comMachine.GetAccessible())
827 {
828 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
829 return table;
830 }
831
832 /* Iterate over all the ports: */
833 const ulong uCount = uiCommon().virtualBox().GetSystemProperties().GetSerialPortCount();
834 for (ulong uSlot = 0; uSlot < uCount; ++uSlot)
835 {
836 const CSerialPort comPort = comMachine.GetSerialPort(uSlot);
837
838 /* Skip disabled adapters: */
839 if (!comPort.GetEnabled())
840 continue;
841
842 /* Gather port information: */
843 const KPortMode enmMode = comPort.GetHostMode();
844 const QString strModeTemplate = uiCommon().toCOMPortName(comPort.GetIRQ(), comPort.GetIOBase()) + ", ";
845 QString strModeType;
846 switch (enmMode)
847 {
848 case KPortMode_HostPipe:
849 {
850 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_HostPipe)
851 strModeType = strModeTemplate + QString("%1 (%2)").arg(gpConverter->toString(enmMode)).arg(QDir::toNativeSeparators(comPort.GetPath()));
852 break;
853 }
854 case KPortMode_HostDevice:
855 {
856 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_HostDevice)
857 strModeType = strModeTemplate + QString("%1 (%2)").arg(gpConverter->toString(enmMode)).arg(QDir::toNativeSeparators(comPort.GetPath()));
858 break;
859 }
860 case KPortMode_RawFile:
861 {
862 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_RawFile)
863 strModeType = strModeTemplate + QString("%1 (%2)").arg(gpConverter->toString(enmMode)).arg(QDir::toNativeSeparators(comPort.GetPath()));
864 break;
865 }
866 case KPortMode_TCP:
867 {
868 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_TCP)
869 strModeType = strModeTemplate + QString("%1 (%2)").arg(gpConverter->toString(enmMode)).arg(QDir::toNativeSeparators(comPort.GetPath()));
870 break;
871 }
872 default:
873 {
874 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeSerial_Disconnected)
875 strModeType = strModeTemplate + gpConverter->toString(enmMode);
876 break;
877 }
878 }
879 if (!strModeType.isNull())
880 table << UITextTableLine(QApplication::translate("UIDetails", "Port %1", "details (serial)").arg(comPort.GetSlot() + 1), strModeType);
881 }
882 if (table.isEmpty())
883 table << UITextTableLine(QApplication::translate("UIDetails", "Disabled", "details (serial)"), QString());
884
885 return table;
886}
887
888UITextTable UIDetailsGenerator::generateMachineInformationUSB(CMachine &comMachine,
889 const UIExtraDataMetaDefs::DetailsElementOptionTypeUsb &fOptions)
890{
891 UITextTable table;
892
893 if (comMachine.isNull())
894 return table;
895
896 if (!comMachine.GetAccessible())
897 {
898 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
899 return table;
900 }
901
902 /* Iterate over all the USB filters: */
903 const CUSBDeviceFilters comFilterObject = comMachine.GetUSBDeviceFilters();
904 if (!comFilterObject.isNull() && comMachine.GetUSBProxyAvailable())
905 {
906 const QString strAnchorType = QString("usb_controller_type");
907 const CUSBControllerVector controllers = comMachine.GetUSBControllers();
908 if (!controllers.isEmpty())
909 {
910 /* USB controllers: */
911 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeUsb_Controller)
912 {
913 QStringList controllerInternal;
914 QStringList controllersReadable;
915 foreach (const CUSBController &comController, controllers)
916 {
917 const KUSBControllerType enmType = comController.GetType();
918 controllerInternal << QString::number((int)enmType);
919 controllersReadable << gpConverter->toString(enmType);
920 }
921 table << UITextTableLine(QApplication::translate("UIDetails", "USB Controller", "details (usb)"),
922 QString("<a href=#%1,%2>%3</a>")
923 .arg(strAnchorType)
924 .arg(controllerInternal.join(';'))
925 .arg(controllersReadable.join(", ")));
926 }
927
928 /* Device filters: */
929 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeUsb_DeviceFilters)
930 {
931 const CUSBDeviceFilterVector filters = comFilterObject.GetDeviceFilters();
932 uint uActive = 0;
933 for (int i = 0; i < filters.size(); ++i)
934 if (filters.at(i).GetActive())
935 ++uActive;
936 table << UITextTableLine(QApplication::translate("UIDetails", "Device Filters", "details (usb)"),
937 QApplication::translate("UIDetails", "%1 (%2 active)", "details (usb)").arg(filters.size()).arg(uActive));
938 }
939 }
940 else
941 table << UITextTableLine(QString("<a href=#%1,%2>%3</a>")
942 .arg(strAnchorType)
943 .arg(QString::number((int)KUSBControllerType_Null))
944 .arg(QApplication::translate("UIDetails", "Disabled", "details (usb)")),
945 QString());
946 }
947 else
948 table << UITextTableLine(QApplication::translate("UIDetails", "USB Controller Inaccessible", "details (usb)"), QString());
949
950 return table;
951}
952
953UITextTable UIDetailsGenerator::generateMachineInformationSharedFolders(CMachine &comMachine,
954 const UIExtraDataMetaDefs::DetailsElementOptionTypeSharedFolders &fOptions)
955{
956 Q_UNUSED(fOptions);
957
958 UITextTable table;
959
960 if (comMachine.isNull())
961 return table;
962
963 if (!comMachine.GetAccessible())
964 {
965 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
966 return table;
967 }
968
969 /* Summary: */
970 const ulong uCount = comMachine.GetSharedFolders().size();
971 if (uCount > 0)
972 table << UITextTableLine(QApplication::translate("UIDetails", "Shared Folders", "details (shared folders)"), QString::number(uCount));
973 else
974 table << UITextTableLine(QApplication::translate("UIDetails", "None", "details (shared folders)"), QString());
975
976 return table;
977}
978
979UITextTable UIDetailsGenerator::generateMachineInformationUI(CMachine &comMachine,
980 const UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface &fOptions)
981{
982 UITextTable table;
983
984 if (comMachine.isNull())
985 return table;
986
987 if (!comMachine.GetAccessible())
988 {
989 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
990 return table;
991 }
992
993#ifndef VBOX_WS_MAC
994 /* Menu-bar: */
995 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_MenuBar)
996 {
997 const QString strAnchorType = QString("menu_bar");
998 const QString strMenubarEnabled = comMachine.GetExtraData(UIExtraDataDefs::GUI_MenuBar_Enabled);
999 const bool fEnabled = !( strMenubarEnabled.compare("false", Qt::CaseInsensitive) == 0
1000 || strMenubarEnabled.compare("no", Qt::CaseInsensitive) == 0
1001 || strMenubarEnabled.compare("off", Qt::CaseInsensitive) == 0
1002 || strMenubarEnabled == "0");
1003 table << UITextTableLine(QApplication::translate("UIDetails", "Menu-bar", "details (user interface)"),
1004 QString("<a href=#%1,%2>%3</a>")
1005 .arg(strAnchorType)
1006 .arg((int)fEnabled)
1007 .arg(fEnabled ? QApplication::translate("UIDetails", "Enabled", "details (user interface/menu-bar)")
1008 : QApplication::translate("UIDetails", "Disabled", "details (user interface/menu-bar)")));
1009 }
1010#endif /* !VBOX_WS_MAC */
1011
1012 /* Status-bar: */
1013 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_StatusBar)
1014 {
1015 const QString strAnchorType = QString("status_bar");
1016 const QString strStatusbarEnabled = comMachine.GetExtraData(UIExtraDataDefs::GUI_StatusBar_Enabled);
1017 const bool fEnabled = !( strStatusbarEnabled.compare("false", Qt::CaseInsensitive) == 0
1018 || strStatusbarEnabled.compare("no", Qt::CaseInsensitive) == 0
1019 || strStatusbarEnabled.compare("off", Qt::CaseInsensitive) == 0
1020 || strStatusbarEnabled == "0");
1021 table << UITextTableLine(QApplication::translate("UIDetails", "Status-bar", "details (user interface)"),
1022 QString("<a href=#%1,%2>%3</a>")
1023 .arg(strAnchorType)
1024 .arg((int)fEnabled)
1025 .arg(fEnabled ? QApplication::translate("UIDetails", "Enabled", "details (user interface/status-bar)")
1026 : QApplication::translate("UIDetails", "Disabled", "details (user interface/status-bar)")));
1027 }
1028
1029#ifndef VBOX_WS_MAC
1030 /* Mini-toolbar: */
1031 if (fOptions & UIExtraDataMetaDefs::DetailsElementOptionTypeUserInterface_MiniToolbar)
1032 {
1033 const QString strAnchorType = QString("mini_toolbar");
1034 const QString strMiniToolbarEnabled = comMachine.GetExtraData(UIExtraDataDefs::GUI_ShowMiniToolBar);
1035 const bool fEnabled = !( strMiniToolbarEnabled.compare("false", Qt::CaseInsensitive) == 0
1036 || strMiniToolbarEnabled.compare("no", Qt::CaseInsensitive) == 0
1037 || strMiniToolbarEnabled.compare("off", Qt::CaseInsensitive) == 0
1038 || strMiniToolbarEnabled == "0");
1039 if (fEnabled)
1040 {
1041 /* Get mini-toolbar position: */
1042 const QString strMiniToolbarPosition = comMachine.GetExtraData(UIExtraDataDefs::GUI_MiniToolBarAlignment);
1043 {
1044 /* Try to convert loaded data to alignment: */
1045 switch (gpConverter->fromInternalString<MiniToolbarAlignment>(strMiniToolbarPosition))
1046 {
1047 case MiniToolbarAlignment_Top:
1048 table << UITextTableLine(QApplication::translate("UIDetails", "Mini-toolbar Position", "details (user interface)"),
1049 QString("<a href=#%1,%2>%3</a>")
1050 .arg(strAnchorType)
1051 .arg((int)MiniToolbarAlignment_Top)
1052 .arg(QApplication::translate("UIDetails", "Top", "details (user interface/mini-toolbar position)")));
1053 break;
1054 case MiniToolbarAlignment_Bottom:
1055 table << UITextTableLine(QApplication::translate("UIDetails", "Mini-toolbar Position", "details (user interface)"),
1056 QString("<a href=#%1,%2>%3</a>")
1057 .arg(strAnchorType)
1058 .arg((int)MiniToolbarAlignment_Bottom)
1059 .arg(QApplication::translate("UIDetails", "Bottom", "details (user interface/mini-toolbar position)")));
1060 break;
1061 default:
1062 break;
1063 }
1064 }
1065 }
1066 else
1067 table << UITextTableLine(QApplication::translate("UIDetails", "Mini-toolbar", "details (user interface)"),
1068 QString("<a href=#%1,%2>%3</a>")
1069 .arg(strAnchorType)
1070 .arg((int)MiniToolbarAlignment_Disabled)
1071 .arg(QApplication::translate("UIDetails", "Disabled", "details (user interface/mini-toolbar)")));
1072 }
1073#endif /* !VBOX_WS_MAC */
1074
1075 return table;
1076}
1077
1078UITextTable UIDetailsGenerator::generateMachineInformationDescription(CMachine &comMachine,
1079 const UIExtraDataMetaDefs::DetailsElementOptionTypeDescription &fOptions)
1080{
1081 Q_UNUSED(fOptions);
1082
1083 UITextTable table;
1084
1085 if (comMachine.isNull())
1086 return table;
1087
1088 if (!comMachine.GetAccessible())
1089 {
1090 table << UITextTableLine(QApplication::translate("UIDetails", "Information Inaccessible", "details"), QString());
1091 return table;
1092 }
1093
1094 /* Summary: */
1095 const QString strDescription = comMachine.GetDescription();
1096 if (!strDescription.isEmpty())
1097 table << UITextTableLine(strDescription, QString());
1098 else
1099 table << UITextTableLine(QApplication::translate("UIDetails", "None", "details (description)"), QString());
1100
1101 return table;
1102}
Note: See TracBrowser for help on using the repository browser.

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