VirtualBox

Changeset 2328 in vbox


Ignore:
Timestamp:
Apr 24, 2007 2:18:21 PM (18 years ago)
Author:
vboxsync
Message:

FE/Qt: Fixed: On Linux, the details text, the VM state names didn't immediately change the language a language change.

File:
1 edited

Legend:

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

    r2327 r2328  
    28172817bool VBoxGlobal::eventFilter (QObject *aObject, QEvent *aEvent)
    28182818{
    2819     if (aObject == QApplication::desktop() &&
    2820         aEvent->type() == QEvent::LanguageChange)
    2821         languageChange();
     2819    if (aEvent->type() == QEvent::LanguageChange &&
     2820        aObject->isWidgetType() &&
     2821        static_cast <QWidget *> (aObject)->isTopLevel())
     2822    {
     2823        /* Catch the language change event before any other widget gets it in
     2824         * order to invalidate cached string resources (like the details view
     2825         * templates) that may be used by other widgets. */
     2826        QWidgetList *list = QApplication::topLevelWidgets();
     2827        if (list->first() == aObject)
     2828        {
     2829            /* call this only once per every language change (see
     2830             * QApplication::installTranslator() for details) */
     2831            languageChange();
     2832        }
     2833        delete list;
     2834    }
     2835
    28222836    return QObject::eventFilter (aObject, aEvent);
    28232837}
     
    29382952    vm_state_color.insert (CEnums::Discarding,          &Qt::green);
    29392953
    2940     QApplication::desktop()->installEventFilter (this);
     2954    qApp->installEventFilter (this);
    29412955
    29422956    // create default non-null global settings
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