Changeset 55720 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- May 7, 2015 12:37:21 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 100132
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElements.cpp
r55717 r55720 411 411 if (machine().GetAccessible()) 412 412 { 413 /* Damn GetExtraData should be const already :( */ 414 CMachine localMachine = machine(); 415 413 416 /* Video memory: */ 414 417 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Video Memory", "details (display)"), 415 QApplication::translate("UIGDetails", "%1 MB", "details").arg( machine().GetVRAMSize()));418 QApplication::translate("UIGDetails", "%1 MB", "details").arg(localMachine.GetVRAMSize())); 416 419 417 420 /* Screen count: */ 418 int cGuestScreens = machine().GetMonitorCount();421 int cGuestScreens = localMachine.GetMonitorCount(); 419 422 if (cGuestScreens > 1) 420 423 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Screens", "details (display)"), 421 424 QString::number(cGuestScreens)); 422 425 426 /* Get scale-factor value: */ 427 const QString strScaleFactor = localMachine.GetExtraData(UIExtraDataDefs::GUI_ScaleFactor); 428 { 429 /* Try to convert loaded data to double: */ 430 bool fOk = false; 431 double dValue = strScaleFactor.toDouble(&fOk); 432 /* Invent the default value: */ 433 if (!fOk || !dValue) 434 dValue = 1.0; 435 /* Append information: */ 436 if (dValue != 1.0) 437 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Scale-factor", "details (display)"), 438 QString::number(dValue, 'f', 2)); 439 } 440 441 #ifdef Q_WS_MAC 442 /* Get 'Unscaled HiDPI Video Output' mode value: */ 443 const QString strUnscaledHiDPIMode = localMachine.GetExtraData(UIExtraDataDefs::GUI_HiDPI_UnscaledOutput); 444 { 445 /* Try to convert loaded data to bool: */ 446 const bool fEnabled = strUnscaledHiDPIMode.compare("true", Qt::CaseInsensitive) == 0 || 447 strUnscaledHiDPIMode.compare("yes", Qt::CaseInsensitive) == 0 || 448 strUnscaledHiDPIMode.compare("on", Qt::CaseInsensitive) == 0 || 449 strUnscaledHiDPIMode == "1"; 450 /* Append information: */ 451 if (fEnabled) 452 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Unscaled HiDPI Video Output", "details (display)"), 453 QApplication::translate("UIGDetails", "Enabled", "details (display/Unscaled HiDPI Video Output)")); 454 } 455 #endif /* Q_WS_MAC */ 456 423 457 QStringList acceleration; 424 458 #ifdef VBOX_WITH_VIDEOHWACCEL 425 459 /* 2D acceleration: */ 426 if ( machine().GetAccelerate2DVideoEnabled())460 if (localMachine.GetAccelerate2DVideoEnabled()) 427 461 acceleration << QApplication::translate("UIGDetails", "2D Video", "details (display)"); 428 462 #endif /* VBOX_WITH_VIDEOHWACCEL */ 429 463 /* 3D acceleration: */ 430 if ( machine().GetAccelerate3DEnabled())464 if (localMachine.GetAccelerate3DEnabled()) 431 465 acceleration << QApplication::translate("UIGDetails", "3D", "details (display)"); 432 466 if (!acceleration.isEmpty()) … … 435 469 436 470 /* VRDE info: */ 437 CVRDEServer srv = machine().GetVRDEServer();471 CVRDEServer srv = localMachine.GetVRDEServer(); 438 472 if (!srv.isNull()) 439 473 { … … 447 481 448 482 /* Video Capture info: */ 449 if ( machine().GetVideoCaptureEnabled())483 if (localMachine.GetVideoCaptureEnabled()) 450 484 { 451 485 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Video Capture File", "details (display/video capture)"), 452 machine().GetVideoCaptureFile());486 localMachine.GetVideoCaptureFile()); 453 487 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Video Capture Attributes", "details (display/video capture)"), 454 488 QApplication::translate("UIGDetails", "Frame Size: %1x%2, Frame Rate: %3fps, Bit Rate: %4kbps") 455 .arg( machine().GetVideoCaptureWidth()).arg(machine().GetVideoCaptureHeight())456 .arg( machine().GetVideoCaptureFPS()).arg(machine().GetVideoCaptureRate()));489 .arg(localMachine.GetVideoCaptureWidth()).arg(localMachine.GetVideoCaptureHeight()) 490 .arg(localMachine.GetVideoCaptureFPS()).arg(localMachine.GetVideoCaptureRate())); 457 491 } 458 492 else … … 1105 1139 } 1106 1140 1107 /* Get scale-factor value: */1108 const QString strScaleFactor = localMachine.GetExtraData(UIExtraDataDefs::GUI_ScaleFactor);1109 {1110 /* Try to convert loaded data to double: */1111 bool fOk = false;1112 double dValue = strScaleFactor.toDouble(&fOk);1113 /* Invent the default value: */1114 if (!fOk || !dValue)1115 dValue = 1.0;1116 /* Append information: */1117 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Scale-factor", "details (user interface)"), QString::number(dValue, 'f', 2));1118 }1119 1120 #ifdef Q_WS_MAC1121 /* Get 'Unscaled HiDPI Video Output' mode value: */1122 const QString strUnscaledHiDPIMode = localMachine.GetExtraData(UIExtraDataDefs::GUI_HiDPI_UnscaledOutput);1123 {1124 /* Try to convert loaded data to bool: */1125 const bool fEnabled = strUnscaledHiDPIMode.compare("true", Qt::CaseInsensitive) == 0 ||1126 strUnscaledHiDPIMode.compare("yes", Qt::CaseInsensitive) == 0 ||1127 strUnscaledHiDPIMode.compare("on", Qt::CaseInsensitive) == 0 ||1128 strUnscaledHiDPIMode == "1";1129 /* Append information: */1130 if (fEnabled)1131 m_text << UITextTableLine(QApplication::translate("UIGDetails", "Unscaled HiDPI Video Output", "details (user interface)"),1132 QApplication::translate("UIGDetails", "Enabled", "details (user interface/Unscaled HiDPI Video Output)"));1133 }1134 #endif /* Q_WS_MAC */1135 1136 1141 #ifndef Q_WS_MAC 1137 1142 /* Get mini-toolbar availability status: */
Note:
See TracChangeset
for help on using the changeset viewer.