VirtualBox

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


Ignore:
Timestamp:
Jan 12, 2017 11:03:57 AM (8 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6899: Accessibility support (step 164): UIIndicatorsPool: Common translation procedure for all the indicators and description on the basis of indicators type.

File:
1 edited

Legend:

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

    r65254 r65255  
    6868
    6969    /** Constructor which remembers passed @a session object. */
    70     UISessionStateStatusBarIndicator(IndicatorType enmType, UISession *pSession)
    71         : m_enmType(enmType)
    72         , m_pSession(pSession)
    73     {}
     70    UISessionStateStatusBarIndicator(IndicatorType enmType, UISession *pSession);
    7471
    7572    /** Returns the indicator type. */
    7673    IndicatorType type() const { return m_enmType; }
    7774
     75    /** Returns the indicator description. */
     76    virtual QString description() const { return m_strDescription; }
     77
    7878    /** Abstract update routine. */
    7979    virtual void updateAppearance() = 0;
     
    8181protected:
    8282
     83    /** Handles translation event. */
     84    virtual void retranslateUi() /* override */;
     85
    8386    /** Holds the indicator type. */
    8487    const IndicatorType m_enmType;
     
    8689    /** Holds the session UI reference. */
    8790    UISession *m_pSession;
     91
     92    /** Holds the indicator description. */
     93    QString m_strDescription;
    8894};
     95
     96
     97UISessionStateStatusBarIndicator::UISessionStateStatusBarIndicator(IndicatorType enmType, UISession *pSession)
     98    : m_enmType(enmType)
     99    , m_pSession(pSession)
     100{
     101}
     102
     103void UISessionStateStatusBarIndicator::retranslateUi()
     104{
     105    /* Translate description: */
     106    m_strDescription = tr("%1 status-bar indicator", "like 'hard-disk status-bar indicator'")
     107                         .arg(gpConverter->toString(type()));
     108
     109    /* Update appearance finally: */
     110    updateAppearance();
     111}
     112
    89113
    90114/** UISessionStateStatusBarIndicator extension for Runtime UI: Hard-drive indicator. */
     
    109133
    110134private:
    111 
    112     /** Retranslation routine. */
    113     void retranslateUi()
    114     {
    115         updateAppearance();
    116     }
    117135
    118136    /** Update routine. */
     
    182200
    183201private:
    184 
    185     /** Retranslation routine. */
    186     void retranslateUi()
    187     {
    188         updateAppearance();
    189     }
    190202
    191203    /** Update routine. */
     
    260272private:
    261273
    262     /** Retranslation routine. */
    263     void retranslateUi()
    264     {
    265         updateAppearance();
    266     }
    267 
    268274    /** Update routine. */
    269275    void updateAppearance()
     
    375381
    376382private:
    377 
    378     /** Retranslation routine. */
    379     void retranslateUi()
    380     {
    381         updateAppearance();
    382     }
    383383
    384384    /** Update routine. */
     
    487487private:
    488488
    489     /** Retranslation routine. */
    490     void retranslateUi()
    491     {
    492         updateAppearance();
    493     }
    494 
    495489    /** Update routine. */
    496490    void updateAppearance()
     
    553547private:
    554548
    555     /** Retranslation routine. */
    556     void retranslateUi()
    557     {
    558         updateAppearance();
    559     }
    560 
    561549    /** Update routine. */
    562550    void updateAppearance()
     
    622610
    623611private:
    624 
    625     /** Retranslation routine. */
    626     void retranslateUi()
    627     {
    628         updateAppearance();
    629     }
    630612
    631613    /** Update routine. */
     
    731713
    732714private:
    733 
    734     /** Retranslation routine. */
    735     void retranslateUi()
    736     {
    737         updateAppearance();
    738     }
    739715
    740716    /** Paint-event handler. */
     
    826802private:
    827803
    828     /** Retranslation routine. */
    829     void retranslateUi()
    830     {
    831         updateAppearance();
    832     }
    833 
    834804    /** Update routine. */
    835805    void updateAppearance()
     
    934904private:
    935905
    936     /** Retranslation routine. */
    937     void retranslateUi()
     906    /** Update routine. */
     907    void updateAppearance()
    938908    {
    939909        setToolTip(QApplication::translate("UIIndicatorsPool",
     
    946916                   "Note that the mouse integration feature requires Guest Additions to be installed in the guest OS."));
    947917    }
    948 
    949     /** Update routine. */
    950     void updateAppearance() {}
    951918};
    952919
     
    976943private:
    977944
    978     /** Retranslation routine. */
    979     void retranslateUi()
     945    /** Update routine. */
     946    void updateAppearance()
    980947    {
    981948        setToolTip(QApplication::translate("UIIndicatorsPool",
     
    984951                   "<nobr><img src=:/hostkey_captured_16px.png/>&nbsp;&nbsp;keyboard is captured</nobr>"));
    985952    }
    986 
    987     /** Update routine. */
    988     void updateAppearance() {}
    989953};
    990954
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