Changeset 75426 in vbox
- Timestamp:
- Nov 13, 2018 4:22:44 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/manager/details
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElements.cpp
r75361 r75426 231 231 { 232 232 /* Acquire corresponding machine: */ 233 CMachine machine = property("machine").value<CMachine>();234 if ( machine.isNull())235 return; 236 237 /* Prepare table: */ 238 UITextTable table; 239 240 /* Gather information: */ 241 if ( machine.GetAccessible())242 { 243 /* Machine name: */244 table << UITextTableLine(QApplication::translate("UIDetails", "Name", "details (general)"), machine.GetName());245 246 /* Operating system type: */233 CMachine comMachine = property("machine").value<CMachine>(); 234 if (comMachine.isNull()) 235 return; 236 237 /* Prepare table: */ 238 UITextTable table; 239 240 /* Gather information: */ 241 if (comMachine.GetAccessible()) 242 { 243 /* Name: */ 244 table << UITextTableLine(QApplication::translate("UIDetails", "Name", "details (general)"), comMachine.GetName()); 245 246 /* Operating System: */ 247 247 table << UITextTableLine(QApplication::translate("UIDetails", "Operating System", "details (general)"), 248 vboxGlobal().vmGuestOSTypeDescription(machine.GetOSTypeId())); 249 250 /* Location of the settings file: */ 251 const QString strSettingsFilePath = machine.GetSettingsFilePath(); 252 if (!strSettingsFilePath.isEmpty()) 253 { 254 table << UITextTableLine(QApplication::translate("UIDetails", "Settings File Location", "details (general)"), 255 QDir::toNativeSeparators(QFileInfo(strSettingsFilePath).absolutePath())); 256 } 257 258 /* Get groups: */ 259 QStringList groups = machine.GetGroups().toList(); 248 vboxGlobal().vmGuestOSTypeDescription(comMachine.GetOSTypeId())); 249 250 /* Settings File Location: */ 251 table << UITextTableLine(QApplication::translate("UIDetails", "Settings File Location", "details (general)"), 252 QDir::toNativeSeparators(QFileInfo(comMachine.GetSettingsFilePath()).absolutePath())); 253 254 /* Groups: */ 255 QStringList groups = comMachine.GetGroups().toList(); 260 256 /* Do not show groups for machine which is in root group only: */ 261 257 if (groups.size() == 1) … … 286 282 { 287 283 /* Acquire corresponding machine: */ 288 CMachine machine = property("machine").value<CMachine>();289 if ( machine.isNull())290 return; 291 292 /* Prepare table: */ 293 UITextTable table; 294 295 /* Gather information: */ 296 if ( machine.GetAccessible())284 CMachine comMachine = property("machine").value<CMachine>(); 285 if (comMachine.isNull()) 286 return; 287 288 /* Prepare table: */ 289 UITextTable table; 290 291 /* Gather information: */ 292 if (comMachine.GetAccessible()) 297 293 { 298 294 /* Base memory: */ 299 295 table << UITextTableLine(QApplication::translate("UIDetails", "Base Memory", "details (system)"), 300 QApplication::translate("UIDetails", "%1 MB", "details").arg( machine.GetMemorySize()));296 QApplication::translate("UIDetails", "%1 MB", "details").arg(comMachine.GetMemorySize())); 301 297 302 298 /* CPU count: */ 303 int cCPU = machine.GetCPUCount();299 const int cCPU = comMachine.GetCPUCount(); 304 300 if (cCPU > 1) 305 301 table << UITextTableLine(QApplication::translate("UIDetails", "Processors", "details (system)"), … … 307 303 308 304 /* CPU execution cap: */ 309 int iCPUExecCap = machine.GetCPUExecutionCap();310 if (iCPUExec Cap < 100)305 const int iCPUExecutionCap = comMachine.GetCPUExecutionCap(); 306 if (iCPUExecutionCap < 100) 311 307 table << UITextTableLine(QApplication::translate("UIDetails", "Execution Cap", "details (system)"), 312 QApplication::translate("UIDetails", "%1%", "details").arg(iCPUExec Cap));308 QApplication::translate("UIDetails", "%1%", "details").arg(iCPUExecutionCap)); 313 309 314 310 /* Boot-order: */ … … 316 312 for (ulong i = 1; i <= vboxGlobal().virtualBox().GetSystemProperties().GetMaxBootPosition(); ++i) 317 313 { 318 KDeviceType device = machine.GetBootOrder(i);319 if ( device == KDeviceType_Null)314 const KDeviceType enmDeviceType = comMachine.GetBootOrder(i); 315 if (enmDeviceType == KDeviceType_Null) 320 316 continue; 321 bootOrder << gpConverter->toString( device);317 bootOrder << gpConverter->toString(enmDeviceType); 322 318 } 323 319 if (bootOrder.isEmpty()) … … 326 322 327 323 /* Chipset type: */ 328 const KChipsetType enmChipsetType = machine.GetChipsetType();324 const KChipsetType enmChipsetType = comMachine.GetChipsetType(); 329 325 if (enmChipsetType == KChipsetType_ICH9) 330 326 table << UITextTableLine(QApplication::translate("UIDetails", "Chipset Type", "details (system)"), … … 332 328 333 329 /* Firware type: */ 334 switch ( machine.GetFirmwareType())330 switch (comMachine.GetFirmwareType()) 335 331 { 336 332 case KFirmwareType_EFI: … … 356 352 { 357 353 /* VT-x/AMD-V: */ 358 if ( machine.GetHWVirtExProperty(KHWVirtExPropertyType_Enabled))354 if (comMachine.GetHWVirtExProperty(KHWVirtExPropertyType_Enabled)) 359 355 { 360 356 acceleration << QApplication::translate("UIDetails", "VT-x/AMD-V", "details (system)"); 361 357 /* Nested Paging (only when hw virt is enabled): */ 362 if ( machine.GetHWVirtExProperty(KHWVirtExPropertyType_NestedPaging))358 if (comMachine.GetHWVirtExProperty(KHWVirtExPropertyType_NestedPaging)) 363 359 acceleration << QApplication::translate("UIDetails", "Nested Paging", "details (system)"); 364 360 } 365 361 } 366 if (machine.GetCPUProperty(KCPUPropertyType_PAE)) 362 /* PAE/NX: */ 363 if (comMachine.GetCPUProperty(KCPUPropertyType_PAE)) 367 364 acceleration << QApplication::translate("UIDetails", "PAE/NX", "details (system)"); 368 switch (machine.GetEffectiveParavirtProvider()) 365 /* Paravirtualization provider: */ 366 switch (comMachine.GetEffectiveParavirtProvider()) 369 367 { 370 368 case KParavirtProvider_Minimal: acceleration << QApplication::translate("UIDetails", "Minimal Paravirtualization", "details (system)"); break; … … 389 387 { 390 388 /* Acquire corresponding machine: */ 391 CMachine machine = property("machine").value<CMachine>();392 if ( machine.isNull())393 return; 394 395 /* Prepare table: */ 396 UITextTable table; 397 398 /* Gather information: */ 399 if ( machine.GetAccessible())389 CMachine comMachine = property("machine").value<CMachine>(); 390 if (comMachine.isNull()) 391 return; 392 393 /* Prepare table: */ 394 UITextTable table; 395 396 /* Gather information: */ 397 if (comMachine.GetAccessible()) 400 398 { 401 399 /* Video memory: */ 402 400 table << UITextTableLine(QApplication::translate("UIDetails", "Video Memory", "details (display)"), 403 QApplication::translate("UIDetails", "%1 MB", "details").arg( machine.GetVRAMSize()));401 QApplication::translate("UIDetails", "%1 MB", "details").arg(comMachine.GetVRAMSize())); 404 402 405 403 /* Screen count: */ 406 int cGuestScreens = machine.GetMonitorCount();404 const int cGuestScreens = comMachine.GetMonitorCount(); 407 405 if (cGuestScreens > 1) 408 406 table << UITextTableLine(QApplication::translate("UIDetails", "Screens", "details (display)"), 409 407 QString::number(cGuestScreens)); 410 408 411 /* Get scale-factor value: */412 const QString strScaleFactor = machine.GetExtraData(UIExtraDataDefs::GUI_ScaleFactor);409 /* Scale-factor: */ 410 const QString strScaleFactor = comMachine.GetExtraData(UIExtraDataDefs::GUI_ScaleFactor); 413 411 { 414 412 /* Try to convert loaded data to double: */ … … 424 422 } 425 423 424 /* Acceleration: */ 426 425 QStringList acceleration; 427 426 #ifdef VBOX_WITH_VIDEOHWACCEL 428 427 /* 2D acceleration: */ 429 if ( machine.GetAccelerate2DVideoEnabled())428 if (comMachine.GetAccelerate2DVideoEnabled()) 430 429 acceleration << QApplication::translate("UIDetails", "2D Video", "details (display)"); 431 #endif /* VBOX_WITH_VIDEOHWACCEL */430 #endif 432 431 /* 3D acceleration: */ 433 if ( machine.GetAccelerate3DEnabled())432 if (comMachine.GetAccelerate3DEnabled()) 434 433 acceleration << QApplication::translate("UIDetails", "3D", "details (display)"); 435 434 if (!acceleration.isEmpty()) … … 437 436 acceleration.join(", ")); 438 437 439 /* VRDE info: */440 CVRDEServer srv = machine.GetVRDEServer();441 if (! srv.isNull())442 { 443 if ( srv.GetEnabled())438 /* VRDE: */ 439 const CVRDEServer comServer = comMachine.GetVRDEServer(); 440 if (!comServer.isNull()) 441 { 442 if (comServer.GetEnabled()) 444 443 table << UITextTableLine(QApplication::translate("UIDetails", "Remote Desktop Server Port", "details (display/vrde)"), 445 srv.GetVRDEProperty("TCP/Ports"));444 comServer.GetVRDEProperty("TCP/Ports")); 446 445 else 447 446 table << UITextTableLine(QApplication::translate("UIDetails", "Remote Desktop Server", "details (display/vrde)"), … … 450 449 451 450 /* Recording info: */ 452 CRecordingSettings comRecordingSettings = machine.GetRecordingSettings();451 CRecordingSettings comRecordingSettings = comMachine.GetRecordingSettings(); 453 452 if (comRecordingSettings.GetEnabled()) 454 453 { 455 454 /* For now all screens have the same config: */ 456 CRecordingScreenSettings comRecordingScreen0Settings = comRecordingSettings.GetScreenSettings(0);455 const CRecordingScreenSettings comRecordingScreen0Settings = comRecordingSettings.GetScreenSettings(0); 457 456 458 457 /** @todo r=andy Refine these texts (wrt audio and/or video). */ … … 466 465 else 467 466 { 468 /** @todo r=andy Refine these texts (wrt audio and/or video). */469 467 table << UITextTableLine(QApplication::translate("UIDetails", "Recording", "details (display/recording)"), 470 468 QApplication::translate("UIDetails", "Disabled", "details (display/recording)")); … … 482 480 { 483 481 /* Acquire corresponding machine: */ 484 CMachine machine = property("machine").value<CMachine>();485 if ( machine.isNull())486 return; 487 488 /* Prepare table: */ 489 UITextTable table; 490 491 /* Gather information: */ 492 if ( machine.GetAccessible())482 CMachine comMachine = property("machine").value<CMachine>(); 483 if (comMachine.isNull()) 484 return; 485 486 /* Prepare table: */ 487 UITextTable table; 488 489 /* Gather information: */ 490 if (comMachine.GetAccessible()) 493 491 { 494 492 /* Iterate over all the machine controllers: */ 495 bool fSomeInfo = false; 496 foreach (const CStorageController &controller, machine.GetStorageControllers()) 493 foreach (const CStorageController &comController, comMachine.GetStorageControllers()) 497 494 { 498 495 /* Add controller information: */ 499 QString strControllerName = QApplication::translate("UIMachineSettingsStorage", "Controller: %1"); 500 table << UITextTableLine(strControllerName.arg(controller.GetName()), QString()); 501 fSomeInfo = true; 496 const QString strControllerName = QApplication::translate("UIMachineSettingsStorage", "Controller: %1"); 497 table << UITextTableLine(strControllerName.arg(comController.GetName()), QString()); 502 498 /* Populate map (its sorted!): */ 503 499 QMap<StorageSlot, QString> attachmentsMap; 504 foreach (const CMediumAttachment &attachment, machine.GetMediumAttachmentsOfController(controller.GetName()))500 foreach (const CMediumAttachment &attachment, comMachine.GetMediumAttachmentsOfController(comController.GetName())) 505 501 { 502 /* Acquire device type first of all: */ 503 const KDeviceType enmDeviceType = attachment.GetType(); 504 506 505 /* Prepare current storage slot: */ 507 StorageSlot attachmentSlot(controller.GetBus(), attachment.GetPort(), attachment.GetDevice());508 AssertMsg(co ntroller.isOk(),506 const StorageSlot attachmentSlot(comController.GetBus(), attachment.GetPort(), attachment.GetDevice()); 507 AssertMsg(comController.isOk(), 509 508 ("Unable to acquire controller data: %s\n", 510 UIErrorString::formatRC(co ntroller.lastRC()).toUtf8().constData()));511 if (!co ntroller.isOk())509 UIErrorString::formatRC(comController.lastRC()).toUtf8().constData())); 510 if (!comController.isOk()) 512 511 continue; 512 513 513 /* Prepare attachment information: */ 514 514 QString strAttachmentInfo = vboxGlobal().details(attachment.GetMedium(), false, false); 515 /* That temporaryhack makes sure 'Inaccessible' word is always bold: */515 /* That hack makes sure 'Inaccessible' word is always bold: */ 516 516 { // hack 517 QString strInaccessibleString(VBoxGlobal::tr("Inaccessible", "medium"));518 QString strBoldInaccessibleString(QString("<b>%1</b>").arg(strInaccessibleString));517 const QString strInaccessibleString(VBoxGlobal::tr("Inaccessible", "medium")); 518 const QString strBoldInaccessibleString(QString("<b>%1</b>").arg(strInaccessibleString)); 519 519 strAttachmentInfo.replace(strInaccessibleString, strBoldInaccessibleString); 520 520 } // hack 521 521 522 /* Append 'device slot name' with 'device type name' for optical devices only: */ 522 KDeviceType deviceType = attachment.GetType();523 QString strDeviceType = deviceType == KDeviceType_DVD ?524 QApplication::translate("UIDetails", "[Optical Drive]", "details (storage)"): QString();523 QString strDeviceType = enmDeviceType == KDeviceType_DVD 524 ? QApplication::translate("UIDetails", "[Optical Drive]", "details (storage)") 525 : QString(); 525 526 if (!strDeviceType.isNull()) 526 527 strDeviceType.append(' '); 528 527 529 /* Insert that attachment information into the map: */ 528 530 if (!strAttachmentInfo.isNull()) 529 531 { 530 532 /* Configure hovering anchors: */ 531 const QString strAnchorType = deviceType == KDeviceType_DVD || deviceType == KDeviceType_Floppy ? QString("mount") :532 deviceType == KDeviceType_HardDisk ? QString("attach") : QString();533 const QString strAnchorType = enmDeviceType == KDeviceType_DVD || enmDeviceType == KDeviceType_Floppy ? QString("mount") : 534 enmDeviceType == KDeviceType_HardDisk ? QString("attach") : QString(); 533 535 const CMedium medium = attachment.GetMedium(); 534 536 const QString strMediumLocation = medium.isNull() ? QString() : medium.GetLocation(); … … 536 538 QString("<a href=#%1,%2,%3,%4>%5</a>") 537 539 .arg(strAnchorType, 538 co ntroller.GetName(),540 comController.GetName(), 539 541 gpConverter->toString(attachmentSlot), 540 542 strMediumLocation, … … 542 544 } 543 545 } 546 544 547 /* Iterate over the sorted map: */ 545 QList<StorageSlot> storageSlots = attachmentsMap.keys();546 QList<QString> storageInfo = attachmentsMap.values();548 const QList<StorageSlot> storageSlots = attachmentsMap.keys(); 549 const QList<QString> storageInfo = attachmentsMap.values(); 547 550 for (int i = 0; i < storageSlots.size(); ++i) 548 551 table << UITextTableLine(QString(" ") + gpConverter->toString(storageSlots[i]), storageInfo[i]); 549 552 } 550 if ( !fSomeInfo)553 if (table.isEmpty()) 551 554 table << UITextTableLine(QApplication::translate("UIDetails", "Not Attached", "details (storage)"), QString()); 552 555 } … … 562 565 { 563 566 /* Acquire corresponding machine: */ 564 CMachine machine = property("machine").value<CMachine>();565 if ( machine.isNull())566 return; 567 568 /* Prepare table: */ 569 UITextTable table; 570 571 /* Gather information: */ 572 if ( machine.GetAccessible())573 { 574 const CAudioAdapter &audio = machine.GetAudioAdapter();575 if ( audio.GetEnabled())567 CMachine comMachine = property("machine").value<CMachine>(); 568 if (comMachine.isNull()) 569 return; 570 571 /* Prepare table: */ 572 UITextTable table; 573 574 /* Gather information: */ 575 if (comMachine.GetAccessible()) 576 { 577 const CAudioAdapter comAudio = comMachine.GetAudioAdapter(); 578 if (comAudio.GetEnabled()) 576 579 { 577 580 /* Driver: */ 578 581 table << UITextTableLine(QApplication::translate("UIDetails", "Host Driver", "details (audio)"), 579 gpConverter->toString( audio.GetAudioDriver()));582 gpConverter->toString(comAudio.GetAudioDriver())); 580 583 581 584 /* Controller: */ 582 585 table << UITextTableLine(QApplication::translate("UIDetails", "Controller", "details (audio)"), 583 gpConverter->toString( audio.GetAudioController()));586 gpConverter->toString(comAudio.GetAudioController())); 584 587 585 588 #ifdef VBOX_WITH_AUDIO_INOUT_INFO 586 /* Output: */589 /* I/O: */ 587 590 table << UITextTableLine(QApplication::translate("UIDetails", "Audio Output", "details (audio)"), 588 audio.GetEnabledOut() ?591 comAudio.GetEnabledOut() ? 589 592 QApplication::translate("UIDetails", "Enabled", "details (audio/output)") : 590 593 QApplication::translate("UIDetails", "Disabled", "details (audio/output)")); 591 592 /* Input: */593 594 table << UITextTableLine(QApplication::translate("UIDetails", "Audio Input", "details (audio)"), 594 audio.GetEnabledIn() ?595 comAudio.GetEnabledIn() ? 595 596 QApplication::translate("UIDetails", "Enabled", "details (audio/input)") : 596 597 QApplication::translate("UIDetails", "Disabled", "details (audio/input)")); … … 613 614 { 614 615 /* Acquire corresponding machine: */ 615 CMachine machine = property("machine").value<CMachine>();616 if ( machine.isNull())617 return; 618 619 /* Prepare table: */ 620 UITextTable table; 621 622 /* Gather information: */ 623 if ( machine.GetAccessible())616 CMachine comMachine = property("machine").value<CMachine>(); 617 if (comMachine.isNull()) 618 return; 619 620 /* Prepare table: */ 621 UITextTable table; 622 623 /* Gather information: */ 624 if (comMachine.GetAccessible()) 624 625 { 625 626 /* Iterate over all the adapters: */ 626 bool fSomeInfo = false; 627 ulong uCount = vboxGlobal().virtualBox().GetSystemProperties().GetMaxNetworkAdapters(machine.GetChipsetType()); 627 const ulong uCount = vboxGlobal().virtualBox().GetSystemProperties().GetMaxNetworkAdapters(comMachine.GetChipsetType()); 628 628 for (ulong uSlot = 0; uSlot < uCount; ++uSlot) 629 629 { 630 const CNetworkAdapter &adapter = machine.GetNetworkAdapter(uSlot); 631 if (adapter.GetEnabled()) 630 const CNetworkAdapter comAdapter = comMachine.GetNetworkAdapter(uSlot); 631 632 /* Skip disabled adapters: */ 633 if (!comAdapter.GetEnabled()) 634 continue; 635 636 /* Gather adapter information: */ 637 const KNetworkAttachmentType enmType = comAdapter.GetAttachmentType(); 638 const QString strAttachmentTemplate = gpConverter->toString(comAdapter.GetAdapterType()).replace(QRegExp("\\s\\(.+\\)"), " (%1)"); 639 QString strAttachmentType; 640 switch (enmType) 632 641 { 633 KNetworkAttachmentType type = adapter.GetAttachmentType(); 634 QString strAttachmentType = gpConverter->toString(adapter.GetAdapterType()) 635 .replace(QRegExp("\\s\\(.+\\)"), " (%1)"); 636 switch (type) 637 { 638 case KNetworkAttachmentType_Bridged: 639 { 640 strAttachmentType = strAttachmentType.arg(QApplication::translate("UIDetails", "Bridged Adapter, %1", "details (network)") 641 .arg(adapter.GetBridgedInterface())); 642 break; 643 } 644 case KNetworkAttachmentType_Internal: 645 { 646 strAttachmentType = strAttachmentType.arg(QApplication::translate("UIDetails", "Internal Network, '%1'", "details (network)") 647 .arg(adapter.GetInternalNetwork())); 648 break; 649 } 650 case KNetworkAttachmentType_HostOnly: 651 { 652 strAttachmentType = strAttachmentType.arg(QApplication::translate("UIDetails", "Host-only Adapter, '%1'", "details (network)") 653 .arg(adapter.GetHostOnlyInterface())); 654 break; 655 } 656 case KNetworkAttachmentType_Generic: 657 { 658 QString strGenericDriverProperties(summarizeGenericProperties(adapter)); 659 strAttachmentType = strGenericDriverProperties.isNull() ? 660 strAttachmentType.arg(QApplication::translate("UIDetails", "Generic Driver, '%1'", "details (network)").arg(adapter.GetGenericDriver())) : 661 strAttachmentType.arg(QApplication::translate("UIDetails", "Generic Driver, '%1' { %2 }", "details (network)") 662 .arg(adapter.GetGenericDriver(), strGenericDriverProperties)); 663 break; 664 } 665 case KNetworkAttachmentType_NATNetwork: 666 { 667 strAttachmentType = strAttachmentType.arg(QApplication::translate("UIDetails", "NAT Network, '%1'", "details (network)") 668 .arg(adapter.GetNATNetwork())); 669 break; 670 } 671 default: 672 { 673 strAttachmentType = strAttachmentType.arg(gpConverter->toString(type)); 674 break; 675 } 676 } 677 table << UITextTableLine(QApplication::translate("UIDetails", "Adapter %1", "details (network)").arg(adapter.GetSlot() + 1), strAttachmentType); 678 fSomeInfo = true; 642 case KNetworkAttachmentType_Bridged: 643 { 644 strAttachmentType = strAttachmentTemplate.arg(QApplication::translate("UIDetails", "Bridged Adapter, %1", "details (network)") 645 .arg(comAdapter.GetBridgedInterface())); 646 break; 647 } 648 case KNetworkAttachmentType_Internal: 649 { 650 strAttachmentType = strAttachmentTemplate.arg(QApplication::translate("UIDetails", "Internal Network, '%1'", "details (network)") 651 .arg(comAdapter.GetInternalNetwork())); 652 break; 653 } 654 case KNetworkAttachmentType_HostOnly: 655 { 656 strAttachmentType = strAttachmentTemplate.arg(QApplication::translate("UIDetails", "Host-only Adapter, '%1'", "details (network)") 657 .arg(comAdapter.GetHostOnlyInterface())); 658 break; 659 } 660 case KNetworkAttachmentType_Generic: 661 { 662 const QString strGenericDriverProperties(summarizeGenericProperties(comAdapter)); 663 strAttachmentType = strGenericDriverProperties.isNull() ? 664 strAttachmentTemplate.arg(QApplication::translate("UIDetails", "Generic Driver, '%1'", "details (network)") 665 .arg(comAdapter.GetGenericDriver())) : 666 strAttachmentTemplate.arg(QApplication::translate("UIDetails", "Generic Driver, '%1' { %2 }", "details (network)") 667 .arg(comAdapter.GetGenericDriver(), strGenericDriverProperties)); 668 break; 669 } 670 case KNetworkAttachmentType_NATNetwork: 671 { 672 strAttachmentType = strAttachmentTemplate.arg(QApplication::translate("UIDetails", "NAT Network, '%1'", "details (network)") 673 .arg(comAdapter.GetNATNetwork())); 674 break; 675 } 676 default: 677 { 678 strAttachmentType = strAttachmentTemplate.arg(gpConverter->toString(enmType)); 679 break; 680 } 679 681 } 680 } 681 if (!fSomeInfo) 682 if (!strAttachmentType.isNull()) 683 table << UITextTableLine(QApplication::translate("UIDetails", "Adapter %1", "details (network)").arg(comAdapter.GetSlot() + 1), strAttachmentType); 684 } 685 if (table.isEmpty()) 682 686 table << UITextTableLine(QApplication::translate("UIDetails", "Disabled", "details (network/adapter)"), QString()); 683 687 } … … 709 713 { 710 714 /* Acquire corresponding machine: */ 711 CMachine machine = property("machine").value<CMachine>();712 if ( machine.isNull())713 return; 714 715 /* Prepare table: */ 716 UITextTable table; 717 718 /* Gather information: */ 719 if ( machine.GetAccessible())715 CMachine comMachine = property("machine").value<CMachine>(); 716 if (comMachine.isNull()) 717 return; 718 719 /* Prepare table: */ 720 UITextTable table; 721 722 /* Gather information: */ 723 if (comMachine.GetAccessible()) 720 724 { 721 725 /* Iterate over all the ports: */ 722 bool fSomeInfo = false; 723 ulong uCount = vboxGlobal().virtualBox().GetSystemProperties().GetSerialPortCount(); 726 const ulong uCount = vboxGlobal().virtualBox().GetSystemProperties().GetSerialPortCount(); 724 727 for (ulong uSlot = 0; uSlot < uCount; ++uSlot) 725 728 { 726 const CSerialPort &port = machine.GetSerialPort(uSlot); 727 if (port.GetEnabled()) 729 const CSerialPort comPort = comMachine.GetSerialPort(uSlot); 730 731 /* Skip disabled adapters: */ 732 if (!comPort.GetEnabled()) 733 continue; 734 735 /* Gather port information: */ 736 const KPortMode enmMode = comPort.GetHostMode(); 737 const QString strModeTemplate = vboxGlobal().toCOMPortName(comPort.GetIRQ(), comPort.GetIOBase()) + ", "; 738 QString strModeType; 739 switch (enmMode) 728 740 { 729 KPortMode mode = port.GetHostMode(); 730 QString data = vboxGlobal().toCOMPortName(port.GetIRQ(), port.GetIOBase()) + ", "; 731 if (mode == KPortMode_HostPipe || mode == KPortMode_HostDevice || 732 mode == KPortMode_RawFile || mode == KPortMode_TCP) 733 data += QString("%1 (%2)").arg(gpConverter->toString(mode)).arg(QDir::toNativeSeparators(port.GetPath())); 734 else 735 data += gpConverter->toString(mode); 736 table << UITextTableLine(QApplication::translate("UIDetails", "Port %1", "details (serial)").arg(port.GetSlot() + 1), data); 737 fSomeInfo = true; 741 case KPortMode_HostPipe: 742 { 743 strModeType = strModeTemplate + QString("%1 (%2)").arg(gpConverter->toString(enmMode)).arg(QDir::toNativeSeparators(comPort.GetPath())); 744 break; 745 } 746 case KPortMode_HostDevice: 747 { 748 strModeType = strModeTemplate + QString("%1 (%2)").arg(gpConverter->toString(enmMode)).arg(QDir::toNativeSeparators(comPort.GetPath())); 749 break; 750 } 751 case KPortMode_RawFile: 752 { 753 strModeType = strModeTemplate + QString("%1 (%2)").arg(gpConverter->toString(enmMode)).arg(QDir::toNativeSeparators(comPort.GetPath())); 754 break; 755 } 756 case KPortMode_TCP: 757 { 758 strModeType = strModeTemplate + QString("%1 (%2)").arg(gpConverter->toString(enmMode)).arg(QDir::toNativeSeparators(comPort.GetPath())); 759 break; 760 } 761 default: 762 { 763 strModeType = strModeTemplate + gpConverter->toString(enmMode); 764 break; 765 } 738 766 } 739 } 740 if (!fSomeInfo) 767 if (!strModeType.isNull()) 768 table << UITextTableLine(QApplication::translate("UIDetails", "Port %1", "details (serial)").arg(comPort.GetSlot() + 1), strModeType); 769 } 770 if (table.isEmpty()) 741 771 table << UITextTableLine(QApplication::translate("UIDetails", "Disabled", "details (serial)"), QString()); 742 772 } … … 752 782 { 753 783 /* Acquire corresponding machine: */ 754 CMachine machine = property("machine").value<CMachine>();755 if ( machine.isNull())756 return; 757 758 /* Prepare table: */ 759 UITextTable table; 760 761 /* Gather information: */ 762 if ( machine.GetAccessible())784 CMachine comMachine = property("machine").value<CMachine>(); 785 if (comMachine.isNull()) 786 return; 787 788 /* Prepare table: */ 789 UITextTable table; 790 791 /* Gather information: */ 792 if (comMachine.GetAccessible()) 763 793 { 764 794 /* Iterate over all the USB filters: */ 765 const CUSBDeviceFilters &filters = machine.GetUSBDeviceFilters(); 766 if (!filters.isNull() && machine.GetUSBProxyAvailable()) 767 { 768 const CUSBDeviceFilters flts = machine.GetUSBDeviceFilters(); 769 const CUSBControllerVector controllers = machine.GetUSBControllers(); 770 if (!flts.isNull() && !controllers.isEmpty()) 795 const CUSBDeviceFilters comFilterObject = comMachine.GetUSBDeviceFilters(); 796 if (!comFilterObject.isNull() && comMachine.GetUSBProxyAvailable()) 797 { 798 const CUSBControllerVector controllers = comMachine.GetUSBControllers(); 799 if (!controllers.isEmpty()) 771 800 { 772 /* USB Controllers info: */773 QStringList controller List;774 foreach (const CUSBController &co ntroller, controllers)775 controller List << gpConverter->toString(controller.GetType());801 /* Controllers: */ 802 QStringList controllersReadable; 803 foreach (const CUSBController &comController, controllers) 804 controllersReadable << gpConverter->toString(comController.GetType()); 776 805 table << UITextTableLine(QApplication::translate("UIDetails", "USB Controller", "details (usb)"), 777 controllerList.join(", ")); 778 /* USB Device Filters info: */ 779 const CUSBDeviceFilterVector &coll = flts.GetDeviceFilters(); 806 controllersReadable.join(", ")); 807 808 /* Device Filters: */ 809 const CUSBDeviceFilterVector filters = comFilterObject.GetDeviceFilters(); 780 810 uint uActive = 0; 781 for (int i = 0; i < coll.size(); ++i)782 if ( coll[i].GetActive())811 for (int i = 0; i < filters.size(); ++i) 812 if (filters.at(i).GetActive()) 783 813 ++uActive; 784 814 table << UITextTableLine(QApplication::translate("UIDetails", "Device Filters", "details (usb)"), 785 QApplication::translate("UIDetails", "%1 (%2 active)", "details (usb)").arg( coll.size()).arg(uActive));815 QApplication::translate("UIDetails", "%1 (%2 active)", "details (usb)").arg(filters.size()).arg(uActive)); 786 816 } 787 817 else … … 802 832 { 803 833 /* Acquire corresponding machine: */ 804 CMachine machine = property("machine").value<CMachine>();805 if ( machine.isNull())806 return; 807 808 /* Prepare table: */ 809 UITextTable table; 810 811 /* Gather information: */ 812 if ( machine.GetAccessible())813 { 814 /* Iterate over all the shared folders: */815 ulong uCount = machine.GetSharedFolders().size();834 CMachine comMachine = property("machine").value<CMachine>(); 835 if (comMachine.isNull()) 836 return; 837 838 /* Prepare table: */ 839 UITextTable table; 840 841 /* Gather information: */ 842 if (comMachine.GetAccessible()) 843 { 844 /* Summary: */ 845 const ulong uCount = comMachine.GetSharedFolders().size(); 816 846 if (uCount > 0) 817 847 table << UITextTableLine(QApplication::translate("UIDetails", "Shared Folders", "details (shared folders)"), QString::number(uCount)); … … 830 860 { 831 861 /* Acquire corresponding machine: */ 832 CMachine machine = property("machine").value<CMachine>();833 if ( machine.isNull())834 return; 835 836 /* Prepare table: */ 837 UITextTable table; 838 839 /* Gather information: */ 840 if ( machine.GetAccessible())862 CMachine comMachine = property("machine").value<CMachine>(); 863 if (comMachine.isNull()) 864 return; 865 866 /* Prepare table: */ 867 UITextTable table; 868 869 /* Gather information: */ 870 if (comMachine.GetAccessible()) 841 871 { 842 872 #ifndef VBOX_WS_MAC 843 /* Get menu-bar availability status: */844 const QString strMenubarEnabled = machine.GetExtraData(UIExtraDataDefs::GUI_MenuBar_Enabled);873 /* Menu-bar: */ 874 const QString strMenubarEnabled = comMachine.GetExtraData(UIExtraDataDefs::GUI_MenuBar_Enabled); 845 875 { 846 876 /* Try to convert loaded data to bool: */ 847 const bool fEnabled = !( strMenubarEnabled.compare("false", Qt::CaseInsensitive) == 0 ||848 strMenubarEnabled.compare("no", Qt::CaseInsensitive) == 0 ||849 strMenubarEnabled.compare("off", Qt::CaseInsensitive) == 0 ||850 strMenubarEnabled == "0");877 const bool fEnabled = !( strMenubarEnabled.compare("false", Qt::CaseInsensitive) == 0 878 || strMenubarEnabled.compare("no", Qt::CaseInsensitive) == 0 879 || strMenubarEnabled.compare("off", Qt::CaseInsensitive) == 0 880 || strMenubarEnabled == "0"); 851 881 /* Append information: */ 852 882 table << UITextTableLine(QApplication::translate("UIDetails", "Menu-bar", "details (user interface)"), 853 fEnabled ? QApplication::translate("UIDetails", "Enabled", "details (user interface/menu-bar)") :854 883 fEnabled ? QApplication::translate("UIDetails", "Enabled", "details (user interface/menu-bar)") 884 : QApplication::translate("UIDetails", "Disabled", "details (user interface/menu-bar)")); 855 885 } 856 886 #endif /* !VBOX_WS_MAC */ 857 887 858 /* Get status-bar availability status: */859 const QString strStatusbarEnabled = machine.GetExtraData(UIExtraDataDefs::GUI_StatusBar_Enabled);888 /* Status-bar: */ 889 const QString strStatusbarEnabled = comMachine.GetExtraData(UIExtraDataDefs::GUI_StatusBar_Enabled); 860 890 { 861 891 /* Try to convert loaded data to bool: */ 862 const bool fEnabled = !( strStatusbarEnabled.compare("false", Qt::CaseInsensitive) == 0 ||863 strStatusbarEnabled.compare("no", Qt::CaseInsensitive) == 0 ||864 strStatusbarEnabled.compare("off", Qt::CaseInsensitive) == 0 ||865 strStatusbarEnabled == "0");892 const bool fEnabled = !( strStatusbarEnabled.compare("false", Qt::CaseInsensitive) == 0 893 || strStatusbarEnabled.compare("no", Qt::CaseInsensitive) == 0 894 || strStatusbarEnabled.compare("off", Qt::CaseInsensitive) == 0 895 || strStatusbarEnabled == "0"); 866 896 /* Append information: */ 867 897 table << UITextTableLine(QApplication::translate("UIDetails", "Status-bar", "details (user interface)"), 868 fEnabled ? QApplication::translate("UIDetails", "Enabled", "details (user interface/status-bar)") :869 898 fEnabled ? QApplication::translate("UIDetails", "Enabled", "details (user interface/status-bar)") 899 : QApplication::translate("UIDetails", "Disabled", "details (user interface/status-bar)")); 870 900 } 871 901 872 902 #ifndef VBOX_WS_MAC 873 /* Get mini-toolbar availability status: */874 const QString strMiniToolbarEnabled = machine.GetExtraData(UIExtraDataDefs::GUI_ShowMiniToolBar);903 /* Mini-toolbar: */ 904 const QString strMiniToolbarEnabled = comMachine.GetExtraData(UIExtraDataDefs::GUI_ShowMiniToolBar); 875 905 { 876 906 /* Try to convert loaded data to bool: */ 877 const bool fEnabled = !( strMiniToolbarEnabled.compare("false", Qt::CaseInsensitive) == 0 ||878 strMiniToolbarEnabled.compare("no", Qt::CaseInsensitive) == 0 ||879 strMiniToolbarEnabled.compare("off", Qt::CaseInsensitive) == 0 ||880 strMiniToolbarEnabled == "0");907 const bool fEnabled = !( strMiniToolbarEnabled.compare("false", Qt::CaseInsensitive) == 0 908 || strMiniToolbarEnabled.compare("no", Qt::CaseInsensitive) == 0 909 || strMiniToolbarEnabled.compare("off", Qt::CaseInsensitive) == 0 910 || strMiniToolbarEnabled == "0"); 881 911 /* Append information: */ 882 912 if (fEnabled) 883 913 { 884 914 /* Get mini-toolbar position: */ 885 const QString &strMiniToolbarPosition = machine.GetExtraData(UIExtraDataDefs::GUI_MiniToolBarAlignment);915 const QString strMiniToolbarPosition = comMachine.GetExtraData(UIExtraDataDefs::GUI_MiniToolBarAlignment); 886 916 { 887 917 /* Try to convert loaded data to alignment: */ … … 929 959 if (machine.GetAccessible()) 930 960 { 931 /* Get description: */932 const QString &strDesc= machine.GetDescription();933 if (!strDesc .isEmpty())934 table << UITextTableLine(strDesc , QString());961 /* Summary: */ 962 const QString strDescription = machine.GetDescription(); 963 if (!strDescription.isEmpty()) 964 table << UITextTableLine(strDescription, QString()); 935 965 else 936 966 table << UITextTableLine(QApplication::translate("UIDetails", "None", "details (description)"), QString()); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetailsElements.h
r74049 r75426 5 5 6 6 /* 7 * Copyright (C) 2012-201 7Oracle Corporation7 * Copyright (C) 2012-2018 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 35 35 public: 36 36 37 /** Constructs update task taking @a machine as data. */38 UIDetailsUpdateTask(const CMachine & machine);37 /** Constructs update task taking @a comMachine as data. */ 38 UIDetailsUpdateTask(const CMachine &comMachine); 39 39 }; 40 40 … … 61 61 62 62 /** Creates update task. */ 63 virtual UITask *createUpdateTask() = 0;63 virtual UITask *createUpdateTask() = 0; 64 64 65 65 private slots: … … 120 120 public: 121 121 122 /** Constructs update task passing @a machine to the base-class. */123 UIDetailsUpdateTaskGeneral(const CMachine & machine)124 : UIDetailsUpdateTask( machine) {}122 /** Constructs update task passing @a comMachine to the base-class. */ 123 UIDetailsUpdateTaskGeneral(const CMachine &comMachine) 124 : UIDetailsUpdateTask(comMachine) {} 125 125 126 126 private: … … 145 145 146 146 /** Creates update task for this element. */ 147 UITask *createUpdateTask() { return new UIDetailsUpdateTaskGeneral(machine()); }147 UITask *createUpdateTask() { return new UIDetailsUpdateTaskGeneral(machine()); } 148 148 }; 149 149 … … 156 156 public: 157 157 158 /** Constructs update task passing @a machine to the base-class. */159 UIDetailsUpdateTaskSystem(const CMachine & machine)160 : UIDetailsUpdateTask( machine) {}158 /** Constructs update task passing @a comMachine to the base-class. */ 159 UIDetailsUpdateTaskSystem(const CMachine &comMachine) 160 : UIDetailsUpdateTask(comMachine) {} 161 161 162 162 private: … … 181 181 182 182 /** Creates update task for this element. */ 183 UITask *createUpdateTask() { return new UIDetailsUpdateTaskSystem(machine()); }183 UITask *createUpdateTask() { return new UIDetailsUpdateTaskSystem(machine()); } 184 184 }; 185 185 … … 192 192 public: 193 193 194 /** Constructs update task passing @a machine to the base-class. */195 UIDetailsUpdateTaskDisplay(const CMachine & machine)196 : UIDetailsUpdateTask( machine) {}194 /** Constructs update task passing @a comMachine to the base-class. */ 195 UIDetailsUpdateTaskDisplay(const CMachine &comMachine) 196 : UIDetailsUpdateTask(comMachine) {} 197 197 198 198 private: … … 217 217 218 218 /** Creates update task for this element. */ 219 UITask *createUpdateTask() { return new UIDetailsUpdateTaskDisplay(machine()); }219 UITask *createUpdateTask() { return new UIDetailsUpdateTaskDisplay(machine()); } 220 220 }; 221 221 … … 228 228 public: 229 229 230 /** Constructs update task passing @a machine to the base-class. */231 UIDetailsUpdateTaskStorage(const CMachine & machine)232 : UIDetailsUpdateTask( machine) {}230 /** Constructs update task passing @a comMachine to the base-class. */ 231 UIDetailsUpdateTaskStorage(const CMachine &comMachine) 232 : UIDetailsUpdateTask(comMachine) {} 233 233 234 234 private: … … 253 253 254 254 /** Creates update task for this element. */ 255 UITask *createUpdateTask() { return new UIDetailsUpdateTaskStorage(machine()); }255 UITask *createUpdateTask() { return new UIDetailsUpdateTaskStorage(machine()); } 256 256 }; 257 257 … … 264 264 public: 265 265 266 /** Constructs update task passing @a machine to the base-class. */267 UIDetailsUpdateTaskAudio(const CMachine & machine)268 : UIDetailsUpdateTask( machine) {}266 /** Constructs update task passing @a comMachine to the base-class. */ 267 UIDetailsUpdateTaskAudio(const CMachine &comMachine) 268 : UIDetailsUpdateTask(comMachine) {} 269 269 270 270 private: … … 289 289 290 290 /** Creates update task for this element. */ 291 UITask *createUpdateTask() { return new UIDetailsUpdateTaskAudio(machine()); }291 UITask *createUpdateTask() { return new UIDetailsUpdateTaskAudio(machine()); } 292 292 }; 293 293 … … 300 300 public: 301 301 302 /** Constructs update task passing @a machine to the base-class. */303 UIDetailsUpdateTaskNetwork(const CMachine & machine)304 : UIDetailsUpdateTask( machine) {}302 /** Constructs update task passing @a comMachine to the base-class. */ 303 UIDetailsUpdateTaskNetwork(const CMachine &comMachine) 304 : UIDetailsUpdateTask(comMachine) {} 305 305 306 306 private: … … 328 328 329 329 /** Creates update task for this element. */ 330 UITask *createUpdateTask() { return new UIDetailsUpdateTaskNetwork(machine()); }330 UITask *createUpdateTask() { return new UIDetailsUpdateTaskNetwork(machine()); } 331 331 }; 332 332 … … 339 339 public: 340 340 341 /** Constructs update task passing @a machine to the base-class. */342 UIDetailsUpdateTaskSerial(const CMachine & machine)343 : UIDetailsUpdateTask( machine) {}341 /** Constructs update task passing @a comMachine to the base-class. */ 342 UIDetailsUpdateTaskSerial(const CMachine &comMachine) 343 : UIDetailsUpdateTask(comMachine) {} 344 344 345 345 private: … … 364 364 365 365 /** Creates update task for this element. */ 366 UITask *createUpdateTask() { return new UIDetailsUpdateTaskSerial(machine()); }366 UITask *createUpdateTask() { return new UIDetailsUpdateTaskSerial(machine()); } 367 367 }; 368 368 … … 375 375 public: 376 376 377 /** Constructs update task passing @a machine to the base-class. */378 UIDetailsUpdateTaskUSB(const CMachine & machine)379 : UIDetailsUpdateTask( machine) {}377 /** Constructs update task passing @a comMachine to the base-class. */ 378 UIDetailsUpdateTaskUSB(const CMachine &comMachine) 379 : UIDetailsUpdateTask(comMachine) {} 380 380 381 381 private: … … 400 400 401 401 /** Creates update task for this element. */ 402 UITask *createUpdateTask() { return new UIDetailsUpdateTaskUSB(machine()); }402 UITask *createUpdateTask() { return new UIDetailsUpdateTaskUSB(machine()); } 403 403 }; 404 404 … … 411 411 public: 412 412 413 /** Constructs update task passing @a machine to the base-class. */414 UIDetailsUpdateTaskSF(const CMachine & machine)415 : UIDetailsUpdateTask( machine) {}413 /** Constructs update task passing @a comMachine to the base-class. */ 414 UIDetailsUpdateTaskSF(const CMachine &comMachine) 415 : UIDetailsUpdateTask(comMachine) {} 416 416 417 417 private: … … 436 436 437 437 /** Creates update task for this element. */ 438 UITask *createUpdateTask() { return new UIDetailsUpdateTaskSF(machine()); }438 UITask *createUpdateTask() { return new UIDetailsUpdateTaskSF(machine()); } 439 439 }; 440 440 … … 447 447 public: 448 448 449 /** Constructs update task passing @a machine to the base-class. */450 UIDetailsUpdateTaskUI(const CMachine & machine)451 : UIDetailsUpdateTask( machine) {}449 /** Constructs update task passing @a comMachine to the base-class. */ 450 UIDetailsUpdateTaskUI(const CMachine &comMachine) 451 : UIDetailsUpdateTask(comMachine) {} 452 452 453 453 private: … … 472 472 473 473 /** Creates update task for this element. */ 474 UITask *createUpdateTask() { return new UIDetailsUpdateTaskUI(machine()); }474 UITask *createUpdateTask() { return new UIDetailsUpdateTaskUI(machine()); } 475 475 }; 476 476 … … 483 483 public: 484 484 485 /** Constructs update task passing @a machine to the base-class. */486 UIDetailsUpdateTaskDescription(const CMachine & machine)487 : UIDetailsUpdateTask( machine) {}485 /** Constructs update task passing @a comMachine to the base-class. */ 486 UIDetailsUpdateTaskDescription(const CMachine &comMachine) 487 : UIDetailsUpdateTask(comMachine) {} 488 488 489 489 private: … … 508 508 509 509 /** Creates update task for this element. */ 510 UITask *createUpdateTask() { return new UIDetailsUpdateTaskDescription(machine()); }510 UITask *createUpdateTask() { return new UIDetailsUpdateTaskDescription(machine()); } 511 511 }; 512 512
Note:
See TracChangeset
for help on using the changeset viewer.