From 2cf7576351246db61e782a64df977365253d65a6 Mon Sep 17 00:00:00 2001 From: zhupengfei Date: Tue, 24 Jul 2018 12:23:38 +0800 Subject: [PATCH] citra_qt/configuration: retranslate hotkey widget on language change The hotkey widget has a separate class defined for it, and qt cannot automatically retranslate it when retranslateUi is called. This commit explicitly calls the function to retranslate the hotkey dialog. --- src/citra_qt/configuration/configure_general.cpp | 1 + src/citra_qt/configuration/configure_general.ui | 2 +- src/citra_qt/hotkeys.cpp | 4 ++++ src/citra_qt/hotkeys.h | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/citra_qt/configuration/configure_general.cpp b/src/citra_qt/configuration/configure_general.cpp index d89a7984c4..73ad3d7905 100644 --- a/src/citra_qt/configuration/configure_general.cpp +++ b/src/citra_qt/configuration/configure_general.cpp @@ -79,4 +79,5 @@ void ConfigureGeneral::onLanguageChanged(int index) { void ConfigureGeneral::retranslateUi() { ui->retranslateUi(this); + ui->hotkeysDialog->retranslateUi(); } diff --git a/src/citra_qt/configuration/configure_general.ui b/src/citra_qt/configuration/configure_general.ui index 7a949979ab..0c972259f8 100644 --- a/src/citra_qt/configuration/configure_general.ui +++ b/src/citra_qt/configuration/configure_general.ui @@ -201,7 +201,7 @@ - + diff --git a/src/citra_qt/hotkeys.cpp b/src/citra_qt/hotkeys.cpp index 158ed506f9..167a9060a8 100644 --- a/src/citra_qt/hotkeys.cpp +++ b/src/citra_qt/hotkeys.cpp @@ -88,3 +88,7 @@ GHotkeysDialog::GHotkeysDialog(QWidget* parent) : QWidget(parent) { ui.treeWidget->resizeColumnToContents(0); ui.treeWidget->resizeColumnToContents(1); } + +void GHotkeysDialog::retranslateUi() { + ui.retranslateUi(this); +} diff --git a/src/citra_qt/hotkeys.h b/src/citra_qt/hotkeys.h index a4ccc193ba..9964226ab2 100644 --- a/src/citra_qt/hotkeys.h +++ b/src/citra_qt/hotkeys.h @@ -58,6 +58,7 @@ class GHotkeysDialog : public QWidget { public: explicit GHotkeysDialog(QWidget* parent = nullptr); + void retranslateUi(); private: Ui::hotkeys ui;