VirtualBox

Ignore:
Timestamp:
Nov 11, 2010 10:00:58 AM (14 years ago)
Author:
vboxsync
Message:

FE/Qt: Global settings / Language page refactoring.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/settings/global
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsLanguage.cpp

    r33882 r33961  
    1818 */
    1919
    20 #include "UIGlobalSettingsLanguage.h"
    21 #include "VBoxGlobalSettings.h"
    22 #include "VBoxGlobal.h"
    23 
     20/* Global includes */
     21#include <QDir>
    2422#include <QHeaderView>
     23#include <QPainter>
    2524#include <QTranslator>
    26 #include <QDir>
    27 #include <QPainter>
    2825
    2926#include <iprt/err.h>
     
    3128#include <iprt/path.h>
    3229#include <VBox/version.h>
     30
     31/* Local includes */
     32#include "UIGlobalSettingsLanguage.h"
     33#include "VBoxGlobalSettings.h"
     34#include "VBoxGlobal.h"
    3335
    3436extern const char *gVBoxLangSubDir;
     
    3840extern const char *gVBoxBuiltInLangName;
    3941
    40 class LanguageItem : public QTreeWidgetItem
     42/* Language item: */
     43class UILanguageItem : public QTreeWidgetItem
    4144{
    4245public:
    4346
    44     enum { LanguageItemType = QTreeWidgetItem::UserType + 1 };
    45 
    46     LanguageItem (QTreeWidget *aParent, const QTranslator &aTranslator,
    47                   const QString &aId, bool aBuiltIn = false)
    48         : QTreeWidgetItem (aParent, LanguageItemType), mBuiltIn (aBuiltIn)
    49     {
    50         Assert (!aId.isEmpty());
     47    /* Language item type: */
     48    enum { UILanguageItemType = QTreeWidgetItem::UserType + 1 };
     49
     50    /* Language item constructor: */
     51    UILanguageItem(QTreeWidget *pParent, const QTranslator &translator,
     52                   const QString &strId, bool fBuiltIn = false)
     53        : QTreeWidgetItem(pParent, UILanguageItemType), m_fBuiltIn(fBuiltIn)
     54    {
     55        Assert (!strId.isEmpty());
    5156
    5257        /* Note: context/source/comment arguments below must match strings
     
    5560         * translation files) */
    5661
    57         QString nativeLanguage = tratra (aTranslator,
    58             "@@@", "English", "Native language name");
    59         QString nativeCountry = tratra (aTranslator,
    60             "@@@", "--", "Native language country name "
    61             "(empty if this language is for all countries)");
    62 
    63         QString englishLanguage = tratra (aTranslator,
    64             "@@@", "English", "Language name, in English");
    65         QString englishCountry = tratra (aTranslator,
    66             "@@@", "--", "Language country name, in English "
    67             "(empty if native country name is empty)");
    68 
    69         QString translatorsName = tratra (aTranslator,
    70             "@@@", "Oracle Corporation", "Comma-separated list of translators");
    71 
    72         QString itemName = nativeLanguage;
    73         QString langName = englishLanguage;
    74 
    75         if (!aBuiltIn)
     62        QString strNativeLanguage = tratra(translator, "@@@", "English", "Native language name");
     63        QString strNativeCountry = tratra(translator, "@@@", "--", "Native language country name "
     64                                                                   "(empty if this language is for all countries)");
     65
     66        QString strEnglishLanguage = tratra(translator, "@@@", "English", "Language name, in English");
     67        QString strEnglishCountry = tratra(translator, "@@@", "--", "Language country name, in English "
     68                                                                    "(empty if native country name is empty)");
     69
     70        QString strTranslatorsName = tratra(translator, "@@@", "Oracle Corporation", "Comma-separated list of translators");
     71
     72        QString strItemName = strNativeLanguage;
     73        QString strLanguageName = strEnglishLanguage;
     74
     75        if (!m_fBuiltIn)
    7676        {
    77             if (nativeCountry != "--")
    78                 itemName += " (" + nativeCountry + ")";
    79 
    80             if (englishCountry != "--")
    81                 langName += " (" + englishCountry + ")";
    82 
    83             if (itemName != langName)
    84                 langName = itemName + " / " + langName;
     77            if (strNativeCountry != "--")
     78                strItemName += " (" + strNativeCountry + ")";
     79
     80            if (strEnglishCountry != "--")
     81                strLanguageName += " (" + strEnglishCountry + ")";
     82
     83            if (strItemName != strLanguageName)
     84                strLanguageName = strItemName + " / " + strLanguageName;
    8585        }
    8686        else
    8787        {
    88             itemName += UIGlobalSettingsLanguage::tr (" (built-in)", "Language");
    89             langName += UIGlobalSettingsLanguage::tr (" (built-in)", "Language");
     88            strItemName += UIGlobalSettingsLanguage::tr(" (built-in)", "Language");
     89            strLanguageName += UIGlobalSettingsLanguage::tr(" (built-in)", "Language");
    9090        }
    9191
    92         setText (0, itemName);
    93         setText (1, aId);
    94         setText (2, langName);
    95         setText (3, translatorsName);
    96 
    97         /* Current language appears in bold */
    98         if (text (1) == VBoxGlobal::languageId())
     92        setText(0, strItemName);
     93        setText(1, strId);
     94        setText(2, strLanguageName);
     95        setText(3, strTranslatorsName);
     96
     97        /* Current language appears in bold: */
     98        if (text(1) == VBoxGlobal::languageId())
    9999        {
    100             QFont fnt = font (0);
    101             fnt.setBold (true);
    102             setFont (0, fnt);
     100            QFont fnt = font(0);
     101            fnt.setBold(true);
     102            setFont(0, fnt);
    103103        }
    104104    }
    105105
    106     /* Constructs an item for an invalid language ID (i.e. when a language
    107      * file is missing or corrupt). */
    108     LanguageItem (QTreeWidget *aParent, const QString &aId)
    109         : QTreeWidgetItem (aParent, LanguageItemType), mBuiltIn (false)
    110     {
    111         Assert (!aId.isEmpty());
    112 
    113         setText (0, QString ("<%1>").arg (aId));
    114         setText (1, aId);
    115         setText (2, UIGlobalSettingsLanguage::tr ("<unavailable>", "Language"));
    116         setText (3, UIGlobalSettingsLanguage::tr ("<unknown>", "Author(s)"));
    117 
    118         /* Invalid language appears in italic */
    119         QFont fnt = font (0);
    120         fnt.setItalic (true);
    121         setFont (0, fnt);
    122     }
    123 
    124     /* Constructs an item for the default language ID (column 1 will be set
    125      * to QString::null) */
    126     LanguageItem (QTreeWidget *aParent)
    127         : QTreeWidgetItem (aParent, LanguageItemType), mBuiltIn (false)
    128     {
    129         setText (0, UIGlobalSettingsLanguage::tr ("Default", "Language"));
    130         setText (1, QString::null);
     106    /* Constructs an item for an invalid language ID
     107     * (i.e. when a language file is missing or corrupt): */
     108    UILanguageItem(QTreeWidget *pParent, const QString &strId)
     109        : QTreeWidgetItem(pParent, UILanguageItemType), m_fBuiltIn(false)
     110    {
     111        Assert(!strId.isEmpty());
     112
     113        setText(0, QString("<%1>").arg(strId));
     114        setText(1, strId);
     115        setText(2, UIGlobalSettingsLanguage::tr("<unavailable>", "Language"));
     116        setText(3, UIGlobalSettingsLanguage::tr("<unknown>", "Author(s)"));
     117
     118        /* Invalid language appears in italic: */
     119        QFont fnt = font(0);
     120        fnt.setItalic(true);
     121        setFont(0, fnt);
     122    }
     123
     124    /* Constructs an item for the default language ID
     125     * (column 1 will be set to QString::null): */
     126    UILanguageItem(QTreeWidget *pParent)
     127        : QTreeWidgetItem(pParent, UILanguageItemType), m_fBuiltIn(false)
     128    {
     129        setText(0, UIGlobalSettingsLanguage::tr("Default", "Language"));
     130        setText(1, QString::null);
    131131        /* Empty strings of some reasonable length to prevent the info part
    132132         * from being shrinked too much when the list wants to be wider */
    133         setText (2, "                ");
    134         setText (3, "                ");
    135     }
    136 
    137     bool isBuiltIn() const { return mBuiltIn; }
    138 
    139     bool operator< (const QTreeWidgetItem &aOther) const
    140     {
    141         QString thisId = text (1);
    142         QString thatId = aOther.text (1);
     133        setText(2, "                ");
     134        setText(3, "                ");
     135    }
     136
     137    bool isBuiltIn() const { return m_fBuiltIn; }
     138
     139    bool operator<(const QTreeWidgetItem &other) const
     140    {
     141        QString thisId = text(1);
     142        QString thatId = other.text(1);
    143143        if (thisId.isNull())
    144144            return true;
    145145        if (thatId.isNull())
    146146            return false;
    147         if (mBuiltIn)
     147        if (m_fBuiltIn)
    148148            return true;
    149         if (aOther.type() == LanguageItemType && ((LanguageItem*) &aOther)->mBuiltIn)
     149        if (other.type() == UILanguageItemType && ((UILanguageItem*)&other)->m_fBuiltIn)
    150150            return false;
    151         return QTreeWidgetItem::operator< (aOther);
     151        return QTreeWidgetItem::operator<(other);
    152152    }
    153153
    154154private:
    155155
    156     QString tratra (const QTranslator &aTranslator, const char *aCtxt,
    157                     const char *aSrc, const char *aCmnt)
    158     {
    159         QString msg = aTranslator.translate (aCtxt, aSrc, aCmnt);
    160         /* return the source text if no translation is found */
    161         if (msg.isEmpty())
    162             msg = QString (aSrc);
    163         return msg;
    164     }
    165 
    166     bool mBuiltIn : 1;
     156    QString tratra(const QTranslator &translator, const char *pCtxt,
     157                   const char *pSrc, const char *pCmnt)
     158    {
     159        QString strMsg = translator.translate(pCtxt, pSrc, pCmnt);
     160        /* Return the source text if no translation is found: */
     161        if (strMsg.isEmpty())
     162            strMsg = QString(pSrc);
     163        return strMsg;
     164    }
     165
     166    bool m_fBuiltIn : 1;
    167167};
    168168
    169 
     169/* Language page constructor: */
    170170UIGlobalSettingsLanguage::UIGlobalSettingsLanguage()
    171     : mLanguageChanged(false)
    172 {
    173     /* Apply UI decorations */
    174     Ui::UIGlobalSettingsLanguage::setupUi (this);
    175 
    176     /* Setup dialog */
    177     mTwLanguage->header()->hide();
    178     mTwLanguage->hideColumn (1);
    179     mTwLanguage->hideColumn (2);
    180     mTwLanguage->hideColumn (3);
    181 
    182     /* Setup Connections */
    183     connect (mTwLanguage, SIGNAL (painted (QTreeWidgetItem *, QPainter *)),
    184              this, SLOT (mTwItemPainted (QTreeWidgetItem *, QPainter *)));
    185     connect (mTwLanguage, SIGNAL (currentItemChanged (QTreeWidgetItem *, QTreeWidgetItem *)),
    186              this, SLOT (mTwLanguageChanged (QTreeWidgetItem *)));
    187 
    188     /* Applying language settings */
     171    : m_fIsLanguageChanged(false)
     172{
     173    /* Apply UI decorations: */
     174    Ui::UIGlobalSettingsLanguage::setupUi(this);
     175
     176    /* Setup widgets: */
     177    m_pLanguageTree->header()->hide();
     178    m_pLanguageTree->hideColumn(1);
     179    m_pLanguageTree->hideColumn(2);
     180    m_pLanguageTree->hideColumn(3);
     181
     182    /* Setup connections: */
     183    connect(m_pLanguageTree, SIGNAL(painted(QTreeWidgetItem*, QPainter*)),
     184            this, SLOT(sltLanguageItemPainted(QTreeWidgetItem*, QPainter*)));
     185    connect(m_pLanguageTree, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)),
     186            this, SLOT(sltCurrentLanguageChanged(QTreeWidgetItem*)));
     187
     188    /* Apply language settings: */
    189189    retranslateUi();
    190190}
     
    210210    /* Fetch from cache: */
    211211    reload(m_cache.m_strLanguageId);
    212     mTxName->setFixedHeight(fontMetrics().height() * 4);
     212    m_pLanguageInfo->setFixedHeight(fontMetrics().height() * 4);
    213213}
    214214
     
    218218{
    219219    /* Upload to cache: */
    220     QTreeWidgetItem *pCurrentItem = mTwLanguage->currentItem();
     220    QTreeWidgetItem *pCurrentItem = m_pLanguageTree->currentItem();
    221221    Assert(pCurrentItem);
    222222    if (pCurrentItem)
     
    232232
    233233    /* Save from cache: */
    234     if (mLanguageChanged)
     234    if (m_fIsLanguageChanged)
    235235    {
    236236        m_settings.setLanguageId(m_cache.m_strLanguageId);
     
    242242}
    243243
    244 void UIGlobalSettingsLanguage::setOrderAfter (QWidget *aWidget)
    245 {
    246     setTabOrder (aWidget, mTwLanguage);
    247 }
    248 
    249 void UIGlobalSettingsLanguage::reload (const QString &aLangId)
    250 {
    251     /* Clear languages list */
    252     mTwLanguage->clear();
    253 
    254     /* Load languages list */
    255     char szNlsPath [RTPATH_MAX];
    256     int rc = RTPathAppPrivateNoArch (szNlsPath, sizeof(szNlsPath));
    257     AssertRC (rc);
    258     QString nlsPath = QString (szNlsPath) + gVBoxLangSubDir;
    259     QDir nlsDir (nlsPath);
    260     QStringList files = nlsDir.entryList (QStringList (QString ("%1*%2")
    261         .arg (gVBoxLangFileBase, gVBoxLangFileExt)), QDir::Files);
     244/* Navigation stuff: */
     245void UIGlobalSettingsLanguage::setOrderAfter(QWidget *pWidget)
     246{
     247    setTabOrder(pWidget, m_pLanguageTree);
     248}
     249
     250/* Translation stuff: */
     251void UIGlobalSettingsLanguage::retranslateUi()
     252{
     253    /* Translate uic generated strings: */
     254    Ui::UIGlobalSettingsLanguage::retranslateUi(this);
     255
     256    /* Reload language tree: */
     257    reload(VBoxGlobal::languageId());
     258}
     259
     260/* Reload language tree: */
     261void UIGlobalSettingsLanguage::reload(const QString &strLangId)
     262{
     263    /* Clear languages tree: */
     264    m_pLanguageTree->clear();
     265
     266    /* Load languages tree: */
     267    char szNlsPath[RTPATH_MAX];
     268    int rc = RTPathAppPrivateNoArch(szNlsPath, sizeof(szNlsPath));
     269    AssertRC(rc);
     270    QString strNlsPath = QString(szNlsPath) + gVBoxLangSubDir;
     271    QDir nlsDir(strNlsPath);
     272    QStringList files = nlsDir.entryList(QStringList(QString("%1*%2").arg(gVBoxLangFileBase, gVBoxLangFileExt)), QDir::Files);
    262273
    263274    QTranslator translator;
    264     /* Add the default language */
    265     new LanguageItem (mTwLanguage);
    266     /* Add the built-in language */
    267     new LanguageItem (mTwLanguage, translator, gVBoxBuiltInLangName, true /* built-in */);
     275    /* Add the default language: */
     276    new UILanguageItem(m_pLanguageTree);
     277    /* Add the built-in language: */
     278    new UILanguageItem(m_pLanguageTree, translator, gVBoxBuiltInLangName, true /* built-in */);
    268279    /* Add all existing languages */
    269     for (QStringList::Iterator it = files.begin(); it != files.end(); ++ it)
    270     {
    271         QString fileName = *it;
    272         QRegExp regExp (QString (gVBoxLangFileBase) + gVBoxLangIDRegExp);
    273         int pos = regExp.indexIn (fileName);
    274         if (pos == -1)
     280    for (QStringList::Iterator it = files.begin(); it != files.end(); ++it)
     281    {
     282        QString strFileName = *it;
     283        QRegExp regExp(QString(gVBoxLangFileBase) + gVBoxLangIDRegExp);
     284        int iPos = regExp.indexIn(strFileName);
     285        if (iPos == -1)
    275286            continue;
    276287
    277         /* Skip any English version, cause this is extra handled. */
    278         QString lang = regExp.cap (2);
    279         if (lang.toLower() == "en")
     288        /* Skip any English version, cause this is extra handled: */
     289        QString strLanguage = regExp.cap(2);
     290        if (strLanguage.toLower() == "en")
    280291            continue;
    281292
    282         bool loadOk = translator.load (fileName, nlsPath);
    283         if (!loadOk)
     293        bool fLoadOk = translator.load(strFileName, strNlsPath);
     294        if (!fLoadOk)
    284295            continue;
    285296
    286         new LanguageItem (mTwLanguage, translator, regExp.cap (1));
    287     }
    288 
    289     /* Adjust selector list */
     297        new UILanguageItem(m_pLanguageTree, translator, regExp.cap(1));
     298    }
     299
     300    /* Adjust selector list: */
    290301#ifdef Q_WS_MAC
    291     int width = qMax (static_cast<QAbstractItemView*> (mTwLanguage)
    292         ->sizeHintForColumn (0) + 2 * mTwLanguage->frameWidth() +
    293         QApplication::style()->pixelMetric (QStyle::PM_ScrollBarExtent),
    294         220);
    295     mTwLanguage->setFixedWidth (width);
     302    int width = qMax(static_cast<QAbstractItemView*>(m_pLanguageTree)->sizeHintForColumn(0) +
     303                     2 * m_pLanguageTree->frameWidth() + QApplication::style()->pixelMetric(QStyle::PM_ScrollBarExtent),
     304                     220);
     305    m_pLanguageTree->setFixedWidth(width);
    296306#else /* Q_WS_MAC */
    297     mTwLanguage->setMinimumWidth (static_cast<QAbstractItemView*> (mTwLanguage)
    298         ->sizeHintForColumn (0) + 2 * mTwLanguage->frameWidth() +
    299         QApplication::style()->pixelMetric (QStyle::PM_ScrollBarExtent));
     307    m_pLanguageTree->setMinimumWidth(static_cast<QAbstractItemView*>(m_pLanguageTree)->sizeHintForColumn(0) +
     308                                     2 * m_pLanguageTree->frameWidth() + QApplication::style()->pixelMetric(QStyle::PM_ScrollBarExtent));
    300309#endif /* Q_WS_MAC */
    301     mTwLanguage->resizeColumnToContents (0);
    302 
    303     /* Search for necessary language */
    304     QList<QTreeWidgetItem*> itemsList =
    305         mTwLanguage->findItems (aLangId, Qt::MatchExactly, 1);
    306     QTreeWidgetItem *item = itemsList.isEmpty() ? 0 : itemsList [0];
    307     if (!item)
    308     {
    309         /* Add an item for an invalid language to represent it in the list */
    310         item = new LanguageItem (mTwLanguage, aLangId);
    311         mTwLanguage->resizeColumnToContents (0);
    312     }
    313     Assert (item);
    314     if (item)
    315         mTwLanguage->setCurrentItem (item);
    316 
    317     mTwLanguage->sortItems (0, Qt::AscendingOrder);
    318     mTwLanguage->scrollToItem (item);
    319     mLanguageChanged = false;
    320 }
    321 
    322 void UIGlobalSettingsLanguage::retranslateUi()
    323 {
    324     /* Translate uic generated strings */
    325     Ui::UIGlobalSettingsLanguage::retranslateUi (this);
    326     reload (VBoxGlobal::languageId());
    327 }
    328 
    329 void UIGlobalSettingsLanguage::mTwItemPainted (QTreeWidgetItem *aItem, QPainter *aPainter)
    330 {
    331     if (aItem && aItem->type() == LanguageItem::LanguageItemType)
    332     {
    333         LanguageItem *item = static_cast <LanguageItem*> (aItem);
    334         if (item->isBuiltIn())
     310    m_pLanguageTree->resizeColumnToContents(0);
     311
     312    /* Search for necessary language: */
     313    QList<QTreeWidgetItem*> itemsList = m_pLanguageTree->findItems(strLangId, Qt::MatchExactly, 1);
     314    QTreeWidgetItem *pItem = itemsList.isEmpty() ? 0 : itemsList[0];
     315    if (!pItem)
     316    {
     317        /* Add an pItem for an invalid language to represent it in the list: */
     318        pItem = new UILanguageItem(m_pLanguageTree, strLangId);
     319        m_pLanguageTree->resizeColumnToContents(0);
     320    }
     321    Assert(pItem);
     322    if (pItem)
     323        m_pLanguageTree->setCurrentItem(pItem);
     324
     325    m_pLanguageTree->sortItems(0, Qt::AscendingOrder);
     326    m_pLanguageTree->scrollToItem(pItem);
     327    m_fIsLanguageChanged = false;
     328}
     329
     330/* Routine to paint language items: */
     331void UIGlobalSettingsLanguage::sltLanguageItemPainted(QTreeWidgetItem *pItem, QPainter *pPainter)
     332{
     333    if (pItem && pItem->type() == UILanguageItem::UILanguageItemType)
     334    {
     335        UILanguageItem *pLanguageItem = static_cast<UILanguageItem*>(pItem);
     336        if (pLanguageItem->isBuiltIn())
    335337        {
    336             QRect rect = mTwLanguage->visualItemRect (item);
    337             aPainter->setPen (mTwLanguage->palette().color (QPalette::Mid));
    338             aPainter->drawLine (rect.x(), rect.y() + rect.height() - 1,
    339                                 rect.x() + rect.width(), rect.y() + rect.height() - 1);
     338            QRect rect = m_pLanguageTree->visualItemRect(pLanguageItem);
     339            pPainter->setPen(m_pLanguageTree->palette().color(QPalette::Mid));
     340            pPainter->drawLine(rect.x(), rect.y() + rect.height() - 1,
     341                               rect.x() + rect.width(), rect.y() + rect.height() - 1);
    340342        }
    341343    }
    342344}
    343345
    344 void UIGlobalSettingsLanguage::mTwLanguageChanged (QTreeWidgetItem *aItem)
    345 {
    346     if (!aItem) return;
    347 
    348     /* Disable labels for the Default language item */
    349     bool enabled = !aItem->text (1).isNull();
    350 
    351     mTxName->setEnabled (enabled);
    352     mTxName->setText (QString ("<table>"
    353                                "<tr><td>%1&nbsp;</td><td>%2</td></tr>"
    354                                "<tr><td>%3&nbsp;</td><td>%4</td></tr>"
    355                                "</table>")
    356                       .arg (tr ("Language:"))
    357                       .arg (aItem->text (2))
    358                       .arg (tr ("Author(s):"))
    359                       .arg (aItem->text (3)));
    360 
    361     mLanguageChanged = true;
    362 }
    363 
     346/* Slot to handle currentl language change fact: */
     347void UIGlobalSettingsLanguage::sltCurrentLanguageChanged(QTreeWidgetItem *pItem)
     348{
     349    if (!pItem) return;
     350
     351    /* Disable labels for the Default language item: */
     352    bool fEnabled = !pItem->text (1).isNull();
     353
     354    m_pLanguageInfo->setEnabled(fEnabled);
     355    m_pLanguageInfo->setText(QString("<table>"
     356                             "<tr><td>%1&nbsp;</td><td>%2</td></tr>"
     357                             "<tr><td>%3&nbsp;</td><td>%4</td></tr>"
     358                             "</table>")
     359                             .arg(tr("Language:"))
     360                             .arg(pItem->text(2))
     361                             .arg(tr("Author(s):"))
     362                             .arg(pItem->text(3)));
     363
     364    m_fIsLanguageChanged = true;
     365}
     366
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsLanguage.h

    r33882 r33961  
    2020#define __UIGlobalSettingsLanguage_h__
    2121
     22/* Local includes */
    2223#include "UISettingsPage.h"
    2324#include "UIGlobalSettingsLanguage.gen.h"
     
    3031
    3132/* Global settings / Language page: */
    32 class UIGlobalSettingsLanguage : public UISettingsPageGlobal,
    33                                public Ui::UIGlobalSettingsLanguage
     33class UIGlobalSettingsLanguage : public UISettingsPageGlobal, public Ui::UIGlobalSettingsLanguage
    3434{
    3535    Q_OBJECT;
     
    3737public:
    3838
     39    /* Constructor: */
    3940    UIGlobalSettingsLanguage();
    4041
     
    5556    void saveFromCacheTo(QVariant &data);
    5657
    57     void setOrderAfter (QWidget *aWidget);
     58    /* Navigation stuff: */
     59    void setOrderAfter(QWidget *pWidget);
    5860
    59     void reload (const QString &aLangId);
     61    /* Translation stuff: */
     62    void retranslateUi();
    6063
    61     void retranslateUi();
     64    /* Reload language tree: */
     65    void reload(const QString &strLangId);
    6266
    6367private slots:
    6468
    65     void mTwItemPainted (QTreeWidgetItem *aItem, QPainter *aPainter);
    66     void mTwLanguageChanged (QTreeWidgetItem *aItem);
     69    /* Routine to paint language items: */
     70    void sltLanguageItemPainted(QTreeWidgetItem *pItem, QPainter *pPainter);
     71
     72    /* Slot to handle current language change signal: */
     73    void sltCurrentLanguageChanged(QTreeWidgetItem *pItem);
    6774
    6875private:
    6976
    70     bool mLanguageChanged;
     77    /* Edited flag: */
     78    bool m_fIsLanguageChanged;
    7179
    7280    /* Cache: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsLanguage.ui

    r33882 r33961  
    33 VBox frontends: Qt4 GUI ("VirtualBox"):
    44
    5      Copyright (C) 2008 Oracle Corporation
     5     Copyright (C) 2008-2010 Oracle Corporation
    66
    77     This file is part of VirtualBox Open Source Edition (OSE), as
     
    4141   </item>
    4242   <item row="0" column="1" colspan="2" >
    43     <widget class="QLabel" name="mGbLanguage" >
     43    <widget class="QLabel" name="m_pLanguageLabel" >
    4444     <property name="text" >
    4545      <string>&amp;Interface Language:</string>
    4646     </property>
    4747     <property name="buddy" >
    48       <cstring>mTwLanguage</cstring>
     48      <cstring>m_pLanguageTree</cstring>
    4949     </property>
    5050    </widget>
     
    6767   </item>
    6868   <item row="1" column="2" >
    69     <widget class="QITreeWidget" name="mTwLanguage" >
     69    <widget class="QITreeWidget" name="m_pLanguageTree" >
    7070     <property name="sizePolicy" >
    7171      <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
     
    109109   </item>
    110110   <item row="2" column="2" >
    111     <widget class="QILabel" name="mTxName" >
     111    <widget class="QILabel" name="m_pLanguageInfo" >
    112112     <property name="sizePolicy" >
    113113      <sizepolicy vsizetype="Minimum" hsizetype="Expanding" >
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