- Timestamp:
- Jun 23, 2011 2:37:32 PM (13 years ago)
- 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 268 268 m_pWarningPane->setWarningText(m_strWarningHint); 269 269 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 270 275 /* Get the list of validators: */ 271 276 QList<QIWidgetValidator*> validatorsList = findChildren<QIWidgetValidator*>(); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp
r37544 r37615 470 470 void UISettingsDialogGlobal::retranslateUi() 471 471 { 472 /* Base-class UI translation: */ 473 UISettingsDialog::retranslateUi(); 474 472 475 /* Set dialog's name: */ 473 476 setWindowTitle(title()); … … 499 502 /* Translate the selector: */ 500 503 m_pSelector->polish(); 501 502 /* Base-class UI translation: */503 UISettingsDialog::retranslateUi();504 504 } 505 505 … … 562 562 connect(&vboxGlobal(), SIGNAL(mediumEnumFinished(const VBoxMediaList &)), this, SLOT(sltAllowResetFirstRunFlag())); 563 563 564 /* Get corresponding machine (required to determine dialog type ): */564 /* Get corresponding machine (required to determine dialog type and page availability): */ 565 565 m_machine = vboxGlobal().virtualBox().FindMachine(m_strMachineId); 566 566 AssertMsg(!m_machine.isNull(), ("Can't find corresponding machine!\n")); … … 854 854 void UISettingsDialogMachine::retranslateUi() 855 855 { 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 856 870 /* Set dialog's name: */ 857 871 setWindowTitle(title()); 858 872 859 /* We have to make sure that the Serial & Network subpages are retranslated860 * before they are revalidated. Cause: They do string comparing within861 * vboxGlobal which is retranslated at that point already. */862 QEvent event(QEvent::LanguageChange);863 864 873 /* General page: */ 865 874 m_pSelector->setItemText(VMSettingsPage_General, tr("General")); … … 879 888 /* Network page: */ 880 889 m_pSelector->setItemText(VMSettingsPage_Network, tr("Network")); 881 if (QWidget *pPage = m_pSelector->idToPage(VMSettingsPage_Network))882 qApp->sendEvent(pPage, &event);883 890 884 891 /* Ports page: */ … … 887 894 /* Serial page: */ 888 895 m_pSelector->setItemText(VMSettingsPage_Serial, tr("Serial Ports")); 889 if (QWidget *pPage = m_pSelector->idToPage(VMSettingsPage_Serial))890 qApp->sendEvent(pPage, &event);891 896 892 897 /* Parallel page: */ 893 898 m_pSelector->setItemText(VMSettingsPage_Parallel, tr("Parallel Ports")); 894 if (QWidget *pPage = m_pSelector->idToPage(VMSettingsPage_Parallel))895 qApp->sendEvent(pPage, &event);896 899 897 900 /* USB page: */ … … 903 906 /* Translate the selector: */ 904 907 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 }917 908 } 918 909 … … 920 911 { 921 912 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()); 924 917 return strDialogTitle; 925 918 }
Note:
See TracChangeset
for help on using the changeset viewer.