From 74d3bb7e09ec532e108893f92e00e34e64e7c91b Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 3 Mar 2021 12:53:33 +0100 Subject: [PATCH] GUI: preferences: honor "use ISO 639-3 languages" for all language lists Fixes #3047. --- NEWS.md | 4 ++++ .../main_window/preferences_dialog.cpp | 12 +++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/NEWS.md b/NEWS.md index cab93fa31..85f72c299 100644 --- a/NEWS.md +++ b/NEWS.md @@ -23,6 +23,10 @@ happens when files are dragged & dropped onto the GUI. The same options are available, but they're distinct settings, allowing for different use cases. Fixes #3035. +* MKVToolNix GUI: preferences: the language lists for "deriving track + languages" and "enabling items by language" always included all the ISO + 639-3 languages, even if those weren't enabled in the "often-used languages" + pane. Fixes #3047. # Version 54.0.0 "F Maj Pixie" 2021-02-26 diff --git a/src/mkvtoolnix-gui/main_window/preferences_dialog.cpp b/src/mkvtoolnix-gui/main_window/preferences_dialog.cpp index 784431227..22c24fd26 100644 --- a/src/mkvtoolnix-gui/main_window/preferences_dialog.cpp +++ b/src/mkvtoolnix-gui/main_window/preferences_dialog.cpp @@ -581,10 +581,14 @@ PreferencesDialog::setupJobRemovalPolicy() { void PreferencesDialog::setupCommonLanguages(bool withISO639_3) { auto &allLanguages = withISO639_3 ? App::iso639Languages() : App::iso639_2Languages(); + auto languageItems = QList::fromVector(Util::stdVectorToQVector(allLanguages)); - ui->tbOftenUsedLanguages->setItems(QList::fromVector(Util::stdVectorToQVector(allLanguages)), m_cfg.m_oftenUsedLanguages); + ui->tbOftenUsedLanguages->setItems(languageItems, m_cfg.m_oftenUsedLanguages); ui->cbOftenUsedLanguagesOnly->setChecked(m_cfg.m_oftenUsedLanguagesOnly && !m_cfg.m_oftenUsedLanguages.isEmpty()); enableOftendUsedLanguagesOnly(); + + ui->tbMEnableMuxingTracksByLanguage->setItems(languageItems, m_cfg.m_enableMuxingTracksByTheseLanguages); + ui->tbMDeriveTrackLanguageRecognizedLanguages->setItems(languageItems, m_cfg.m_recognizedTrackLanguagesInFileNames); } void @@ -694,9 +698,6 @@ PreferencesDialog::setupEnableMuxingTracksByLanguage() { ui->cbMEnableMuxingAllVideoTracks->setChecked(m_cfg.m_enableMuxingAllVideoTracks); ui->cbMEnableMuxingAllAudioTracks->setChecked(m_cfg.m_enableMuxingAllAudioTracks); ui->cbMEnableMuxingAllSubtitleTracks->setChecked(m_cfg.m_enableMuxingAllSubtitleTracks); - - auto &allLanguages = App::iso639Languages(); - ui->tbMEnableMuxingTracksByLanguage->setItems(QList::fromVector(Util::stdVectorToQVector(allLanguages)), m_cfg.m_enableMuxingTracksByTheseLanguages); } void @@ -817,9 +818,6 @@ PreferencesDialog::setupDerivingTrackLanguagesFromFileName() { setupComboBox(*ui->cbMDeriveSubtitleTrackLanguageFromFileName, m_cfg.m_deriveSubtitleTrackLanguageFromFileNamePolicy); ui->leMDeriveTrackLanguageCustomRegex->setText(m_cfg.m_regexForDerivingTrackLanguagesFromFileNames); - - ui->tbMDeriveTrackLanguageRecognizedLanguages->setItems(QList::fromVector(Util::stdVectorToQVector(App::iso639Languages())), - m_cfg.m_recognizedTrackLanguagesInFileNames); } void