VirtualBox

Changeset 105195 in vbox


Ignore:
Timestamp:
Jul 8, 2024 5:52:35 PM (5 months ago)
Author:
vboxsync
Message:

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

File:
1 edited

Legend:

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

    r105193 r105195  
    406406    UIIndicatorAudio(UIMachine *pMachine)
    407407        : UISessionStateStatusBarIndicator(IndicatorType_Audio, pMachine)
     408        , m_fOutputEnabled(false)
     409        , m_fInputEnabled(false)
    408410    {
    409411        /* Assign state-icons: */
     
    483485    UIIndicatorNetwork(UIMachine *pMachine)
    484486        : UISessionStateStatusBarIndicator(IndicatorType_Network, pMachine)
     487        , m_fAdaptersPresent(false)
     488        , m_fCablesDisconnected(true)
    485489    {
    486490        /* Assign state-icons: */
     
    504508    {
    505509        QString strFullData;
    506         bool fAdaptersPresent = false;
    507         bool fCablesDisconnected = true;
    508         m_pMachine->acquireNetworkStatusInfo(strFullData, fAdaptersPresent, fCablesDisconnected);
     510        m_fAdaptersPresent = false;
     511        m_fCablesDisconnected = true;
     512        m_pMachine->acquireNetworkStatusInfo(strFullData, m_fAdaptersPresent, m_fCablesDisconnected);
    509513
    510514        /* Show/hide indicator if there are no attachments
     
    512516        if (   parentWidget()
    513517            && parentWidget()->isVisible())
    514             setVisible(fAdaptersPresent);
     518            setVisible(m_fAdaptersPresent);
    515519
    516520        /* Update tool-tip: */
     
    518522            setToolTip(s_strTable.arg(strFullData));
    519523        /* Update indicator state: */
    520         setState(fAdaptersPresent && !fCablesDisconnected ? KDeviceActivity_Idle : KDeviceActivity_Null);
    521     }
     524        setState(m_fAdaptersPresent && !m_fCablesDisconnected ? KDeviceActivity_Idle : KDeviceActivity_Null);
     525    }
     526
     527    /** Handles translation event. */
     528    virtual void sltRetranslateUI() RT_OVERRIDE
     529    {
     530        /* Call to base-class: */
     531        UISessionStateStatusBarIndicator::sltRetranslateUI();
     532
     533        /* Append description with more info: */
     534        const QString strAdaptersStatus = m_fAdaptersPresent ? tr("Adapters present") : tr("No network adapters");
     535        const QString strCablesStatus = m_fCablesDisconnected ? tr("All cables disconnected") : QString();
     536        m_strDescription = QString("%1, %2, %3").arg(m_strDescription, strAdaptersStatus, strCablesStatus);
     537    }
     538
     539private:
     540
     541    /** Holds whether adapters present. */
     542    bool  m_fAdaptersPresent;
     543    /** Holds whether cables disconnected. */
     544    bool  m_fCablesDisconnected;
    522545};
    523546
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