Changeset 105265 in vbox
- Timestamp:
- Jul 10, 2024 5:00:23 PM (5 months ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDetailsGenerator.cpp
r105263 r105265 1432 1432 1433 1433 void UIDetailsGenerator::acquireDisplayStatusInfo(CMachine &comMachine, QString &strInfo, 1434 bool &fAcceleration3D)1434 uint &uVRAMSize, uint &cMonitorCount, bool &fAcceleration3D) 1435 1435 { 1436 1436 /* Get graphics adapter: */ … … 1438 1438 1439 1439 /* Video Memory: */ 1440 const ULONGuVRAMSize = comGraphics.GetVRAMSize();1441 const QString strVRAMSize = QApplication::translate("UIIndicatorDisplay", " <nobr>%1 MB</nobr>").arg(uVRAMSize);1440 uVRAMSize = comGraphics.GetVRAMSize(); 1441 const QString strVRAMSize = QApplication::translate("UIIndicatorDisplay", "%1 MB").arg(uVRAMSize); 1442 1442 strInfo += e_strTableRow2 1443 1443 .arg(QApplication::translate("UIDetails", "Video Memory", "details (display)"), strVRAMSize); 1444 1444 1445 1445 /* Monitor Count: */ 1446 const ULONG uMonitorCount = comGraphics.GetMonitorCount(); 1447 if (uMonitorCount > 1) 1448 { 1449 const QString strMonitorCount = QString::number(uMonitorCount); 1446 cMonitorCount = comGraphics.GetMonitorCount(); 1447 if (cMonitorCount > 1) 1450 1448 strInfo += e_strTableRow2 1451 .arg(QApplication::translate("UIDetails", "Screens", "details (display)"), strMonitorCount); 1452 } 1449 .arg(QApplication::translate("UIDetails", "Screens", "details (display)"), QString::number(cMonitorCount)); 1453 1450 1454 1451 /* 3D acceleration: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDetailsGenerator.h
r105263 r105265 111 111 112 112 SHARED_LIBRARY_STUFF void acquireDisplayStatusInfo(CMachine &comMachine, QString &strInfo, 113 bool &fAcceleration3D);113 uint &uVRAMSize, uint &cMonitorCount, bool &fAcceleration3D); 114 114 115 115 SHARED_LIBRARY_STUFF void acquireRecordingStatusInfo(CMachine &comMachine, QString &strInfo, -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp
r105263 r105265 544 544 545 545 /* Append description with more info: */ 546 const QString strAdaptersStatus = m_fAdaptersPresent ? tr("Adapters present") : tr("No network adapters"); 547 const QString strCablesStatus = m_fCablesDisconnected ? tr("All cables disconnected") : QString(); 548 m_strDescription = QString("%1, %2, %3").arg(m_strDescription, strAdaptersStatus, strCablesStatus); 546 QStringList info; 547 info << (m_fAdaptersPresent ? tr("Adapters present") : tr("No network adapters")); 548 if (m_fCablesDisconnected) 549 info << tr("All cables disconnected"); 550 m_strDescription = QString("%1, %2").arg(m_strDescription, info.join(", ")); 549 551 } 550 552 … … 717 719 UIIndicatorDisplay(UIMachine *pMachine) 718 720 : UISessionStateStatusBarIndicator(IndicatorType_Display, pMachine) 721 , m_uVRAMSize(0) 722 , m_cMonitorCount(0) 723 , m_fAcceleration3D(false) 719 724 { 720 725 /* Assign state-icons: */ … … 735 740 { 736 741 QString strFullData; 737 bool fAcceleration3D = false; 738 m_pMachine->acquireDisplayStatusInfo(strFullData, fAcceleration3D); 742 m_uVRAMSize = 0; 743 m_cMonitorCount = 0; 744 m_fAcceleration3D = false; 745 m_pMachine->acquireDisplayStatusInfo(strFullData, m_uVRAMSize, m_cMonitorCount, m_fAcceleration3D); 739 746 740 747 /* Update tool-tip: */ … … 745 752 if (m_pMachine->machineState() != KMachineState_Null) 746 753 { 747 if (! fAcceleration3D)754 if (!m_fAcceleration3D) 748 755 enmState = DisplayState_Software; 749 756 else … … 755 762 sltRetranslateUI(); 756 763 } 764 765 /** Handles translation event. */ 766 virtual void sltRetranslateUI() RT_OVERRIDE 767 { 768 /* Call to base-class: */ 769 UISessionStateStatusBarIndicator::sltRetranslateUI(); 770 771 /* Append description with more info: */ 772 QStringList info; 773 info << tr("%1 MB").arg(m_uVRAMSize); 774 if (m_cMonitorCount > 1) 775 info << tr("%1 monitors connected").arg(m_cMonitorCount); 776 if (m_fAcceleration3D) 777 info << tr("3D acceleration enabled"); 778 m_strDescription = QString("%1, %2").arg(m_strDescription, info.join(", ")); 779 } 780 781 private: 782 783 /** Holds the VRAM size. */ 784 uint m_uVRAMSize; 785 /** Holds the monitor count. */ 786 uint m_cMonitorCount; 787 /** Holds whether 3D acceleration is enabled. */ 788 bool m_fAcceleration3D; 757 789 }; 758 790 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r105263 r105265 937 937 } 938 938 939 void UIMachine::acquireDisplayStatusInfo(QString &strInfo, bool &fAcceleration3D)940 { 941 uisession()->acquireDisplayStatusInfo(strInfo, fAcceleration3D);939 void UIMachine::acquireDisplayStatusInfo(QString &strInfo, uint &uVRAMSize, uint &cMonitorCount, bool &fAcceleration3D) 940 { 941 uisession()->acquireDisplayStatusInfo(strInfo, uVRAMSize, cMonitorCount, fAcceleration3D); 942 942 } 943 943 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h
r105263 r105265 639 639 void acquireSharedFoldersStatusInfo(QString &strInfo, uint &cFoldersCount); 640 640 /** Acquires status info for Display indicator. */ 641 void acquireDisplayStatusInfo(QString &strInfo, bool &fAcceleration3D);641 void acquireDisplayStatusInfo(QString &strInfo, uint &uVRAMSize, uint &cMonitorCount, bool &fAcceleration3D); 642 642 /** Acquires status info for Recording indicator. */ 643 643 void acquireRecordingStatusInfo(QString &strInfo, bool &fRecordingEnabled, bool &fMachinePaused); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r105263 r105265 2043 2043 } 2044 2044 2045 void UISession::acquireDisplayStatusInfo(QString &strInfo, bool &fAcceleration3D)2045 void UISession::acquireDisplayStatusInfo(QString &strInfo, uint &uVRAMSize, uint &cMonitorCount, bool &fAcceleration3D) 2046 2046 { 2047 2047 CMachine comMachine = machine(); 2048 2048 if (comMachine.isNull()) 2049 2049 return; 2050 UIDetailsGenerator::acquireDisplayStatusInfo(comMachine, strInfo, fAcceleration3D);2050 UIDetailsGenerator::acquireDisplayStatusInfo(comMachine, strInfo, uVRAMSize, cMonitorCount, fAcceleration3D); 2051 2051 } 2052 2052 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r105263 r105265 521 521 void acquireSharedFoldersStatusInfo(QString &strInfo, uint &cFoldersCount); 522 522 /** Acquires status info for Display indicator. */ 523 void acquireDisplayStatusInfo(QString &strInfo, bool &fAcceleration3D);523 void acquireDisplayStatusInfo(QString &strInfo, uint &uVRAMSize, uint &cMonitorCount, bool &fAcceleration3D); 524 524 /** Acquires status info for Recording indicator. */ 525 525 void acquireRecordingStatusInfo(QString &strInfo, bool &fRecordingEnabled, bool &fMachinePaused);
Note:
See TracChangeset
for help on using the changeset viewer.