From c55daeec38dad507da24aafdb5a1edd5bc460fd7 Mon Sep 17 00:00:00 2001 From: thalieht Date: Sun, 29 Jul 2018 15:24:12 +0300 Subject: [PATCH 1/2] Set "enter" as shortcut to download the selected torrents in search job --- src/gui/search/searchjobwidget.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/search/searchjobwidget.cpp b/src/gui/search/searchjobwidget.cpp index 20385f0f2..f73b295c3 100644 --- a/src/gui/search/searchjobwidget.cpp +++ b/src/gui/search/searchjobwidget.cpp @@ -151,6 +151,9 @@ SearchJobWidget::SearchJobWidget(SearchHandler *searchHandler, QWidget *parent) connect(searchHandler, &SearchHandler::searchFinished, this, &SearchJobWidget::searchFinished); connect(searchHandler, &SearchHandler::searchFailed, this, &SearchJobWidget::searchFailed); connect(this, &QObject::destroyed, searchHandler, &QObject::deleteLater); + + QShortcut *enterHotkey = new QShortcut(Qt::Key_Return, m_ui->resultsBrowser, nullptr, nullptr, Qt::WidgetShortcut); + connect(enterHotkey, &QShortcut::activated, this, &SearchJobWidget::downloadTorrents); } SearchJobWidget::~SearchJobWidget() From ce3e68670d01987f2bac470a3b4e0a013b90c54c Mon Sep 17 00:00:00 2001 From: thalieht Date: Sun, 29 Jul 2018 15:33:06 +0300 Subject: [PATCH 2/2] Refactor in searchjob to always color visited entries Now it colors multiple entries, when visited at once, via the hotkey or the Download button. --- src/gui/search/searchjobwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/search/searchjobwidget.cpp b/src/gui/search/searchjobwidget.cpp index f73b295c3..0d99600ed 100644 --- a/src/gui/search/searchjobwidget.cpp +++ b/src/gui/search/searchjobwidget.cpp @@ -164,7 +164,6 @@ SearchJobWidget::~SearchJobWidget() void SearchJobWidget::onItemDoubleClicked(const QModelIndex &index) { - setRowColor(index.row(), QApplication::palette().color(QPalette::LinkVisited)); downloadTorrent(index); } @@ -257,6 +256,7 @@ void SearchJobWidget::downloadTorrent(const QModelIndex &rowIndex) connect(downloadHandler, &SearchDownloadHandler::downloadFinished, this, &SearchJobWidget::addTorrentToSession); connect(downloadHandler, &SearchDownloadHandler::downloadFinished, downloadHandler, &SearchDownloadHandler::deleteLater); } + setRowColor(rowIndex.row(), QApplication::palette().color(QPalette::LinkVisited)); } void SearchJobWidget::addTorrentToSession(const QString &source)