Просмотр исходного кода

configure_filesystem: Add missing changeEvent() override

This allows the dialog to be retranslated during runtime if the language
is changed.
Lioncash 4 лет назад
Родитель
Сommit
40d31b8b8a

+ 8 - 0
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)));

+ 2 - 0
src/yuzu/configuration/configure_filesystem.h

@@ -23,6 +23,8 @@ public:
     void ApplyConfiguration();
 
 private:
+    void changeEvent(QEvent* event) override;
+
     void RetranslateUI();
     void SetConfiguration();