summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt/preview.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2011-10-02 14:30:05 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2011-10-02 14:30:05 +0000
commit2e3de70401379c044fdd3696e7cc6dc78aace808 (patch)
tree1e208b0dc8be1d0377f0c47533d3e839448473f6 /rbutil/rbutilqt/preview.cpp
parentd25341a032a19985af85c72b95964bef812971c3 (diff)
downloadrockbox-2e3de70401379c044fdd3696e7cc6dc78aace808.tar.gz
rockbox-2e3de70401379c044fdd3696e7cc6dc78aace808.zip
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
Diffstat (limited to 'rbutil/rbutilqt/preview.cpp')
-rw-r--r--rbutil/rbutilqt/preview.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/rbutil/rbutilqt/preview.cpp b/rbutil/rbutilqt/preview.cpp
index be1430c6a1..57b590966c 100644
--- a/rbutil/rbutilqt/preview.cpp
+++ b/rbutil/rbutilqt/preview.cpp
@@ -54,6 +54,16 @@ void PreviewDlg::leaveEvent(QEvent * event)
54 this->close(); 54 this->close();
55} 55}
56 56
57
58void PreviewDlg::changeEvent(QEvent *e)
59{
60 if(e->type() == QEvent::LanguageChange) {
61 ui.retranslateUi(this);
62 } else {
63 QWidget::changeEvent(e);
64 }
65}
66
57PreviewLabel::PreviewLabel(QWidget * parent, Qt::WindowFlags f) 67PreviewLabel::PreviewLabel(QWidget * parent, Qt::WindowFlags f)
58 :QLabel(parent,f) 68 :QLabel(parent,f)
59{ 69{