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.
This commit is contained in:
zhupengfei
2018-07-24 12:23:38 +08:00
parent 87872aa369
commit 2cf7576351
4 changed files with 7 additions and 1 deletions

View File

@@ -79,4 +79,5 @@ void ConfigureGeneral::onLanguageChanged(int index) {
void ConfigureGeneral::retranslateUi() { void ConfigureGeneral::retranslateUi() {
ui->retranslateUi(this); ui->retranslateUi(this);
ui->hotkeysDialog->retranslateUi();
} }

View File

@@ -201,7 +201,7 @@
<item> <item>
<layout class="QVBoxLayout" name="verticalLayout_4"> <layout class="QVBoxLayout" name="verticalLayout_4">
<item> <item>
<widget class="GHotkeysDialog" name="widget" native="true"/> <widget class="GHotkeysDialog" name="hotkeysDialog" native="true"/>
</item> </item>
</layout> </layout>
</item> </item>

View File

@@ -88,3 +88,7 @@ GHotkeysDialog::GHotkeysDialog(QWidget* parent) : QWidget(parent) {
ui.treeWidget->resizeColumnToContents(0); ui.treeWidget->resizeColumnToContents(0);
ui.treeWidget->resizeColumnToContents(1); ui.treeWidget->resizeColumnToContents(1);
} }
void GHotkeysDialog::retranslateUi() {
ui.retranslateUi(this);
}

View File

@@ -58,6 +58,7 @@ class GHotkeysDialog : public QWidget {
public: public:
explicit GHotkeysDialog(QWidget* parent = nullptr); explicit GHotkeysDialog(QWidget* parent = nullptr);
void retranslateUi();
private: private:
Ui::hotkeys ui; Ui::hotkeys ui;