diff options
author | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2014-06-17 00:20:16 +0200 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2014-06-17 00:08:51 +0000 |
commit | 11243e3977291c2b7bcacf5be5bbe0bde09ba773 (patch) | |
tree | a1b39c2b133e365643843154f5e6f3cddeb81015 /ui | |
parent | 923cf412f1362ff9a65d4cd35436257a37f0fd05 (diff) | |
download | wireshark-11243e3977291c2b7bcacf5be5bbe0bde09ba773.tar.gz |
Qt: fix loading of language translation
But need always restart to apply change...
Based on http://qt-project.org/wiki/How_to_create_a_multi_language_application
Change-Id: I0f95afb68aa5b125e0707b0af1ce096dab9c29e4
Reviewed-on: https://code.wireshark.org/review/2286
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/qt/main_window.cpp | 19 | ||||
-rw-r--r-- | ui/qt/main_window.h | 2 |
2 files changed, 21 insertions, 0 deletions
diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp index 9a4adce43e..3dc1efbf79 100644 --- a/ui/qt/main_window.cpp +++ b/ui/qt/main_window.cpp @@ -1545,6 +1545,25 @@ void MainWindow::updateForUnsavedChanges() { } +void MainWindow::changeEvent(QEvent* event) +{ + if(0 != event) + { + switch(event->type()) + { + // this event is send if a translator is loaded + case QEvent::LanguageChange: + main_ui_->retranslateUi(this); + break; + default: + break; + } + + } + + QMainWindow::changeEvent(event); +} + /* Update main window items based on whether there's a capture in progress. */ void MainWindow::setForCaptureInProgress(gboolean capture_in_progress) { diff --git a/ui/qt/main_window.h b/ui/qt/main_window.h index 9534d6b2f5..916bbe7d2b 100644 --- a/ui/qt/main_window.h +++ b/ui/qt/main_window.h @@ -377,6 +377,8 @@ private slots: void on_actionTelephonyRTSPPacketCounter_triggered(); void on_actionTelephonySMPPOperations_triggered(); void on_actionTelephonyUCPMessages_triggered(); + + void changeEvent(QEvent* event); }; #endif // MAINWINDOW_H |