mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 05:05:20 -05:00
Rockbox Utility: listen to translation change events.
When changing the language don't require a restart anymore. Instead listen to the appropriate changeEvent and retranslate the UI. Designer generated UI files already provide such a function. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30633 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
d25341a032
commit
2e3de70401
21 changed files with 151 additions and 12 deletions
|
|
@ -57,6 +57,8 @@
|
|||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
QList<QTranslator*> RbUtilQt::translators;
|
||||
|
||||
RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent)
|
||||
{
|
||||
// startup log
|
||||
|
|
@ -1380,3 +1382,13 @@ void RbUtilQt::downloadUpdateDone(bool error)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void RbUtilQt::changeEvent(QEvent *e)
|
||||
{
|
||||
if(e->type() == QEvent::LanguageChange) {
|
||||
ui.retranslateUi(this);
|
||||
} else {
|
||||
QMainWindow::changeEvent(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue