Changeset 57672 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Sep 9, 2015 3:47:37 PM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIThreadPool.h
r57667 r57672 128 128 { 129 129 Type_MediumEnumeration = 1, 130 Type_DetailsPopulation = 2, 130 131 }; 131 132 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElements.cpp
r57670 r57672 21 21 22 22 /* Qt includes: */ 23 # include <QDir> 23 24 # include <QTimer> 24 # include <Q Dir>25 # include <QGraphicsLinearLayout> 25 26 26 27 /* GUI includes: */ … … 36 37 37 38 /* COM includes: */ 39 # include "COMEnums.h" 40 # include "CMachine.h" 38 41 # include "CSystemProperties.h" 39 42 # include "CVRDEServer.h" … … 52 55 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */ 53 56 54 #include <QGraphicsLinearLayout> 55 56 57 UIGDetailsUpdateThread::UIGDetailsUpdateThread(const CMachine &machine) 58 : m_machine(machine) 59 { 60 qRegisterMetaType<UITextTable>(); 57 58 UIGDetailsUpdateTask::UIGDetailsUpdateTask(const CMachine &machine) 59 : UITask(UITask::Type_DetailsPopulation) 60 { 61 /* Store machine as property: */ 62 setProperty("machine", QVariant::fromValue(machine)); 61 63 } 62 64 63 65 UIGDetailsElementInterface::UIGDetailsElementInterface(UIGDetailsSet *pParent, DetailsElementType type, bool fOpened) 64 66 : UIGDetailsElement(pParent, type, fOpened) 65 , m_pT hread(0)67 , m_pTask(0) 66 68 { 67 69 /* Assign corresponding icon: */ 68 70 setIcon(gpConverter->toIcon(elementType())); 69 71 72 /* Listen for the global thread-pool: */ 73 connect(vboxGlobal().threadPool(), SIGNAL(sigTaskComplete(UITask*)), 74 this, SLOT(sltUpdateAppearanceFinished(UITask*))); 75 70 76 /* Translate finally: */ 71 77 retranslateUi(); 72 78 } 73 79 74 UIGDetailsElementInterface::~UIGDetailsElementInterface()75 {76 cleanupThread();77 }78 79 80 void UIGDetailsElementInterface::retranslateUi() 80 81 { … … 85 86 void UIGDetailsElementInterface::updateAppearance() 86 87 { 87 /* Call for baseclass: */88 /* Call to base-class: */ 88 89 UIGDetailsElement::updateAppearance(); 89 90 90 /* Create/start update thread in necessary: */ 91 if (!m_pThread) 92 { 93 m_pThread = createUpdateThread(); 94 connect(m_pThread, SIGNAL(sigComplete(const UITextTable&)), 95 this, SLOT(sltUpdateAppearanceFinished(const UITextTable&))); 96 m_pThread->start(); 97 } 98 } 99 100 void UIGDetailsElementInterface::sltUpdateAppearanceFinished(const UITextTable &newText) 101 { 91 /* Prepare/start update task: */ 92 if (!m_pTask) 93 { 94 /* Prepare update task: */ 95 m_pTask = createUpdateTask(); 96 /* Post task into global thread-pool: */ 97 vboxGlobal().threadPool()->enqueueTask(m_pTask); 98 } 99 } 100 101 void UIGDetailsElementInterface::sltUpdateAppearanceFinished(UITask *pTask) 102 { 103 /* Make sure that is one of our tasks: */ 104 if (pTask->type() != UITask::Type_DetailsPopulation) 105 return; 106 107 /* Skip unrelated tasks: */ 108 if (m_pTask != pTask) 109 return; 110 111 /* Assign new text if changed: */ 112 const UITextTable newText = pTask->property("table").value<UITextTable>(); 102 113 if (text() != newText) 103 114 setText(newText); 104 cleanupThread(); 115 116 /* Mark task processed: */ 117 m_pTask = 0; 118 119 /* Notify listeners about update task complete: */ 105 120 emit sigBuildDone(); 106 }107 108 void UIGDetailsElementInterface::cleanupThread()109 {110 if (m_pThread)111 {112 m_pThread->wait();113 delete m_pThread;114 m_pThread = 0;115 }116 121 } 117 122 … … 120 125 : UIGDetailsElement(pParent, DetailsElementType_Preview, fOpened) 121 126 { 122 /* Icon: */ 123 setIcon(UIIconPool::iconSet(":/machine_16px.png")); 124 125 /* Prepare variables: */ 126 int iMargin = data(ElementData_Margin).toInt(); 127 /* Prepare layout: */ 127 /* Assign corresponding icon: */ 128 setIcon(gpConverter->toIcon(elementType())); 129 130 /* Create layout: */ 128 131 QGraphicsLinearLayout *pLayout = new QGraphicsLinearLayout; 129 pLayout->setContentsMargins(iMargin, 2 * iMargin + minimumHeaderHeight(), iMargin, iMargin); 130 setLayout(pLayout); 131 132 /* Create preview: */ 133 m_pPreview = new UIGMachinePreview(this); 134 connect(m_pPreview, SIGNAL(sigSizeHintChanged()), 135 this, SLOT(sltPreviewSizeHintChanged())); 136 pLayout->addItem(m_pPreview); 132 AssertPtr(pLayout); 133 { 134 /* Prepare layout: */ 135 const int iMargin = data(ElementData_Margin).toInt(); 136 pLayout->setContentsMargins(iMargin, 2 * iMargin + minimumHeaderHeight(), iMargin, iMargin); 137 /* Assign layout to widget: */ 138 setLayout(pLayout); 139 /* Create preview: */ 140 m_pPreview = new UIGMachinePreview(this); 141 AssertPtr(m_pPreview); 142 { 143 /* Prepare preview: */ 144 connect(m_pPreview, SIGNAL(sigSizeHintChanged()), 145 this, SLOT(sltPreviewSizeHintChanged())); 146 /* Add preview into layout: */ 147 pLayout->addItem(m_pPreview); 148 } 149 } 150 151 /* Set fixed size policy finally (after all content constructed): */ 137 152 setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); 138 153 … … 218 233 void UIGDetailsElementPreview::updateAppearance() 219 234 { 220 /* Call for baseclass: */235 /* Call to base-class: */ 221 236 UIGDetailsElement::updateAppearance(); 222 237 223 /* Set new machine attribute : */238 /* Set new machine attribute directly: */ 224 239 m_pPreview->setMachine(machine()); 225 240 emit sigBuildDone(); … … 227 242 228 243 229 void UIGDetailsUpdateThreadGeneral::run() 230 { 231 COMBase::InitializeCOM(false); 232 233 if (!machine().isNull()) 234 { 235 /* Prepare table: */ 236 UITextTable m_text; 237 238 /* Gather information: */ 239 if (machine().GetAccessible()) 240 { 241 /* Machine name: */ 242 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Name", "details (general)"), machine().GetName()); 243 244 /* Operating system type: */ 245 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Operating System", "details (general)"), 246 vboxGlobal().vmGuestOSTypeDescription(machine().GetOSTypeId())); 247 248 /* Get groups: */ 249 QStringList groups = machine().GetGroups().toList(); 250 /* Do not show groups for machine which is in root group only: */ 251 if (groups.size() == 1) 252 groups.removeAll("/"); 253 /* If group list still not empty: */ 254 if (!groups.isEmpty()) 244 void UIGDetailsUpdateTaskGeneral::run() 245 { 246 /* Acquire corresponding machine: */ 247 CMachine machine = property("machine").value<CMachine>(); 248 if (machine.isNull()) 249 return; 250 251 /* Prepare table: */ 252 UITextTable table; 253 254 /* Gather information: */ 255 if (machine.GetAccessible()) 256 { 257 /* Machine name: */ 258 table << UITextTableLine(QApplication::translate("UIGDetails", "Name", "details (general)"), machine.GetName()); 259 260 /* Operating system type: */ 261 table << UITextTableLine(QApplication::translate("UIGDetails", "Operating System", "details (general)"), 262 vboxGlobal().vmGuestOSTypeDescription(machine.GetOSTypeId())); 263 264 /* Get groups: */ 265 QStringList groups = machine.GetGroups().toList(); 266 /* Do not show groups for machine which is in root group only: */ 267 if (groups.size() == 1) 268 groups.removeAll("/"); 269 /* If group list still not empty: */ 270 if (!groups.isEmpty()) 271 { 272 /* For every group: */ 273 for (int i = 0; i < groups.size(); ++i) 255 274 { 256 /* For every group: */ 257 for (int i = 0; i < groups.size(); ++i) 275 /* Trim first '/' symbol: */ 276 QString &strGroup = groups[i]; 277 if (strGroup.startsWith("/") && strGroup != "/") 278 strGroup.remove(0, 1); 279 } 280 table << UITextTableLine(QApplication::translate("UIGDetails", "Groups", "details (general)"), groups.join(", ")); 281 } 282 } 283 else 284 table << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), QString()); 285 286 /* Save the table as property: */ 287 setProperty("table", QVariant::fromValue(table)); 288 } 289 290 291 void UIGDetailsUpdateTaskSystem::run() 292 { 293 /* Acquire corresponding machine: */ 294 CMachine machine = property("machine").value<CMachine>(); 295 if (machine.isNull()) 296 return; 297 298 /* Prepare table: */ 299 UITextTable table; 300 301 /* Gather information: */ 302 if (machine.GetAccessible()) 303 { 304 /* Base memory: */ 305 table << UITextTableLine(QApplication::translate("UIGDetails", "Base Memory", "details (system)"), 306 QApplication::translate("UIGDetails", "%1 MB", "details").arg(machine.GetMemorySize())); 307 308 /* CPU count: */ 309 int cCPU = machine.GetCPUCount(); 310 if (cCPU > 1) 311 table << UITextTableLine(QApplication::translate("UIGDetails", "Processors", "details (system)"), 312 QString::number(cCPU)); 313 314 /* CPU execution cap: */ 315 int iCPUExecCap = machine.GetCPUExecutionCap(); 316 if (iCPUExecCap < 100) 317 table << UITextTableLine(QApplication::translate("UIGDetails", "Execution Cap", "details (system)"), 318 QApplication::translate("UIGDetails", "%1%", "details").arg(iCPUExecCap)); 319 320 /* Boot-order: */ 321 QStringList bootOrder; 322 for (ulong i = 1; i <= vboxGlobal().virtualBox().GetSystemProperties().GetMaxBootPosition(); ++i) 323 { 324 KDeviceType device = machine.GetBootOrder(i); 325 if (device == KDeviceType_Null) 326 continue; 327 bootOrder << gpConverter->toString(device); 328 } 329 if (bootOrder.isEmpty()) 330 bootOrder << gpConverter->toString(KDeviceType_Null); 331 table << UITextTableLine(QApplication::translate("UIGDetails", "Boot Order", "details (system)"), bootOrder.join(", ")); 332 333 /* Acceleration: */ 334 QStringList acceleration; 335 if (vboxGlobal().virtualBox().GetHost().GetProcessorFeature(KProcessorFeature_HWVirtEx)) 336 { 337 /* VT-x/AMD-V: */ 338 if (machine.GetHWVirtExProperty(KHWVirtExPropertyType_Enabled)) 339 { 340 acceleration << QApplication::translate("UIGDetails", "VT-x/AMD-V", "details (system)"); 341 /* Nested Paging (only when hw virt is enabled): */ 342 if (machine.GetHWVirtExProperty(KHWVirtExPropertyType_NestedPaging)) 343 acceleration << QApplication::translate("UIGDetails", "Nested Paging", "details (system)"); 344 } 345 } 346 if (machine.GetCPUProperty(KCPUPropertyType_PAE)) 347 acceleration << QApplication::translate("UIGDetails", "PAE/NX", "details (system)"); 348 switch (machine.GetEffectiveParavirtProvider()) 349 { 350 case KParavirtProvider_Minimal: acceleration << QApplication::translate("UIGDetails", "Minimal Paravirtualization", "details (system)"); break; 351 case KParavirtProvider_HyperV: acceleration << QApplication::translate("UIGDetails", "Hyper-V Paravirtualization", "details (system)"); break; 352 case KParavirtProvider_KVM: acceleration << QApplication::translate("UIGDetails", "KVM Paravirtualization", "details (system)"); break; 353 default: break; 354 } 355 if (!acceleration.isEmpty()) 356 table << UITextTableLine(QApplication::translate("UIGDetails", "Acceleration", "details (system)"), 357 acceleration.join(", ")); 358 } 359 else 360 table << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), 361 QString()); 362 363 /* Save the table as property: */ 364 setProperty("table", QVariant::fromValue(table)); 365 } 366 367 368 void UIGDetailsUpdateTaskDisplay::run() 369 { 370 /* Acquire corresponding machine: */ 371 CMachine machine = property("machine").value<CMachine>(); 372 if (machine.isNull()) 373 return; 374 375 /* Prepare table: */ 376 UITextTable table; 377 378 /* Gather information: */ 379 if (machine.GetAccessible()) 380 { 381 /* Video memory: */ 382 table << UITextTableLine(QApplication::translate("UIGDetails", "Video Memory", "details (display)"), 383 QApplication::translate("UIGDetails", "%1 MB", "details").arg(machine.GetVRAMSize())); 384 385 /* Screen count: */ 386 int cGuestScreens = machine.GetMonitorCount(); 387 if (cGuestScreens > 1) 388 table << UITextTableLine(QApplication::translate("UIGDetails", "Screens", "details (display)"), 389 QString::number(cGuestScreens)); 390 391 /* Get scale-factor value: */ 392 const QString strScaleFactor = machine.GetExtraData(UIExtraDataDefs::GUI_ScaleFactor); 393 { 394 /* Try to convert loaded data to double: */ 395 bool fOk = false; 396 double dValue = strScaleFactor.toDouble(&fOk); 397 /* Invent the default value: */ 398 if (!fOk || !dValue) 399 dValue = 1.0; 400 /* Append information: */ 401 if (dValue != 1.0) 402 table << UITextTableLine(QApplication::translate("UIGDetails", "Scale-factor", "details (display)"), 403 QString::number(dValue, 'f', 2)); 404 } 405 406 #ifdef Q_WS_MAC 407 /* Get 'Unscaled HiDPI Video Output' mode value: */ 408 const QString strUnscaledHiDPIMode = machine.GetExtraData(UIExtraDataDefs::GUI_HiDPI_UnscaledOutput); 409 { 410 /* Try to convert loaded data to bool: */ 411 const bool fEnabled = strUnscaledHiDPIMode.compare("true", Qt::CaseInsensitive) == 0 || 412 strUnscaledHiDPIMode.compare("yes", Qt::CaseInsensitive) == 0 || 413 strUnscaledHiDPIMode.compare("on", Qt::CaseInsensitive) == 0 || 414 strUnscaledHiDPIMode == "1"; 415 /* Append information: */ 416 if (fEnabled) 417 table << UITextTableLine(QApplication::translate("UIGDetails", "Unscaled HiDPI Video Output", "details (display)"), 418 QApplication::translate("UIGDetails", "Enabled", "details (display/Unscaled HiDPI Video Output)")); 419 } 420 #endif /* Q_WS_MAC */ 421 422 QStringList acceleration; 423 #ifdef VBOX_WITH_VIDEOHWACCEL 424 /* 2D acceleration: */ 425 if (machine.GetAccelerate2DVideoEnabled()) 426 acceleration << QApplication::translate("UIGDetails", "2D Video", "details (display)"); 427 #endif /* VBOX_WITH_VIDEOHWACCEL */ 428 /* 3D acceleration: */ 429 if (machine.GetAccelerate3DEnabled()) 430 acceleration << QApplication::translate("UIGDetails", "3D", "details (display)"); 431 if (!acceleration.isEmpty()) 432 table << UITextTableLine(QApplication::translate("UIGDetails", "Acceleration", "details (display)"), 433 acceleration.join(", ")); 434 435 /* VRDE info: */ 436 CVRDEServer srv = machine.GetVRDEServer(); 437 if (!srv.isNull()) 438 { 439 if (srv.GetEnabled()) 440 table << UITextTableLine(QApplication::translate("UIGDetails", "Remote Desktop Server Port", "details (display/vrde)"), 441 srv.GetVRDEProperty("TCP/Ports")); 442 else 443 table << UITextTableLine(QApplication::translate("UIGDetails", "Remote Desktop Server", "details (display/vrde)"), 444 QApplication::translate("UIGDetails", "Disabled", "details (display/vrde/VRDE server)")); 445 } 446 447 /* Video Capture info: */ 448 if (machine.GetVideoCaptureEnabled()) 449 { 450 table << UITextTableLine(QApplication::translate("UIGDetails", "Video Capture File", "details (display/video capture)"), 451 machine.GetVideoCaptureFile()); 452 table << UITextTableLine(QApplication::translate("UIGDetails", "Video Capture Attributes", "details (display/video capture)"), 453 QApplication::translate("UIGDetails", "Frame Size: %1x%2, Frame Rate: %3fps, Bit Rate: %4kbps") 454 .arg(machine.GetVideoCaptureWidth()).arg(machine.GetVideoCaptureHeight()) 455 .arg(machine.GetVideoCaptureFPS()).arg(machine.GetVideoCaptureRate())); 456 } 457 else 458 { 459 table << UITextTableLine(QApplication::translate("UIGDetails", "Video Capture", "details (display/video capture)"), 460 QApplication::translate("UIGDetails", "Disabled", "details (display/video capture)")); 461 } 462 } 463 else 464 table << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), QString()); 465 466 /* Save the table as property: */ 467 setProperty("table", QVariant::fromValue(table)); 468 } 469 470 471 void UIGDetailsUpdateTaskStorage::run() 472 { 473 /* Acquire corresponding machine: */ 474 CMachine machine = property("machine").value<CMachine>(); 475 if (machine.isNull()) 476 return; 477 478 /* Prepare table: */ 479 UITextTable table; 480 481 /* Gather information: */ 482 if (machine.GetAccessible()) 483 { 484 /* Iterate over all the machine controllers: */ 485 bool fSomeInfo = false; 486 foreach (const CStorageController &controller, machine.GetStorageControllers()) 487 { 488 /* Add controller information: */ 489 QString strControllerName = QApplication::translate("UIMachineSettingsStorage", "Controller: %1"); 490 table << UITextTableLine(strControllerName.arg(controller.GetName()), QString()); 491 fSomeInfo = true; 492 /* Populate map (its sorted!): */ 493 QMap<StorageSlot, QString> attachmentsMap; 494 foreach (const CMediumAttachment &attachment, machine.GetMediumAttachmentsOfController(controller.GetName())) 495 { 496 /* Prepare current storage slot: */ 497 StorageSlot attachmentSlot(controller.GetBus(), attachment.GetPort(), attachment.GetDevice()); 498 AssertMsg(controller.isOk(), 499 ("Unable to acquire controller data: %s\n", 500 msgCenter().formatRC(controller.lastRC()).toAscii().constData())); 501 if (!controller.isOk()) 502 continue; 503 /* Prepare attachment information: */ 504 QString strAttachmentInfo = vboxGlobal().details(attachment.GetMedium(), false, false); 505 /* That temporary hack makes sure 'Inaccessible' word is always bold: */ 506 { // hack 507 QString strInaccessibleString(VBoxGlobal::tr("Inaccessible", "medium")); 508 QString strBoldInaccessibleString(QString("<b>%1</b>").arg(strInaccessibleString)); 509 strAttachmentInfo.replace(strInaccessibleString, strBoldInaccessibleString); 510 } // hack 511 /* Append 'device slot name' with 'device type name' for optical devices only: */ 512 KDeviceType deviceType = attachment.GetType(); 513 QString strDeviceType = deviceType == KDeviceType_DVD ? 514 QApplication::translate("UIGDetails", "[Optical Drive]", "details (storage)") : QString(); 515 if (!strDeviceType.isNull()) 516 strDeviceType.append(' '); 517 /* Insert that attachment information into the map: */ 518 if (!strAttachmentInfo.isNull()) 258 519 { 259 /* Trim first '/' symbol: */ 260 QString &strGroup = groups[i]; 261 if (strGroup.startsWith("/") && strGroup != "/") 262 strGroup.remove(0, 1); 263 } 264 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Groups", "details (general)"), groups.join(", ")); 265 } 266 } 267 else 268 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), QString()); 269 270 /* Send information into GUI thread: */ 271 emit sigComplete(m_text); 272 } 273 274 COMBase::CleanupCOM(); 275 } 276 277 278 void UIGDetailsUpdateThreadSystem::run() 279 { 280 COMBase::InitializeCOM(false); 281 282 if (!machine().isNull()) 283 { 284 /* Prepare table: */ 285 UITextTable m_text; 286 287 /* Gather information: */ 288 if (machine().GetAccessible()) 289 { 290 /* Base memory: */ 291 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Base Memory", "details (system)"), 292 QApplication::translate("UIGDetails", "%1 MB", "details").arg(machine().GetMemorySize())); 293 294 /* CPU count: */ 295 int cCPU = machine().GetCPUCount(); 296 if (cCPU > 1) 297 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Processors", "details (system)"), 298 QString::number(cCPU)); 299 300 /* CPU execution cap: */ 301 int iCPUExecCap = machine().GetCPUExecutionCap(); 302 if (iCPUExecCap < 100) 303 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Execution Cap", "details (system)"), 304 QApplication::translate("UIGDetails", "%1%", "details").arg(iCPUExecCap)); 305 306 /* Boot-order: */ 307 QStringList bootOrder; 308 for (ulong i = 1; i <= vboxGlobal().virtualBox().GetSystemProperties().GetMaxBootPosition(); ++i) 309 { 310 KDeviceType device = machine().GetBootOrder(i); 311 if (device == KDeviceType_Null) 312 continue; 313 bootOrder << gpConverter->toString(device); 314 } 315 if (bootOrder.isEmpty()) 316 bootOrder << gpConverter->toString(KDeviceType_Null); 317 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Boot Order", "details (system)"), bootOrder.join(", ")); 318 319 /* Acceleration: */ 320 QStringList acceleration; 321 if (vboxGlobal().virtualBox().GetHost().GetProcessorFeature(KProcessorFeature_HWVirtEx)) 322 { 323 /* VT-x/AMD-V: */ 324 if (machine().GetHWVirtExProperty(KHWVirtExPropertyType_Enabled)) 325 { 326 acceleration << QApplication::translate("UIGDetails", "VT-x/AMD-V", "details (system)"); 327 /* Nested Paging (only when hw virt is enabled): */ 328 if (machine().GetHWVirtExProperty(KHWVirtExPropertyType_NestedPaging)) 329 acceleration << QApplication::translate("UIGDetails", "Nested Paging", "details (system)"); 520 /* Configure hovering anchors: */ 521 const QString strAnchorType = deviceType == KDeviceType_DVD || deviceType == KDeviceType_Floppy ? QString("mount") : 522 deviceType == KDeviceType_HardDisk ? QString("attach") : QString(); 523 const CMedium medium = attachment.GetMedium(); 524 const QString strMediumLocation = medium.isNull() ? QString() : medium.GetLocation(); 525 attachmentsMap.insert(attachmentSlot, 526 QString("<a href=#%1,%2,%3,%4>%5</a>") 527 .arg(strAnchorType, 528 controller.GetName(), 529 gpConverter->toString(attachmentSlot), 530 strMediumLocation, 531 strDeviceType + strAttachmentInfo)); 330 532 } 331 533 } 332 if (machine().GetCPUProperty(KCPUPropertyType_PAE)) 333 acceleration << QApplication::translate("UIGDetails", "PAE/NX", "details (system)"); 334 switch (machine().GetEffectiveParavirtProvider()) 534 /* Iterate over the sorted map: */ 535 QList<StorageSlot> storageSlots = attachmentsMap.keys(); 536 QList<QString> storageInfo = attachmentsMap.values(); 537 for (int i = 0; i < storageSlots.size(); ++i) 538 table << UITextTableLine(QString(" ") + gpConverter->toString(storageSlots[i]), storageInfo[i]); 539 } 540 if (!fSomeInfo) 541 table << UITextTableLine(QApplication::translate("UIGDetails", "Not Attached", "details (storage)"), QString()); 542 } 543 else 544 table << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), QString()); 545 546 /* Save the table as property: */ 547 setProperty("table", QVariant::fromValue(table)); 548 } 549 550 551 void UIGDetailsUpdateTaskAudio::run() 552 { 553 /* Acquire corresponding machine: */ 554 CMachine machine = property("machine").value<CMachine>(); 555 if (machine.isNull()) 556 return; 557 558 /* Prepare table: */ 559 UITextTable table; 560 561 /* Gather information: */ 562 if (machine.GetAccessible()) 563 { 564 const CAudioAdapter &audio = machine.GetAudioAdapter(); 565 if (audio.GetEnabled()) 566 { 567 /* Driver: */ 568 table << UITextTableLine(QApplication::translate("UIGDetails", "Host Driver", "details (audio)"), 569 gpConverter->toString(audio.GetAudioDriver())); 570 571 /* Controller: */ 572 table << UITextTableLine(QApplication::translate("UIGDetails", "Controller", "details (audio)"), 573 gpConverter->toString(audio.GetAudioController())); 574 } 575 else 576 table << UITextTableLine(QApplication::translate("UIGDetails", "Disabled", "details (audio)"), 577 QString()); 578 } 579 else 580 table << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), 581 QString()); 582 583 /* Save the table as property: */ 584 setProperty("table", QVariant::fromValue(table)); 585 } 586 587 588 void UIGDetailsUpdateTaskNetwork::run() 589 { 590 /* Acquire corresponding machine: */ 591 CMachine machine = property("machine").value<CMachine>(); 592 if (machine.isNull()) 593 return; 594 595 /* Prepare table: */ 596 UITextTable table; 597 598 /* Gather information: */ 599 if (machine.GetAccessible()) 600 { 601 /* Iterate over all the adapters: */ 602 bool fSomeInfo = false; 603 ulong uSount = vboxGlobal().virtualBox().GetSystemProperties().GetMaxNetworkAdapters(KChipsetType_PIIX3); 604 for (ulong uSlot = 0; uSlot < uSount; ++uSlot) 605 { 606 const CNetworkAdapter &adapter = machine.GetNetworkAdapter(uSlot); 607 if (adapter.GetEnabled()) 335 608 { 336 case KParavirtProvider_Minimal: acceleration << QApplication::translate("UIGDetails", "Minimal Paravirtualization", "details (system)"); break; 337 case KParavirtProvider_HyperV: acceleration << QApplication::translate("UIGDetails", "Hyper-V Paravirtualization", "details (system)"); break; 338 case KParavirtProvider_KVM: acceleration << QApplication::translate("UIGDetails", "KVM Paravirtualization", "details (system)"); break; 339 default: break; 340 } 341 if (!acceleration.isEmpty()) 342 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Acceleration", "details (system)"), 343 acceleration.join(", ")); 344 } 345 else 346 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), 347 QString()); 348 349 /* Send information into GUI thread: */ 350 emit sigComplete(m_text); 351 } 352 353 COMBase::CleanupCOM(); 354 } 355 356 357 void UIGDetailsUpdateThreadDisplay::run() 358 { 359 COMBase::InitializeCOM(false); 360 361 if (!machine().isNull()) 362 { 363 /* Prepare table: */ 364 UITextTable m_text; 365 366 /* Gather information: */ 367 if (machine().GetAccessible()) 368 { 369 /* Damn GetExtraData should be const already :( */ 370 CMachine localMachine = machine(); 371 372 /* Video memory: */ 373 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Video Memory", "details (display)"), 374 QApplication::translate("UIGDetails", "%1 MB", "details").arg(localMachine.GetVRAMSize())); 375 376 /* Screen count: */ 377 int cGuestScreens = localMachine.GetMonitorCount(); 378 if (cGuestScreens > 1) 379 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Screens", "details (display)"), 380 QString::number(cGuestScreens)); 381 382 /* Get scale-factor value: */ 383 const QString strScaleFactor = localMachine.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 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Scale-factor", "details (display)"), 394 QString::number(dValue, 'f', 2)); 395 } 396 397 #ifdef Q_WS_MAC 398 /* Get 'Unscaled HiDPI Video Output' mode value: */ 399 const QString strUnscaledHiDPIMode = localMachine.GetExtraData(UIExtraDataDefs::GUI_HiDPI_UnscaledOutput); 400 { 401 /* Try to convert loaded data to bool: */ 402 const bool fEnabled = strUnscaledHiDPIMode.compare("true", Qt::CaseInsensitive) == 0 || 403 strUnscaledHiDPIMode.compare("yes", Qt::CaseInsensitive) == 0 || 404 strUnscaledHiDPIMode.compare("on", Qt::CaseInsensitive) == 0 || 405 strUnscaledHiDPIMode == "1"; 406 /* Append information: */ 407 if (fEnabled) 408 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Unscaled HiDPI Video Output", "details (display)"), 409 QApplication::translate("UIGDetails", "Enabled", "details (display/Unscaled HiDPI Video Output)")); 410 } 411 #endif /* Q_WS_MAC */ 412 413 QStringList acceleration; 414 #ifdef VBOX_WITH_VIDEOHWACCEL 415 /* 2D acceleration: */ 416 if (localMachine.GetAccelerate2DVideoEnabled()) 417 acceleration << QApplication::translate("UIGDetails", "2D Video", "details (display)"); 418 #endif /* VBOX_WITH_VIDEOHWACCEL */ 419 /* 3D acceleration: */ 420 if (localMachine.GetAccelerate3DEnabled()) 421 acceleration << QApplication::translate("UIGDetails", "3D", "details (display)"); 422 if (!acceleration.isEmpty()) 423 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Acceleration", "details (display)"), 424 acceleration.join(", ")); 425 426 /* VRDE info: */ 427 CVRDEServer srv = localMachine.GetVRDEServer(); 428 if (!srv.isNull()) 429 { 430 if (srv.GetEnabled()) 431 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Remote Desktop Server Port", "details (display/vrde)"), 432 srv.GetVRDEProperty("TCP/Ports")); 433 else 434 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Remote Desktop Server", "details (display/vrde)"), 435 QApplication::translate("UIGDetails", "Disabled", "details (display/vrde/VRDE server)")); 436 } 437 438 /* Video Capture info: */ 439 if (localMachine.GetVideoCaptureEnabled()) 440 { 441 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Video Capture File", "details (display/video capture)"), 442 localMachine.GetVideoCaptureFile()); 443 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Video Capture Attributes", "details (display/video capture)"), 444 QApplication::translate("UIGDetails", "Frame Size: %1x%2, Frame Rate: %3fps, Bit Rate: %4kbps") 445 .arg(localMachine.GetVideoCaptureWidth()).arg(localMachine.GetVideoCaptureHeight()) 446 .arg(localMachine.GetVideoCaptureFPS()).arg(localMachine.GetVideoCaptureRate())); 447 } 448 else 449 { 450 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Video Capture", "details (display/video capture)"), 451 QApplication::translate("UIGDetails", "Disabled", "details (display/video capture)")); 452 } 453 } 454 else 455 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), QString()); 456 457 /* Send information into GUI thread: */ 458 emit sigComplete(m_text); 459 } 460 461 COMBase::CleanupCOM(); 462 } 463 464 465 void UIGDetailsUpdateThreadStorage::run() 466 { 467 COMBase::InitializeCOM(false); 468 469 if (!machine().isNull()) 470 { 471 /* Prepare table: */ 472 UITextTable m_text; 473 474 /* Gather information: */ 475 if (machine().GetAccessible()) 476 { 477 /* Iterate over all the machine controllers: */ 478 bool fSomeInfo = false; 479 foreach (const CStorageController &controller, machine().GetStorageControllers()) 480 { 481 /* Add controller information: */ 482 QString strControllerName = QApplication::translate("UIMachineSettingsStorage", "Controller: %1"); 483 m_text << UITextTableLine(strControllerName.arg(controller.GetName()), QString()); 484 fSomeInfo = true; 485 /* Populate map (its sorted!): */ 486 QMap<StorageSlot, QString> attachmentsMap; 487 foreach (const CMediumAttachment &attachment, machine().GetMediumAttachmentsOfController(controller.GetName())) 609 KNetworkAttachmentType type = adapter.GetAttachmentType(); 610 QString strAttachmentType = gpConverter->toString(adapter.GetAdapterType()) 611 .replace(QRegExp("\\s\\(.+\\)"), " (%1)"); 612 switch (type) 488 613 { 489 /* Prepare current storage slot: */ 490 StorageSlot attachmentSlot(controller.GetBus(), attachment.GetPort(), attachment.GetDevice()); 491 AssertMsg(controller.isOk(), 492 ("Unable to acquire controller data: %s\n", 493 msgCenter().formatRC(controller.lastRC()).toAscii().constData())); 494 if (!controller.isOk()) 495 continue; 496 /* Prepare attachment information: */ 497 QString strAttachmentInfo = vboxGlobal().details(attachment.GetMedium(), false, false); 498 /* That temporary hack makes sure 'Inaccessible' word is always bold: */ 499 { // hack 500 QString strInaccessibleString(VBoxGlobal::tr("Inaccessible", "medium")); 501 QString strBoldInaccessibleString(QString("<b>%1</b>").arg(strInaccessibleString)); 502 strAttachmentInfo.replace(strInaccessibleString, strBoldInaccessibleString); 503 } // hack 504 /* Append 'device slot name' with 'device type name' for optical devices only: */ 505 KDeviceType deviceType = attachment.GetType(); 506 QString strDeviceType = deviceType == KDeviceType_DVD ? 507 QApplication::translate("UIGDetails", "[Optical Drive]", "details (storage)") : QString(); 508 if (!strDeviceType.isNull()) 509 strDeviceType.append(' '); 510 /* Insert that attachment information into the map: */ 511 if (!strAttachmentInfo.isNull()) 614 case KNetworkAttachmentType_Bridged: 512 615 { 513 /* Configure hovering anchors: */ 514 const QString strAnchorType = deviceType == KDeviceType_DVD || deviceType == KDeviceType_Floppy ? QString("mount") : 515 deviceType == KDeviceType_HardDisk ? QString("attach") : QString(); 516 const CMedium medium = attachment.GetMedium(); 517 const QString strMediumLocation = medium.isNull() ? QString() : medium.GetLocation(); 518 attachmentsMap.insert(attachmentSlot, 519 QString("<a href=#%1,%2,%3,%4>%5</a>") 520 .arg(strAnchorType, 521 controller.GetName(), 522 gpConverter->toString(attachmentSlot), 523 strMediumLocation, 524 strDeviceType + strAttachmentInfo)); 616 strAttachmentType = strAttachmentType.arg(QApplication::translate("UIGDetails", "Bridged Adapter, %1", "details (network)") 617 .arg(adapter.GetBridgedInterface())); 618 break; 619 } 620 case KNetworkAttachmentType_Internal: 621 { 622 strAttachmentType = strAttachmentType.arg(QApplication::translate("UIGDetails", "Internal Network, '%1'", "details (network)") 623 .arg(adapter.GetInternalNetwork())); 624 break; 625 } 626 case KNetworkAttachmentType_HostOnly: 627 { 628 strAttachmentType = strAttachmentType.arg(QApplication::translate("UIGDetails", "Host-only Adapter, '%1'", "details (network)") 629 .arg(adapter.GetHostOnlyInterface())); 630 break; 631 } 632 case KNetworkAttachmentType_Generic: 633 { 634 QString strGenericDriverProperties(summarizeGenericProperties(adapter)); 635 strAttachmentType = strGenericDriverProperties.isNull() ? 636 strAttachmentType.arg(QApplication::translate("UIGDetails", "Generic Driver, '%1'", "details (network)").arg(adapter.GetGenericDriver())) : 637 strAttachmentType.arg(QApplication::translate("UIGDetails", "Generic Driver, '%1' { %2 }", "details (network)") 638 .arg(adapter.GetGenericDriver(), strGenericDriverProperties)); 639 break; 640 } 641 case KNetworkAttachmentType_NATNetwork: 642 { 643 strAttachmentType = strAttachmentType.arg(QApplication::translate("UIGDetails", "NAT Network, '%1'", "details (network)") 644 .arg(adapter.GetNATNetwork())); 645 break; 646 } 647 default: 648 { 649 strAttachmentType = strAttachmentType.arg(gpConverter->toString(type)); 650 break; 525 651 } 526 652 } 527 /* Iterate over the sorted map: */ 528 QList<StorageSlot> storageSlots = attachmentsMap.keys(); 529 QList<QString> storageInfo = attachmentsMap.values(); 530 for (int i = 0; i < storageSlots.size(); ++i) 531 m_text << UITextTableLine(QString(" ") + gpConverter->toString(storageSlots[i]), storageInfo[i]); 653 table << UITextTableLine(QApplication::translate("UIGDetails", "Adapter %1", "details (network)").arg(adapter.GetSlot() + 1), strAttachmentType); 654 fSomeInfo = true; 532 655 } 533 if (!fSomeInfo) 534 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Not Attached", "details (storage)"), QString()); 535 } 536 else 537 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), QString()); 538 539 /* Send information into GUI thread: */ 540 emit sigComplete(m_text); 541 } 542 543 COMBase::CleanupCOM(); 544 } 545 546 547 void UIGDetailsUpdateThreadAudio::run() 548 { 549 COMBase::InitializeCOM(false); 550 551 if (!machine().isNull()) 552 { 553 /* Prepare table: */ 554 UITextTable m_text; 555 556 /* Gather information: */ 557 if (machine().GetAccessible()) 558 { 559 const CAudioAdapter &audio = machine().GetAudioAdapter(); 560 if (audio.GetEnabled()) 561 { 562 /* Driver: */ 563 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Host Driver", "details (audio)"), 564 gpConverter->toString(audio.GetAudioDriver())); 565 566 /* Controller: */ 567 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Controller", "details (audio)"), 568 gpConverter->toString(audio.GetAudioController())); 569 } 570 else 571 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Disabled", "details (audio)"), 572 QString()); 573 } 574 else 575 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), 576 QString()); 577 578 /* Send information into GUI thread: */ 579 emit sigComplete(m_text); 580 } 581 582 COMBase::CleanupCOM(); 583 } 584 585 586 void UIGDetailsUpdateThreadNetwork::run() 587 { 588 COMBase::InitializeCOM(false); 589 590 if (!machine().isNull()) 591 { 592 /* Prepare table: */ 593 UITextTable m_text; 594 595 /* Gather information: */ 596 if (machine().GetAccessible()) 597 { 598 /* Iterate over all the adapters: */ 599 bool fSomeInfo = false; 600 ulong uSount = vboxGlobal().virtualBox().GetSystemProperties().GetMaxNetworkAdapters(KChipsetType_PIIX3); 601 for (ulong uSlot = 0; uSlot < uSount; ++uSlot) 602 { 603 const CNetworkAdapter &adapter = machine().GetNetworkAdapter(uSlot); 604 if (adapter.GetEnabled()) 605 { 606 KNetworkAttachmentType type = adapter.GetAttachmentType(); 607 QString strAttachmentType = gpConverter->toString(adapter.GetAdapterType()) 608 .replace(QRegExp("\\s\\(.+\\)"), " (%1)"); 609 switch (type) 610 { 611 case KNetworkAttachmentType_Bridged: 612 { 613 strAttachmentType = strAttachmentType.arg(QApplication::translate("UIGDetails", "Bridged Adapter, %1", "details (network)") 614 .arg(adapter.GetBridgedInterface())); 615 break; 616 } 617 case KNetworkAttachmentType_Internal: 618 { 619 strAttachmentType = strAttachmentType.arg(QApplication::translate("UIGDetails", "Internal Network, '%1'", "details (network)") 620 .arg(adapter.GetInternalNetwork())); 621 break; 622 } 623 case KNetworkAttachmentType_HostOnly: 624 { 625 strAttachmentType = strAttachmentType.arg(QApplication::translate("UIGDetails", "Host-only Adapter, '%1'", "details (network)") 626 .arg(adapter.GetHostOnlyInterface())); 627 break; 628 } 629 case KNetworkAttachmentType_Generic: 630 { 631 QString strGenericDriverProperties(summarizeGenericProperties(adapter)); 632 strAttachmentType = strGenericDriverProperties.isNull() ? 633 strAttachmentType.arg(QApplication::translate("UIGDetails", "Generic Driver, '%1'", "details (network)").arg(adapter.GetGenericDriver())) : 634 strAttachmentType.arg(QApplication::translate("UIGDetails", "Generic Driver, '%1' { %2 }", "details (network)") 635 .arg(adapter.GetGenericDriver(), strGenericDriverProperties)); 636 break; 637 } 638 case KNetworkAttachmentType_NATNetwork: 639 { 640 strAttachmentType = strAttachmentType.arg(QApplication::translate("UIGDetails", "NAT Network, '%1'", "details (network)") 641 .arg(adapter.GetNATNetwork())); 642 break; 643 } 644 default: 645 { 646 strAttachmentType = strAttachmentType.arg(gpConverter->toString(type)); 647 break; 648 } 649 } 650 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Adapter %1", "details (network)").arg(adapter.GetSlot() + 1), strAttachmentType); 651 fSomeInfo = true; 652 } 653 } 654 if (!fSomeInfo) 655 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Disabled", "details (network/adapter)"), QString()); 656 } 657 else 658 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), QString()); 659 660 /* Send information into GUI thread: */ 661 emit sigComplete(m_text); 662 } 663 664 COMBase::CleanupCOM(); 656 } 657 if (!fSomeInfo) 658 table << UITextTableLine(QApplication::translate("UIGDetails", "Disabled", "details (network/adapter)"), QString()); 659 } 660 else 661 table << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), QString()); 662 663 /* Save the table as property: */ 664 setProperty("table", QVariant::fromValue(table)); 665 665 } 666 666 667 667 /* static */ 668 QString UIGDetailsUpdateT hreadNetwork::summarizeGenericProperties(const CNetworkAdapter &adapter)668 QString UIGDetailsUpdateTaskNetwork::summarizeGenericProperties(const CNetworkAdapter &adapter) 669 669 { 670 670 QVector<QString> names; … … 682 682 683 683 684 void UIGDetailsUpdateThreadSerial::run() 685 { 686 COMBase::InitializeCOM(false); 687 688 if (!machine().isNull()) 689 { 690 /* Prepare table: */ 691 UITextTable m_text; 692 693 /* Gather information: */ 694 if (machine().GetAccessible()) 695 { 696 /* Iterate over all the ports: */ 697 bool fSomeInfo = false; 698 ulong uCount = vboxGlobal().virtualBox().GetSystemProperties().GetSerialPortCount(); 699 for (ulong uSlot = 0; uSlot < uCount; ++uSlot) 684 void UIGDetailsUpdateTaskSerial::run() 685 { 686 /* Acquire corresponding machine: */ 687 CMachine machine = property("machine").value<CMachine>(); 688 if (machine.isNull()) 689 return; 690 691 /* Prepare table: */ 692 UITextTable table; 693 694 /* Gather information: */ 695 if (machine.GetAccessible()) 696 { 697 /* Iterate over all the ports: */ 698 bool fSomeInfo = false; 699 ulong uCount = vboxGlobal().virtualBox().GetSystemProperties().GetSerialPortCount(); 700 for (ulong uSlot = 0; uSlot < uCount; ++uSlot) 701 { 702 const CSerialPort &port = machine.GetSerialPort(uSlot); 703 if (port.GetEnabled()) 700 704 { 701 const CSerialPort &port = machine().GetSerialPort(uSlot); 702 if (port.GetEnabled()) 705 KPortMode mode = port.GetHostMode(); 706 QString data = vboxGlobal().toCOMPortName(port.GetIRQ(), port.GetIOBase()) + ", "; 707 if (mode == KPortMode_HostPipe || mode == KPortMode_HostDevice || 708 mode == KPortMode_RawFile || mode == KPortMode_TCP) 709 data += QString("%1 (%2)").arg(gpConverter->toString(mode)).arg(QDir::toNativeSeparators(port.GetPath())); 710 else 711 data += gpConverter->toString(mode); 712 table << UITextTableLine(QApplication::translate("UIGDetails", "Port %1", "details (serial)").arg(port.GetSlot() + 1), data); 713 fSomeInfo = true; 714 } 715 } 716 if (!fSomeInfo) 717 table << UITextTableLine(QApplication::translate("UIGDetails", "Disabled", "details (serial)"), QString()); 718 } 719 else 720 table << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), QString()); 721 722 /* Save the table as property: */ 723 setProperty("table", QVariant::fromValue(table)); 724 } 725 726 727 #ifdef VBOX_WITH_PARALLEL_PORTS 728 void UIGDetailsUpdateTaskParallel::run() 729 { 730 /* Acquire corresponding machine: */ 731 CMachine machine = property("machine").value<CMachine>(); 732 if (machine.isNull()) 733 return; 734 735 /* Prepare table: */ 736 UITextTable table; 737 738 /* Gather information: */ 739 if (machine.GetAccessible()) 740 { 741 bool fSomeInfo = false; 742 ulong uCount = vboxGlobal().virtualBox().GetSystemProperties().GetParallelPortCount(); 743 for (ulong uSlot = 0; uSlot < uCount; ++uSlot) 744 { 745 const CParallelPort &port = machine.GetParallelPort(uSlot); 746 if (port.GetEnabled()) 747 { 748 QString data = vboxGlobal().toLPTPortName(port.GetIRQ(), port.GetIOBase()) + 749 QString(" (<nobr>%1</nobr>)").arg(QDir::toNativeSeparators(port.GetPath())); 750 table << UITextTableLine(QApplication::translate("UIGDetails", "Port %1", "details (parallel)").arg(port.GetSlot() + 1), data); 751 fSomeInfo = true; 752 } 753 } 754 if (!fSomeInfo) 755 table << UITextTableLine(QApplication::translate("UIGDetails", "Disabled", "details (parallel)"), QString()); 756 } 757 else 758 table << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), QString()); 759 760 /* Save the table as property: */ 761 setProperty("table", QVariant::fromValue(table)); 762 } 763 #endif /* VBOX_WITH_PARALLEL_PORTS */ 764 765 766 void UIGDetailsUpdateTaskUSB::run() 767 { 768 /* Acquire corresponding machine: */ 769 CMachine machine = property("machine").value<CMachine>(); 770 if (machine.isNull()) 771 return; 772 773 /* Prepare table: */ 774 UITextTable table; 775 776 /* Gather information: */ 777 if (machine.GetAccessible()) 778 { 779 /* Iterate over all the USB filters: */ 780 const CUSBDeviceFilters &filters = machine.GetUSBDeviceFilters(); 781 if (!filters.isNull() && machine.GetUSBProxyAvailable()) 782 { 783 const CUSBDeviceFilters flts = machine.GetUSBDeviceFilters(); 784 const CUSBControllerVector controllers = machine.GetUSBControllers(); 785 if (!flts.isNull() && !controllers.isEmpty()) 786 { 787 /* USB Controllers info: */ 788 QStringList controllerList; 789 foreach (const CUSBController &controller, controllers) 790 controllerList << gpConverter->toString(controller.GetType()); 791 table << UITextTableLine(QApplication::translate("UIGDetails", "USB Controller", "details (usb)"), 792 controllerList.join(", ")); 793 /* USB Device Filters info: */ 794 const CUSBDeviceFilterVector &coll = flts.GetDeviceFilters(); 795 uint uActive = 0; 796 for (int i = 0; i < coll.size(); ++i) 797 if (coll[i].GetActive()) 798 ++uActive; 799 table << UITextTableLine(QApplication::translate("UIGDetails", "Device Filters", "details (usb)"), 800 QApplication::translate("UIGDetails", "%1 (%2 active)", "details (usb)").arg(coll.size()).arg(uActive)); 801 } 802 else 803 table << UITextTableLine(QApplication::translate("UIGDetails", "Disabled", "details (usb)"), QString()); 804 } 805 else 806 table << UITextTableLine(QApplication::translate("UIGDetails", "USB Controller Inaccessible", "details (usb)"), QString()); 807 } 808 else 809 table << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), QString()); 810 811 /* Save the table as property: */ 812 setProperty("table", QVariant::fromValue(table)); 813 } 814 815 816 void UIGDetailsUpdateTaskSF::run() 817 { 818 /* Acquire corresponding machine: */ 819 CMachine machine = property("machine").value<CMachine>(); 820 if (machine.isNull()) 821 return; 822 823 /* Prepare table: */ 824 UITextTable table; 825 826 /* Gather information: */ 827 if (machine.GetAccessible()) 828 { 829 /* Iterate over all the shared folders: */ 830 ulong uCount = machine.GetSharedFolders().size(); 831 if (uCount > 0) 832 table << UITextTableLine(QApplication::translate("UIGDetails", "Shared Folders", "details (shared folders)"), QString::number(uCount)); 833 else 834 table << UITextTableLine(QApplication::translate("UIGDetails", "None", "details (shared folders)"), QString()); 835 } 836 else 837 table << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), QString()); 838 839 /* Save the table as property: */ 840 setProperty("table", QVariant::fromValue(table)); 841 } 842 843 844 void UIGDetailsUpdateTaskUI::run() 845 { 846 /* Acquire corresponding machine: */ 847 CMachine machine = property("machine").value<CMachine>(); 848 if (machine.isNull()) 849 return; 850 851 /* Prepare table: */ 852 UITextTable table; 853 854 /* Gather information: */ 855 if (machine.GetAccessible()) 856 { 857 #ifndef Q_WS_MAC 858 /* Get menu-bar availability status: */ 859 const QString strMenubarEnabled = machine.GetExtraData(UIExtraDataDefs::GUI_MenuBar_Enabled); 860 { 861 /* Try to convert loaded data to bool: */ 862 const bool fEnabled = !(strMenubarEnabled.compare("false", Qt::CaseInsensitive) == 0 || 863 strMenubarEnabled.compare("no", Qt::CaseInsensitive) == 0 || 864 strMenubarEnabled.compare("off", Qt::CaseInsensitive) == 0 || 865 strMenubarEnabled == "0"); 866 /* Append information: */ 867 table << UITextTableLine(QApplication::translate("UIGDetails", "Menu-bar", "details (user interface)"), 868 fEnabled ? QApplication::translate("UIGDetails", "Enabled", "details (user interface/menu-bar)") : 869 QApplication::translate("UIGDetails", "Disabled", "details (user interface/menu-bar)")); 870 } 871 #endif /* !Q_WS_MAC */ 872 873 /* Get status-bar availability status: */ 874 const QString strStatusbarEnabled = machine.GetExtraData(UIExtraDataDefs::GUI_StatusBar_Enabled); 875 { 876 /* Try to convert loaded data to bool: */ 877 const bool fEnabled = !(strStatusbarEnabled.compare("false", Qt::CaseInsensitive) == 0 || 878 strStatusbarEnabled.compare("no", Qt::CaseInsensitive) == 0 || 879 strStatusbarEnabled.compare("off", Qt::CaseInsensitive) == 0 || 880 strStatusbarEnabled == "0"); 881 /* Append information: */ 882 table << UITextTableLine(QApplication::translate("UIGDetails", "Status-bar", "details (user interface)"), 883 fEnabled ? QApplication::translate("UIGDetails", "Enabled", "details (user interface/status-bar)") : 884 QApplication::translate("UIGDetails", "Disabled", "details (user interface/status-bar)")); 885 } 886 887 #ifndef Q_WS_MAC 888 /* Get mini-toolbar availability status: */ 889 const QString strMiniToolbarEnabled = machine.GetExtraData(UIExtraDataDefs::GUI_ShowMiniToolBar); 890 { 891 /* Try to convert loaded data to bool: */ 892 const bool fEnabled = !(strMiniToolbarEnabled.compare("false", Qt::CaseInsensitive) == 0 || 893 strMiniToolbarEnabled.compare("no", Qt::CaseInsensitive) == 0 || 894 strMiniToolbarEnabled.compare("off", Qt::CaseInsensitive) == 0 || 895 strMiniToolbarEnabled == "0"); 896 /* Append information: */ 897 if (fEnabled) 898 { 899 /* Get mini-toolbar position: */ 900 const QString &strMiniToolbarPosition = machine.GetExtraData(UIExtraDataDefs::GUI_MiniToolBarAlignment); 703 901 { 704 KPortMode mode = port.GetHostMode(); 705 QString data = vboxGlobal().toCOMPortName(port.GetIRQ(), port.GetIOBase()) + ", "; 706 if (mode == KPortMode_HostPipe || mode == KPortMode_HostDevice || 707 mode == KPortMode_RawFile || mode == KPortMode_TCP) 708 data += QString("%1 (%2)").arg(gpConverter->toString(mode)).arg(QDir::toNativeSeparators(port.GetPath())); 709 else 710 data += gpConverter->toString(mode); 711 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Port %1", "details (serial)").arg(port.GetSlot() + 1), data); 712 fSomeInfo = true; 902 /* Try to convert loaded data to alignment: */ 903 switch (gpConverter->fromInternalString<MiniToolbarAlignment>(strMiniToolbarPosition)) 904 { 905 /* Append information: */ 906 case MiniToolbarAlignment_Top: 907 table << UITextTableLine(QApplication::translate("UIGDetails", "Mini-toolbar Position", "details (user interface)"), 908 QApplication::translate("UIGDetails", "Top", "details (user interface/mini-toolbar position)")); 909 break; 910 /* Append information: */ 911 case MiniToolbarAlignment_Bottom: 912 table << UITextTableLine(QApplication::translate("UIGDetails", "Mini-toolbar Position", "details (user interface)"), 913 QApplication::translate("UIGDetails", "Bottom", "details (user interface/mini-toolbar position)")); 914 break; 915 } 713 916 } 714 917 } 715 if (!fSomeInfo) 716 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Disabled", "details (serial)"), QString()); 717 } 918 /* Append information: */ 919 else 920 table << UITextTableLine(QApplication::translate("UIGDetails", "Mini-toolbar", "details (user interface)"), 921 QApplication::translate("UIGDetails", "Disabled", "details (user interface/mini-toolbar)")); 922 } 923 #endif /* !Q_WS_MAC */ 924 } 925 else 926 table << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), QString()); 927 928 /* Save the table as property: */ 929 setProperty("table", QVariant::fromValue(table)); 930 } 931 932 933 void UIGDetailsUpdateTaskDescription::run() 934 { 935 /* Acquire corresponding machine: */ 936 CMachine machine = property("machine").value<CMachine>(); 937 if (machine.isNull()) 938 return; 939 940 /* Prepare table: */ 941 UITextTable table; 942 943 /* Gather information: */ 944 if (machine.GetAccessible()) 945 { 946 /* Get description: */ 947 const QString &strDesc = machine.GetDescription(); 948 if (!strDesc.isEmpty()) 949 table << UITextTableLine(strDesc, QString()); 718 950 else 719 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), QString()); 720 721 /* Send information into GUI thread: */ 722 emit sigComplete(m_text); 723 } 724 725 COMBase::CleanupCOM(); 726 } 727 728 729 #ifdef VBOX_WITH_PARALLEL_PORTS 730 void UIGDetailsUpdateThreadParallel::run() 731 { 732 COMBase::InitializeCOM(false); 733 734 if (!machine().isNull()) 735 { 736 /* Prepare table: */ 737 UITextTable m_text; 738 739 /* Gather information: */ 740 if (machine().GetAccessible()) 741 { 742 bool fSomeInfo = false; 743 ulong uCount = vboxGlobal().virtualBox().GetSystemProperties().GetParallelPortCount(); 744 for (ulong uSlot = 0; uSlot < uCount; ++uSlot) 745 { 746 const CParallelPort &port = machine().GetParallelPort(uSlot); 747 if (port.GetEnabled()) 748 { 749 QString data = vboxGlobal().toLPTPortName(port.GetIRQ(), port.GetIOBase()) + 750 QString(" (<nobr>%1</nobr>)").arg(QDir::toNativeSeparators(port.GetPath())); 751 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Port %1", "details (parallel)").arg(port.GetSlot() + 1), data); 752 fSomeInfo = true; 753 } 754 } 755 if (!fSomeInfo) 756 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Disabled", "details (parallel)"), QString()); 757 } 758 else 759 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), QString()); 760 761 /* Send information into GUI thread: */ 762 emit sigComplete(m_text); 763 } 764 765 COMBase::CleanupCOM(); 766 } 767 #endif /* VBOX_WITH_PARALLEL_PORTS */ 768 769 770 void UIGDetailsUpdateThreadUSB::run() 771 { 772 COMBase::InitializeCOM(false); 773 774 if (!machine().isNull()) 775 { 776 /* Prepare table: */ 777 UITextTable m_text; 778 779 /* Gather information: */ 780 if (machine().GetAccessible()) 781 { 782 /* Iterate over all the USB filters: */ 783 const CUSBDeviceFilters &filters = machine().GetUSBDeviceFilters(); 784 if (!filters.isNull() && machine().GetUSBProxyAvailable()) 785 { 786 const CUSBDeviceFilters flts = machine().GetUSBDeviceFilters(); 787 const CUSBControllerVector controllers = machine().GetUSBControllers(); 788 if (!flts.isNull() && !controllers.isEmpty()) 789 { 790 /* USB Controllers info: */ 791 QStringList controllerList; 792 foreach (const CUSBController &controller, controllers) 793 controllerList << gpConverter->toString(controller.GetType()); 794 m_text << UITextTableLine(QApplication::translate("UIGDetails", "USB Controller", "details (usb)"), 795 controllerList.join(", ")); 796 /* USB Device Filters info: */ 797 const CUSBDeviceFilterVector &coll = flts.GetDeviceFilters(); 798 uint uActive = 0; 799 for (int i = 0; i < coll.size(); ++i) 800 if (coll[i].GetActive()) 801 ++uActive; 802 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Device Filters", "details (usb)"), 803 QApplication::translate("UIGDetails", "%1 (%2 active)", "details (usb)").arg(coll.size()).arg(uActive)); 804 } 805 else 806 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Disabled", "details (usb)"), QString()); 807 } 808 else 809 m_text << UITextTableLine(QApplication::translate("UIGDetails", "USB Controller Inaccessible", "details (usb)"), QString()); 810 } 811 else 812 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), QString()); 813 814 /* Send information into GUI thread: */ 815 emit sigComplete(m_text); 816 } 817 818 COMBase::CleanupCOM(); 819 } 820 821 822 void UIGDetailsUpdateThreadSF::run() 823 { 824 COMBase::InitializeCOM(false); 825 826 if (!machine().isNull()) 827 { 828 /* Prepare table: */ 829 UITextTable m_text; 830 831 /* Gather information: */ 832 if (machine().GetAccessible()) 833 { 834 /* Iterate over all the shared folders: */ 835 ulong uCount = machine().GetSharedFolders().size(); 836 if (uCount > 0) 837 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Shared Folders", "details (shared folders)"), QString::number(uCount)); 838 else 839 m_text << UITextTableLine(QApplication::translate("UIGDetails", "None", "details (shared folders)"), QString()); 840 } 841 else 842 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), QString()); 843 844 /* Send information into GUI thread: */ 845 emit sigComplete(m_text); 846 } 847 848 COMBase::CleanupCOM(); 849 } 850 851 852 void UIGDetailsUpdateThreadUI::run() 853 { 854 COMBase::InitializeCOM(false); 855 856 if (!machine().isNull()) 857 { 858 /* Prepare table: */ 859 UITextTable m_text; 860 861 /* Gather information: */ 862 if (machine().GetAccessible()) 863 { 864 /* Damn GetExtraData should be const already :( */ 865 CMachine localMachine = machine(); 866 867 #ifndef Q_WS_MAC 868 /* Get menu-bar availability status: */ 869 const QString strMenubarEnabled = localMachine.GetExtraData(UIExtraDataDefs::GUI_MenuBar_Enabled); 870 { 871 /* Try to convert loaded data to bool: */ 872 const bool fEnabled = !(strMenubarEnabled.compare("false", Qt::CaseInsensitive) == 0 || 873 strMenubarEnabled.compare("no", Qt::CaseInsensitive) == 0 || 874 strMenubarEnabled.compare("off", Qt::CaseInsensitive) == 0 || 875 strMenubarEnabled == "0"); 876 /* Append information: */ 877 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Menu-bar", "details (user interface)"), 878 fEnabled ? QApplication::translate("UIGDetails", "Enabled", "details (user interface/menu-bar)") : 879 QApplication::translate("UIGDetails", "Disabled", "details (user interface/menu-bar)")); 880 } 881 #endif /* !Q_WS_MAC */ 882 883 /* Get status-bar availability status: */ 884 const QString strStatusbarEnabled = localMachine.GetExtraData(UIExtraDataDefs::GUI_StatusBar_Enabled); 885 { 886 /* Try to convert loaded data to bool: */ 887 const bool fEnabled = !(strStatusbarEnabled.compare("false", Qt::CaseInsensitive) == 0 || 888 strStatusbarEnabled.compare("no", Qt::CaseInsensitive) == 0 || 889 strStatusbarEnabled.compare("off", Qt::CaseInsensitive) == 0 || 890 strStatusbarEnabled == "0"); 891 /* Append information: */ 892 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Status-bar", "details (user interface)"), 893 fEnabled ? QApplication::translate("UIGDetails", "Enabled", "details (user interface/status-bar)") : 894 QApplication::translate("UIGDetails", "Disabled", "details (user interface/status-bar)")); 895 } 896 897 #ifndef Q_WS_MAC 898 /* Get mini-toolbar availability status: */ 899 const QString strMiniToolbarEnabled = localMachine.GetExtraData(UIExtraDataDefs::GUI_ShowMiniToolBar); 900 { 901 /* Try to convert loaded data to bool: */ 902 const bool fEnabled = !(strMiniToolbarEnabled.compare("false", Qt::CaseInsensitive) == 0 || 903 strMiniToolbarEnabled.compare("no", Qt::CaseInsensitive) == 0 || 904 strMiniToolbarEnabled.compare("off", Qt::CaseInsensitive) == 0 || 905 strMiniToolbarEnabled == "0"); 906 /* Append information: */ 907 if (fEnabled) 908 { 909 /* Get mini-toolbar position: */ 910 const QString &strMiniToolbarPosition = localMachine.GetExtraData(UIExtraDataDefs::GUI_MiniToolBarAlignment); 911 { 912 /* Try to convert loaded data to alignment: */ 913 switch (gpConverter->fromInternalString<MiniToolbarAlignment>(strMiniToolbarPosition)) 914 { 915 /* Append information: */ 916 case MiniToolbarAlignment_Top: 917 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Mini-toolbar Position", "details (user interface)"), 918 QApplication::translate("UIGDetails", "Top", "details (user interface/mini-toolbar position)")); 919 break; 920 /* Append information: */ 921 case MiniToolbarAlignment_Bottom: 922 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Mini-toolbar Position", "details (user interface)"), 923 QApplication::translate("UIGDetails", "Bottom", "details (user interface/mini-toolbar position)")); 924 break; 925 } 926 } 927 } 928 /* Append information: */ 929 else 930 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Mini-toolbar", "details (user interface)"), 931 QApplication::translate("UIGDetails", "Disabled", "details (user interface/mini-toolbar)")); 932 } 933 #endif /* !Q_WS_MAC */ 934 } 935 else 936 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), QString()); 937 938 /* Send information into GUI thread: */ 939 emit sigComplete(m_text); 940 } 941 942 COMBase::CleanupCOM(); 943 } 944 945 946 void UIGDetailsUpdateThreadDescription::run() 947 { 948 COMBase::InitializeCOM(false); 949 950 if (!machine().isNull()) 951 { 952 /* Prepare table: */ 953 UITextTable m_text; 954 955 /* Gather information: */ 956 if (machine().GetAccessible()) 957 { 958 /* Get description: */ 959 const QString &strDesc = machine().GetDescription(); 960 if (!strDesc.isEmpty()) 961 m_text << UITextTableLine(strDesc, QString()); 962 else 963 m_text << UITextTableLine(QApplication::translate("UIGDetails", "None", "details (description)"), QString()); 964 } 965 else 966 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), QString()); 967 968 /* Send information into GUI thread: */ 969 emit sigComplete(m_text); 970 } 971 972 COMBase::CleanupCOM(); 973 } 974 951 table << UITextTableLine(QApplication::translate("UIGDetails", "None", "details (description)"), QString()); 952 } 953 else 954 table << UITextTableLine(QApplication::translate("UIGDetails", "Information Inaccessible", "details"), QString()); 955 956 /* Save the table as property: */ 957 setProperty("table", QVariant::fromValue(table)); 958 } 959 -
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElements.h
r57670 r57672 19 19 #define __UIGDetailsElements_h__ 20 20 21 /* Qt includes: */22 #include <QThread>23 24 21 /* GUI includes: */ 22 #include "UIThreadPool.h" 25 23 #include "UIGDetailsElement.h" 26 27 /* COM includes: */28 #include "COMEnums.h"29 #include "CMachine.h"30 24 31 25 /* Forward declarations: */ 32 26 class UIGMachinePreview; 33 34 35 /* Element update thread: */ 36 class UIGDetailsUpdateThread : public QThread 37 { 38 Q_OBJECT; 39 40 signals: 41 42 /* Notifier: Prepare stuff: */ 43 void sigComplete(const UITextTable &text); 44 45 public: 46 47 /* Constructor: */ 48 UIGDetailsUpdateThread(const CMachine &machine); 49 50 protected: 51 52 /* Internal API: Machine stuff: */ 53 const CMachine& machine() const { return m_machine; } 54 55 private: 56 57 /* Variables: */ 58 const CMachine &m_machine; 27 class CNetworkAdapter; 28 29 30 /* Element update task: */ 31 class UIGDetailsUpdateTask : public UITask 32 { 33 Q_OBJECT; 34 35 public: 36 37 /* Constructor: */ 38 UIGDetailsUpdateTask(const CMachine &machine); 59 39 }; 60 40 … … 68 48 /* Constructor/destructor: */ 69 49 UIGDetailsElementInterface(UIGDetailsSet *pParent, DetailsElementType type, bool fOpened); 70 ~UIGDetailsElementInterface();71 50 72 51 protected: 73 52 74 53 /* Helper: Translate stuff: */ 75 v oid retranslateUi();54 virtual void retranslateUi(); 76 55 77 56 /* Helpers: Update stuff: */ 78 v oid updateAppearance();79 virtual UI GDetailsUpdateThread* createUpdateThread() = 0;57 virtual void updateAppearance(); 58 virtual UITask* createUpdateTask() = 0; 80 59 81 60 private slots: 82 61 83 62 /* Handler: Update stuff: */ 84 virtual void sltUpdateAppearanceFinished(const UITextTable &newText); 85 86 private: 87 88 /* Helpers: Cleanup stuff: */ 89 void cleanupThread(); 63 virtual void sltUpdateAppearanceFinished(UITask *pTask); 64 65 private: 90 66 91 67 /* Variables: */ 92 UI GDetailsUpdateThread *m_pThread;68 UITask *m_pTask; 93 69 }; 94 70 … … 112 88 113 89 /* Helper: Translate stuff: */ 114 v oid retranslateUi();90 virtual void retranslateUi(); 115 91 116 92 /* Helpers: Layout stuff: */ … … 127 103 128 104 129 /* T hread'General': */130 class UIGDetailsUpdateT hreadGeneral : public UIGDetailsUpdateThread131 { 132 Q_OBJECT; 133 134 public: 135 136 /* Constructor: */ 137 UIGDetailsUpdateT hreadGeneral(const CMachine &machine)138 : UIGDetailsUpdateT hread(machine) {}105 /* Task 'General': */ 106 class UIGDetailsUpdateTaskGeneral : public UIGDetailsUpdateTask 107 { 108 Q_OBJECT; 109 110 public: 111 112 /* Constructor: */ 113 UIGDetailsUpdateTaskGeneral(const CMachine &machine) 114 : UIGDetailsUpdateTask(machine) {} 139 115 140 116 private: … … 158 134 159 135 /* Helper: Update stuff: */ 160 UI GDetailsUpdateThread* createUpdateThread() { return new UIGDetailsUpdateThreadGeneral(machine()); }161 }; 162 163 164 /* T hread'System': */165 class UIGDetailsUpdateT hreadSystem : public UIGDetailsUpdateThread166 { 167 Q_OBJECT; 168 169 public: 170 171 /* Constructor: */ 172 UIGDetailsUpdateT hreadSystem(const CMachine &machine)173 : UIGDetailsUpdateT hread(machine) {}136 UITask* createUpdateTask() { return new UIGDetailsUpdateTaskGeneral(machine()); } 137 }; 138 139 140 /* Task 'System': */ 141 class UIGDetailsUpdateTaskSystem : public UIGDetailsUpdateTask 142 { 143 Q_OBJECT; 144 145 public: 146 147 /* Constructor: */ 148 UIGDetailsUpdateTaskSystem(const CMachine &machine) 149 : UIGDetailsUpdateTask(machine) {} 174 150 175 151 private: … … 193 169 194 170 /* Helper: Update stuff: */ 195 UI GDetailsUpdateThread* createUpdateThread() { return new UIGDetailsUpdateThreadSystem(machine()); }196 }; 197 198 199 /* T hread'Display': */200 class UIGDetailsUpdateT hreadDisplay : public UIGDetailsUpdateThread201 { 202 Q_OBJECT; 203 204 public: 205 206 /* Constructor: */ 207 UIGDetailsUpdateT hreadDisplay(const CMachine &machine)208 : UIGDetailsUpdateT hread(machine) {}171 UITask* createUpdateTask() { return new UIGDetailsUpdateTaskSystem(machine()); } 172 }; 173 174 175 /* Task 'Display': */ 176 class UIGDetailsUpdateTaskDisplay : public UIGDetailsUpdateTask 177 { 178 Q_OBJECT; 179 180 public: 181 182 /* Constructor: */ 183 UIGDetailsUpdateTaskDisplay(const CMachine &machine) 184 : UIGDetailsUpdateTask(machine) {} 209 185 210 186 private: … … 228 204 229 205 /* Helper: Update stuff: */ 230 UI GDetailsUpdateThread* createUpdateThread() { return new UIGDetailsUpdateThreadDisplay(machine()); }231 }; 232 233 234 /* T hread'Storage': */235 class UIGDetailsUpdateT hreadStorage : public UIGDetailsUpdateThread236 { 237 Q_OBJECT; 238 239 public: 240 241 /* Constructor: */ 242 UIGDetailsUpdateT hreadStorage(const CMachine &machine)243 : UIGDetailsUpdateT hread(machine) {}206 UITask* createUpdateTask() { return new UIGDetailsUpdateTaskDisplay(machine()); } 207 }; 208 209 210 /* Task 'Storage': */ 211 class UIGDetailsUpdateTaskStorage : public UIGDetailsUpdateTask 212 { 213 Q_OBJECT; 214 215 public: 216 217 /* Constructor: */ 218 UIGDetailsUpdateTaskStorage(const CMachine &machine) 219 : UIGDetailsUpdateTask(machine) {} 244 220 245 221 private: … … 263 239 264 240 /* Helper: Update stuff: */ 265 UI GDetailsUpdateThread* createUpdateThread() { return new UIGDetailsUpdateThreadStorage(machine()); }266 }; 267 268 269 /* T hread'Audio': */270 class UIGDetailsUpdateT hreadAudio : public UIGDetailsUpdateThread271 { 272 Q_OBJECT; 273 274 public: 275 276 /* Constructor: */ 277 UIGDetailsUpdateT hreadAudio(const CMachine &machine)278 : UIGDetailsUpdateT hread(machine) {}241 UITask* createUpdateTask() { return new UIGDetailsUpdateTaskStorage(machine()); } 242 }; 243 244 245 /* Task 'Audio': */ 246 class UIGDetailsUpdateTaskAudio : public UIGDetailsUpdateTask 247 { 248 Q_OBJECT; 249 250 public: 251 252 /* Constructor: */ 253 UIGDetailsUpdateTaskAudio(const CMachine &machine) 254 : UIGDetailsUpdateTask(machine) {} 279 255 280 256 private: … … 298 274 299 275 /* Helper: Update stuff: */ 300 UI GDetailsUpdateThread* createUpdateThread() { return new UIGDetailsUpdateThreadAudio(machine()); }301 }; 302 303 304 /* T hread'Network': */305 class UIGDetailsUpdateT hreadNetwork : public UIGDetailsUpdateThread306 { 307 Q_OBJECT; 308 309 public: 310 311 /* Constructor: */ 312 UIGDetailsUpdateT hreadNetwork(const CMachine &machine)313 : UIGDetailsUpdateT hread(machine) {}276 UITask* createUpdateTask() { return new UIGDetailsUpdateTaskAudio(machine()); } 277 }; 278 279 280 /* Task 'Network': */ 281 class UIGDetailsUpdateTaskNetwork : public UIGDetailsUpdateTask 282 { 283 Q_OBJECT; 284 285 public: 286 287 /* Constructor: */ 288 UIGDetailsUpdateTaskNetwork(const CMachine &machine) 289 : UIGDetailsUpdateTask(machine) {} 314 290 315 291 private: … … 334 310 335 311 /* Helper: Update stuff: */ 336 UI GDetailsUpdateThread* createUpdateThread() { return new UIGDetailsUpdateThreadNetwork(machine()); }337 }; 338 339 340 /* T hread'Serial': */341 class UIGDetailsUpdateT hreadSerial : public UIGDetailsUpdateThread342 { 343 Q_OBJECT; 344 345 public: 346 347 /* Constructor: */ 348 UIGDetailsUpdateT hreadSerial(const CMachine &machine)349 : UIGDetailsUpdateT hread(machine) {}312 UITask* createUpdateTask() { return new UIGDetailsUpdateTaskNetwork(machine()); } 313 }; 314 315 316 /* Task 'Serial': */ 317 class UIGDetailsUpdateTaskSerial : public UIGDetailsUpdateTask 318 { 319 Q_OBJECT; 320 321 public: 322 323 /* Constructor: */ 324 UIGDetailsUpdateTaskSerial(const CMachine &machine) 325 : UIGDetailsUpdateTask(machine) {} 350 326 351 327 private: … … 369 345 370 346 /* Helper: Update stuff: */ 371 UI GDetailsUpdateThread* createUpdateThread() { return new UIGDetailsUpdateThreadSerial(machine()); }347 UITask* createUpdateTask() { return new UIGDetailsUpdateTaskSerial(machine()); } 372 348 }; 373 349 374 350 375 351 #ifdef VBOX_WITH_PARALLEL_PORTS 376 /* T hread'Parallel': */377 class UIGDetailsUpdateT hreadParallel : public UIGDetailsUpdateThread378 { 379 Q_OBJECT; 380 381 public: 382 383 /* Constructor: */ 384 UIGDetailsUpdateT hreadParallel(const CMachine &machine)385 : UIGDetailsUpdateT hread(machine) {}352 /* Task 'Parallel': */ 353 class UIGDetailsUpdateTaskParallel : public UIGDetailsUpdateTask 354 { 355 Q_OBJECT; 356 357 public: 358 359 /* Constructor: */ 360 UIGDetailsUpdateTaskParallel(const CMachine &machine) 361 : UIGDetailsUpdateTask(machine) {} 386 362 387 363 private: … … 405 381 406 382 /* Helper: Update stuff: */ 407 UI GDetailsUpdateThread* createUpdateThread() { return new UIGDetailsUpdateThreadParallel(machine()); }383 UITask* createUpdateTask() { return new UIGDetailsUpdateTaskParallel(machine()); } 408 384 }; 409 385 #endif /* VBOX_WITH_PARALLEL_PORTS */ 410 386 411 387 412 /* T hread'USB': */413 class UIGDetailsUpdateT hreadUSB : public UIGDetailsUpdateThread414 { 415 Q_OBJECT; 416 417 public: 418 419 /* Constructor: */ 420 UIGDetailsUpdateT hreadUSB(const CMachine &machine)421 : UIGDetailsUpdateT hread(machine) {}388 /* Task 'USB': */ 389 class UIGDetailsUpdateTaskUSB : public UIGDetailsUpdateTask 390 { 391 Q_OBJECT; 392 393 public: 394 395 /* Constructor: */ 396 UIGDetailsUpdateTaskUSB(const CMachine &machine) 397 : UIGDetailsUpdateTask(machine) {} 422 398 423 399 private: … … 441 417 442 418 /* Helper: Update stuff: */ 443 UI GDetailsUpdateThread* createUpdateThread() { return new UIGDetailsUpdateThreadUSB(machine()); }444 }; 445 446 447 /* T hread'SF': */448 class UIGDetailsUpdateT hreadSF : public UIGDetailsUpdateThread449 { 450 Q_OBJECT; 451 452 public: 453 454 /* Constructor: */ 455 UIGDetailsUpdateT hreadSF(const CMachine &machine)456 : UIGDetailsUpdateT hread(machine) {}419 UITask* createUpdateTask() { return new UIGDetailsUpdateTaskUSB(machine()); } 420 }; 421 422 423 /* Task 'SF': */ 424 class UIGDetailsUpdateTaskSF : public UIGDetailsUpdateTask 425 { 426 Q_OBJECT; 427 428 public: 429 430 /* Constructor: */ 431 UIGDetailsUpdateTaskSF(const CMachine &machine) 432 : UIGDetailsUpdateTask(machine) {} 457 433 458 434 private: … … 476 452 477 453 /* Helper: Update stuff: */ 478 UI GDetailsUpdateThread* createUpdateThread() { return new UIGDetailsUpdateThreadSF(machine()); }479 }; 480 481 482 /* T hread'UI': */483 class UIGDetailsUpdateT hreadUI : public UIGDetailsUpdateThread484 { 485 Q_OBJECT; 486 487 public: 488 489 /* Constructor: */ 490 UIGDetailsUpdateT hreadUI(const CMachine &machine)491 : UIGDetailsUpdateT hread(machine) {}454 UITask* createUpdateTask() { return new UIGDetailsUpdateTaskSF(machine()); } 455 }; 456 457 458 /* Task 'UI': */ 459 class UIGDetailsUpdateTaskUI : public UIGDetailsUpdateTask 460 { 461 Q_OBJECT; 462 463 public: 464 465 /* Constructor: */ 466 UIGDetailsUpdateTaskUI(const CMachine &machine) 467 : UIGDetailsUpdateTask(machine) {} 492 468 493 469 private: … … 511 487 512 488 /* Helper: Update stuff: */ 513 UI GDetailsUpdateThread* createUpdateThread() { return new UIGDetailsUpdateThreadUI(machine()); }514 }; 515 516 517 /* T hread'Description': */518 class UIGDetailsUpdateT hreadDescription : public UIGDetailsUpdateThread519 { 520 Q_OBJECT; 521 522 public: 523 524 /* Constructor: */ 525 UIGDetailsUpdateT hreadDescription(const CMachine &machine)526 : UIGDetailsUpdateT hread(machine) {}489 UITask* createUpdateTask() { return new UIGDetailsUpdateTaskUI(machine()); } 490 }; 491 492 493 /* Task 'Description': */ 494 class UIGDetailsUpdateTaskDescription : public UIGDetailsUpdateTask 495 { 496 Q_OBJECT; 497 498 public: 499 500 /* Constructor: */ 501 UIGDetailsUpdateTaskDescription(const CMachine &machine) 502 : UIGDetailsUpdateTask(machine) {} 527 503 528 504 private: … … 546 522 547 523 /* Helper: Update stuff: */ 548 UI GDetailsUpdateThread* createUpdateThread() { return new UIGDetailsUpdateThreadDescription(machine()); }524 UITask* createUpdateTask() { return new UIGDetailsUpdateTaskDescription(machine()); } 549 525 }; 550 526
Note:
See TracChangeset
for help on using the changeset viewer.