VirtualBox

Changeset 105265 in vbox


Ignore:
Timestamp:
Jul 10, 2024 5:00:23 PM (5 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10672: Runtime UI: Improve accessibility for Display indicator; Had to adjust details generation stuff for that as well.

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  
    14321432
    14331433void UIDetailsGenerator::acquireDisplayStatusInfo(CMachine &comMachine, QString &strInfo,
    1434                                                   bool &fAcceleration3D)
     1434                                                  uint &uVRAMSize, uint &cMonitorCount, bool &fAcceleration3D)
    14351435{
    14361436    /* Get graphics adapter: */
     
    14381438
    14391439    /* Video Memory: */
    1440     const ULONG uVRAMSize = 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);
    14421442    strInfo += e_strTableRow2
    14431443        .arg(QApplication::translate("UIDetails", "Video Memory", "details (display)"), strVRAMSize);
    14441444
    14451445    /* 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)
    14501448        strInfo += e_strTableRow2
    1451             .arg(QApplication::translate("UIDetails", "Screens", "details (display)"), strMonitorCount);
    1452     }
     1449            .arg(QApplication::translate("UIDetails", "Screens", "details (display)"), QString::number(cMonitorCount));
    14531450
    14541451    /* 3D acceleration: */
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDetailsGenerator.h

    r105263 r105265  
    111111
    112112    SHARED_LIBRARY_STUFF void acquireDisplayStatusInfo(CMachine &comMachine, QString &strInfo,
    113                                                        bool &fAcceleration3D);
     113                                                       uint &uVRAMSize, uint &cMonitorCount, bool &fAcceleration3D);
    114114
    115115    SHARED_LIBRARY_STUFF void acquireRecordingStatusInfo(CMachine &comMachine, QString &strInfo,
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp

    r105263 r105265  
    544544
    545545        /* 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(", "));
    549551    }
    550552
     
    717719    UIIndicatorDisplay(UIMachine *pMachine)
    718720        : UISessionStateStatusBarIndicator(IndicatorType_Display, pMachine)
     721        , m_uVRAMSize(0)
     722        , m_cMonitorCount(0)
     723        , m_fAcceleration3D(false)
    719724    {
    720725        /* Assign state-icons: */
     
    735740    {
    736741        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);
    739746
    740747        /* Update tool-tip: */
     
    745752        if (m_pMachine->machineState() != KMachineState_Null)
    746753        {
    747             if (!fAcceleration3D)
     754            if (!m_fAcceleration3D)
    748755                enmState = DisplayState_Software;
    749756            else
     
    755762        sltRetranslateUI();
    756763    }
     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
     781private:
     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;
    757789};
    758790
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp

    r105263 r105265  
    937937}
    938938
    939 void UIMachine::acquireDisplayStatusInfo(QString &strInfo, bool &fAcceleration3D)
    940 {
    941     uisession()->acquireDisplayStatusInfo(strInfo, fAcceleration3D);
     939void UIMachine::acquireDisplayStatusInfo(QString &strInfo, uint &uVRAMSize, uint &cMonitorCount, bool &fAcceleration3D)
     940{
     941    uisession()->acquireDisplayStatusInfo(strInfo, uVRAMSize, cMonitorCount, fAcceleration3D);
    942942}
    943943
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.h

    r105263 r105265  
    639639        void acquireSharedFoldersStatusInfo(QString &strInfo, uint &cFoldersCount);
    640640        /** Acquires status info for Display indicator. */
    641         void acquireDisplayStatusInfo(QString &strInfo, bool &fAcceleration3D);
     641        void acquireDisplayStatusInfo(QString &strInfo, uint &uVRAMSize, uint &cMonitorCount, bool &fAcceleration3D);
    642642        /** Acquires status info for Recording indicator. */
    643643        void acquireRecordingStatusInfo(QString &strInfo, bool &fRecordingEnabled, bool &fMachinePaused);
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp

    r105263 r105265  
    20432043}
    20442044
    2045 void UISession::acquireDisplayStatusInfo(QString &strInfo, bool &fAcceleration3D)
     2045void UISession::acquireDisplayStatusInfo(QString &strInfo, uint &uVRAMSize, uint &cMonitorCount, bool &fAcceleration3D)
    20462046{
    20472047    CMachine comMachine = machine();
    20482048    if (comMachine.isNull())
    20492049        return;
    2050     UIDetailsGenerator::acquireDisplayStatusInfo(comMachine, strInfo, fAcceleration3D);
     2050    UIDetailsGenerator::acquireDisplayStatusInfo(comMachine, strInfo, uVRAMSize, cMonitorCount, fAcceleration3D);
    20512051}
    20522052
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h

    r105263 r105265  
    521521        void acquireSharedFoldersStatusInfo(QString &strInfo, uint &cFoldersCount);
    522522        /** Acquires status info for Display indicator. */
    523         void acquireDisplayStatusInfo(QString &strInfo, bool &fAcceleration3D);
     523        void acquireDisplayStatusInfo(QString &strInfo, uint &uVRAMSize, uint &cMonitorCount, bool &fAcceleration3D);
    524524        /** Acquires status info for Recording indicator. */
    525525        void acquireRecordingStatusInfo(QString &strInfo, bool &fRecordingEnabled, bool &fMachinePaused);
Note: See TracChangeset for help on using the changeset viewer.

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