From feff8a2bdb957a04ee6362991af19a665be39fef Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sat, 5 Sep 2015 15:39:03 +0200 Subject: [PATCH] GUI: merge: fix default track column content when disabling tracks See #1353. --- src/mkvtoolnix-gui/merge/input.cpp | 10 +++++++++- src/mkvtoolnix-gui/merge/track_model.cpp | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/mkvtoolnix-gui/merge/input.cpp b/src/mkvtoolnix-gui/merge/input.cpp index 18d76d096..1984346dd 100644 --- a/src/mkvtoolnix-gui/merge/input.cpp +++ b/src/mkvtoolnix-gui/merge/input.cpp @@ -540,6 +540,8 @@ Tab::onTrackItemChanged(QStandardItem *item) { Util::setComboBoxIndexIf(ui->muxThis, [newMuxThis](QString const &, QVariant const &data) { return data.isValid() && (data.toBool() == newMuxThis); }); setOutputFileNameMaybe(); + + m_tracksModel->updateEffectiveDefaultTrackFlags(); } void @@ -552,6 +554,8 @@ Tab::onMuxThisChanged(int selected) { withSelectedTracks([&](Track *track) { track->m_muxThis = muxThis; }); setOutputFileNameMaybe(); + + m_tracksModel->updateEffectiveDefaultTrackFlags(); } void @@ -566,14 +570,18 @@ Tab::toggleMuxThisForSelectedTracks() { allEnabled = false; }, false, ui->muxThis); - if (!tracksSelected) + if (!tracksSelected) { + m_tracksModel->updateEffectiveDefaultTrackFlags(); return; + } auto newEnabled = !allEnabled; withSelectedTracks([newEnabled](Track *track) { track->m_muxThis = newEnabled; }, false, ui->muxThis); Util::setComboBoxIndexIf(ui->muxThis, [&](QString const &, QVariant const &data) { return data.isValid() && (data.toBool() == newEnabled); }); + + m_tracksModel->updateEffectiveDefaultTrackFlags(); } void diff --git a/src/mkvtoolnix-gui/merge/track_model.cpp b/src/mkvtoolnix-gui/merge/track_model.cpp index d967d130c..5af909a50 100644 --- a/src/mkvtoolnix-gui/merge/track_model.cpp +++ b/src/mkvtoolnix-gui/merge/track_model.cpp @@ -653,7 +653,7 @@ TrackModel::updateEffectiveDefaultTrackFlags() { track->m_effectiveDefaultTrackFlag = false; } - for (auto &track : regularEnabledTracks) + for (auto &track : *m_tracks) trackUpdated(track); }