From 40d31b8b8a2ae85e0c406fe87828542ead0c6745 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 1 Feb 2022 22:03:10 -0500 Subject: [PATCH] configure_filesystem: Add missing changeEvent() override This allows the dialog to be retranslated during runtime if the language is changed. --- src/yuzu/configuration/configure_filesystem.cpp | 8 ++++++++ src/yuzu/configuration/configure_filesystem.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/yuzu/configuration/configure_filesystem.cpp b/src/yuzu/configuration/configure_filesystem.cpp index 55247ebcc..d6fb43f8b 100644 --- a/src/yuzu/configuration/configure_filesystem.cpp +++ b/src/yuzu/configuration/configure_filesystem.cpp @@ -38,6 +38,14 @@ ConfigureFilesystem::ConfigureFilesystem(QWidget* parent) ConfigureFilesystem::~ConfigureFilesystem() = default; +void ConfigureFilesystem::changeEvent(QEvent* event) { + if (event->type() == QEvent::LanguageChange) { + RetranslateUI(); + } + + QWidget::changeEvent(event); +} + void ConfigureFilesystem::SetConfiguration() { ui->nand_directory_edit->setText( QString::fromStdString(Common::FS::GetYuzuPathString(Common::FS::YuzuPath::NANDDir))); diff --git a/src/yuzu/configuration/configure_filesystem.h b/src/yuzu/configuration/configure_filesystem.h index 0c86ee445..b4f9355eb 100644 --- a/src/yuzu/configuration/configure_filesystem.h +++ b/src/yuzu/configuration/configure_filesystem.h @@ -23,6 +23,8 @@ public: void ApplyConfiguration(); private: + void changeEvent(QEvent* event) override; + void RetranslateUI(); void SetConfiguration();