VirtualBox

Changeset 37615 in vbox for trunk


Ignore:
Timestamp:
Jun 23, 2011 2:37:32 PM (13 years ago)
Author:
vboxsync
Message:

FE/Qt: 5748: Another Qt + KDE related issue fixed: Disappearing of settings dialog title and settings page headline.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/settings
Files:
2 edited

Legend:

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

    r37168 r37615  
    268268        m_pWarningPane->setWarningText(m_strWarningHint);
    269269
     270#ifndef VBOX_GUI_WITH_TOOLBAR_SETTINGS
     271    /* Retranslate current page headline: */
     272    m_pLbTitle->setText(m_pSelector->itemText(m_pSelector->currentId()));
     273#endif /* VBOX_GUI_WITH_TOOLBAR_SETTINGS */
     274
    270275    /* Get the list of validators: */
    271276    QList<QIWidgetValidator*> validatorsList = findChildren<QIWidgetValidator*>();
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp

    r37544 r37615  
    470470void UISettingsDialogGlobal::retranslateUi()
    471471{
     472    /* Base-class UI translation: */
     473    UISettingsDialog::retranslateUi();
     474
    472475    /* Set dialog's name: */
    473476    setWindowTitle(title());
     
    499502    /* Translate the selector: */
    500503    m_pSelector->polish();
    501 
    502     /* Base-class UI translation: */
    503     UISettingsDialog::retranslateUi();
    504504}
    505505
     
    562562    connect(&vboxGlobal(), SIGNAL(mediumEnumFinished(const VBoxMediaList &)), this, SLOT(sltAllowResetFirstRunFlag()));
    563563
    564     /* Get corresponding machine (required to determine dialog type): */
     564    /* Get corresponding machine (required to determine dialog type and page availability): */
    565565    m_machine = vboxGlobal().virtualBox().FindMachine(m_strMachineId);
    566566    AssertMsg(!m_machine.isNull(), ("Can't find corresponding machine!\n"));
     
    854854void UISettingsDialogMachine::retranslateUi()
    855855{
     856    /* We have to make sure that the Network, Serial & Parallel pages are retranslated
     857     * before they are revalidated. Cause: They do string comparing within
     858     * vboxGlobal which is retranslated at that point already: */
     859    QEvent event(QEvent::LanguageChange);
     860    if (QWidget *pPage = m_pSelector->idToPage(VMSettingsPage_Network))
     861        qApp->sendEvent(pPage, &event);
     862    if (QWidget *pPage = m_pSelector->idToPage(VMSettingsPage_Serial))
     863        qApp->sendEvent(pPage, &event);
     864    if (QWidget *pPage = m_pSelector->idToPage(VMSettingsPage_Parallel))
     865        qApp->sendEvent(pPage, &event);
     866
     867    /* Base-class UI translation: */
     868    UISettingsDialog::retranslateUi();
     869
    856870    /* Set dialog's name: */
    857871    setWindowTitle(title());
    858872
    859     /* We have to make sure that the Serial & Network subpages are retranslated
    860      * before they are revalidated. Cause: They do string comparing within
    861      * vboxGlobal which is retranslated at that point already. */
    862     QEvent event(QEvent::LanguageChange);
    863 
    864873    /* General page: */
    865874    m_pSelector->setItemText(VMSettingsPage_General, tr("General"));
     
    879888    /* Network page: */
    880889    m_pSelector->setItemText(VMSettingsPage_Network, tr("Network"));
    881     if (QWidget *pPage = m_pSelector->idToPage(VMSettingsPage_Network))
    882         qApp->sendEvent(pPage, &event);
    883890
    884891    /* Ports page: */
     
    887894    /* Serial page: */
    888895    m_pSelector->setItemText(VMSettingsPage_Serial, tr("Serial Ports"));
    889     if (QWidget *pPage = m_pSelector->idToPage(VMSettingsPage_Serial))
    890         qApp->sendEvent(pPage, &event);
    891896
    892897    /* Parallel page: */
    893898    m_pSelector->setItemText(VMSettingsPage_Parallel, tr("Parallel Ports"));
    894     if (QWidget *pPage = m_pSelector->idToPage(VMSettingsPage_Parallel))
    895         qApp->sendEvent(pPage, &event);
    896899
    897900    /* USB page: */
     
    903906    /* Translate the selector: */
    904907    m_pSelector->polish();
    905 
    906     /* Base-class UI translation: */
    907     UISettingsDialog::retranslateUi();
    908 
    909     /* Revalidate all pages to retranslate the warning messages also: */
    910     QList<QIWidgetValidator*> validators = findChildren<QIWidgetValidator*>();
    911     for (int i = 0; i < validators.size(); ++i)
    912     {
    913         QIWidgetValidator *pValidator = validators[i];
    914         if (!pValidator->isValid())
    915             sltRevalidate(pValidator);
    916     }
    917908}
    918909
     
    920911{
    921912    QString strDialogTitle;
    922     if (!m_machine.isNull())
    923         strDialogTitle = tr("%1 - %2").arg(m_machine.GetName()).arg(titleExtension());
     913    /* Get corresponding machine (required to compose dialog title): */
     914    const CMachine &machine = vboxGlobal().virtualBox().FindMachine(m_strMachineId);
     915    if (!machine.isNull())
     916        strDialogTitle = tr("%1 - %2").arg(machine.GetName()).arg(titleExtension());
    924917    return strDialogTitle;
    925918}
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