VirtualBox

Ignore:
Timestamp:
May 23, 2014 3:59:40 PM (11 years ago)
Author:
vboxsync
Message:

FE/Qt: 7386: Translate action shortcut descriptions on language-change.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp

    r51267 r51375  
    4747/* UIAction stuff: */
    4848UIAction::UIAction(UIActionPool *pParent, UIActionType type)
    49     : QIWithRetranslateUI3<QAction>(pParent)
     49    : QAction(pParent)
    5050    , m_pActionPool(pParent)
    5151    , m_type(type)
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.h

    r51267 r51375  
    6969
    7070/* Basic abstract QAction reimplemetation, extending interface: */
    71 class UIAction : public QIWithRetranslateUI3<QAction>
     71class UIAction : public QAction
    7272{
    7373    Q_OBJECT;
     
    9797    void showShortcut();
    9898    void hideShortcut();
     99
     100    /** Calls for action translation handler. */
     101    virtual void retranslateUi() = 0;
    99102
    100103protected:
     
    230233
    231234/* Singleton action pool: */
    232 class UIActionPool : public QObject
     235class UIActionPool : public QIWithRetranslateUI3<QObject>
    233236{
    234237    Q_OBJECT;
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp

    r50309 r51375  
    12461246    /* Prepare connections: */
    12471247    connect(gShortcutPool, SIGNAL(sigMachineShortcutsReloaded()), this, SLOT(sltApplyShortcuts()));
     1248}
     1249
     1250void UIActionPoolRuntime::retranslateUi()
     1251{
     1252    /* Translate all the actions: */
     1253    foreach (const int iActionPoolKey, m_pool.keys())
     1254        m_pool[iActionPoolKey]->retranslateUi();
     1255    /* Re-apply shortcuts: */
     1256    sltApplyShortcuts();
    12481257}
    12491258
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.h

    r50309 r51375  
    103103    UIActionPoolRuntime();
    104104
     105    /** Translation handler. */
     106    void retranslateUi();
     107
    105108    /* Helper: Shortcuts stuff: */
    106109    QString shortcutsExtraDataID() const;
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.cpp

    r51267 r51375  
    981981}
    982982
     983void UIActionPoolSelector::retranslateUi()
     984{
     985    /* Translate all the actions: */
     986    foreach (const int iActionPoolKey, m_pool.keys())
     987        m_pool[iActionPoolKey]->retranslateUi();
     988    /* Re-apply shortcuts: */
     989    sltApplyShortcuts();
     990}
     991
    983992QString UIActionPoolSelector::shortcutsExtraDataID() const
    984993{
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.h

    r44448 r51375  
    8383    UIActionPoolSelector();
    8484
     85    /** Translation handler. */
     86    void retranslateUi();
     87
    8588    /* Helper: Shortcuts stuff: */
    8689    QString shortcutsExtraDataID() const;
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