VirtualBox

Changeset 105193 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Jul 8, 2024 3:58:40 PM (7 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10672: Runtime UI: Improve accessibility for audio indicator.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIIndicatorsPool.cpp

    r105192 r105193  
    430430        QString strFullData;
    431431        bool fAudioEnabled = false;
    432         bool fEnabledOutput = false;
    433         bool fEnabledInput = false;
    434         m_pMachine->acquireAudioStatusInfo(strFullData, fAudioEnabled, fEnabledOutput, fEnabledInput);
     432        m_fOutputEnabled = false;
     433        m_fInputEnabled = false;
     434        m_pMachine->acquireAudioStatusInfo(strFullData, fAudioEnabled, m_fOutputEnabled, m_fInputEnabled);
    435435
    436436        /* Show/hide indicator if there are no attachments
     
    445445        /* Update indicator state: */
    446446        AudioState enmState = AudioState_AllOff;
    447         if (fEnabledOutput)
     447        if (m_fOutputEnabled)
    448448            enmState = (AudioState)(enmState | AudioState_OutputOn);
    449         if (fEnabledInput)
     449        if (m_fInputEnabled)
    450450            enmState = (AudioState)(enmState | AudioState_InputOn);
    451451        setState(enmState);
    452452    }
     453
     454    /** Handles translation event. */
     455    virtual void sltRetranslateUI() RT_OVERRIDE
     456    {
     457        /* Call to base-class: */
     458        UISessionStateStatusBarIndicator::sltRetranslateUI();
     459
     460        /* Append description with more info: */
     461        const QString strOutputStatus = m_fOutputEnabled ? tr("Output enabled") : tr("Output disabled");
     462        const QString strInputStatus = m_fInputEnabled ? tr("Input enabled") : tr("Input disabled");
     463        m_strDescription = QString("%1, %2, %3").arg(m_strDescription, strOutputStatus, strInputStatus);
     464    }
     465
     466private:
     467
     468    /** Holds whether audio output enabled. */
     469    bool  m_fOutputEnabled;
     470    /** Holds whether audio input enabled. */
     471    bool  m_fInputEnabled;
    453472};
    454473
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