From 9d175ac3165df36f55867b5f757c62d26be56624 Mon Sep 17 00:00:00 2001 From: Martchus Date: Sat, 1 Jun 2019 12:54:22 +0200 Subject: [PATCH] Add info about automatic insertion from search results --- gui/dbquerywidget.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gui/dbquerywidget.cpp b/gui/dbquerywidget.cpp index b2bc763..eb1257d 100644 --- a/gui/dbquerywidget.cpp +++ b/gui/dbquerywidget.cpp @@ -336,7 +336,18 @@ void DbQueryWidget::applyMatchingResults(TagEdit *tagEdit) } // apply results for matching row - applyResults(tagEdit, m_model->index(row, 0)); + const auto rowIndex = m_model->index(row, 0); + applyResults(tagEdit, rowIndex); + + // select the row which has just been applied + if (auto *const selectionModel = m_ui->resultsTreeView->selectionModel()) { + selectionModel->select(rowIndex, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); + } + + m_tagEditorWidget->addParsingNotificationLine( + tr("Inserted search result row %1 (with title \"%2\", album \"%3\" and artist \"%4\").") + .arg(row + 1) + .arg(tagValueToQString(rowTitle), tagValueToQString(rowAlbum), tagValueToQString(rowArtist))); // just take the first matching row for now break;