From 78d69bcbf090f605215ad5db784bc3e91470e834 Mon Sep 17 00:00:00 2001 From: thalieht Date: Fri, 28 Jan 2022 22:18:09 +0200 Subject: [PATCH 1/2] Add Select All/None buttons in new torrent dialog --- src/gui/addnewtorrentdialog.cpp | 4 +- src/gui/addnewtorrentdialog.ui | 69 +++++++++++++++++++++++++-------- 2 files changed, 56 insertions(+), 17 deletions(-) diff --git a/src/gui/addnewtorrentdialog.cpp b/src/gui/addnewtorrentdialog.cpp index cf86b1dbd..c41bccc27 100644 --- a/src/gui/addnewtorrentdialog.cpp +++ b/src/gui/addnewtorrentdialog.cpp @@ -201,7 +201,7 @@ AddNewTorrentDialog::AddNewTorrentDialog(const BitTorrent::AddTorrentParams &inP m_ui->startTorrentCheckBox->setChecked(!m_torrentParams.addPaused.value_or(session->isAddTorrentPaused())); - m_ui->comboTTM->blockSignals(true); // the TreeView size isn't correct if the slot does it job at this point + m_ui->comboTTM->blockSignals(true); // the TreeView size isn't correct if the slot does its job at this point m_ui->comboTTM->setCurrentIndex(session->isAutoTMMDisabledByDefault() ? 0 : 1); m_ui->comboTTM->blockSignals(false); @@ -899,6 +899,8 @@ void AddNewTorrentDialog::setupTreeview() connect(m_ui->contentTreeView, &QAbstractItemView::clicked, m_ui->contentTreeView , qOverload(&QAbstractItemView::edit)); connect(m_ui->contentTreeView, &QWidget::customContextMenuRequested, this, &AddNewTorrentDialog::displayContentTreeMenu); + connect(m_ui->buttonSelectAll, &QPushButton::clicked, m_contentModel, &TorrentContentFilterModel::selectAll); + connect(m_ui->buttonSelectNone, &QPushButton::clicked, m_contentModel, &TorrentContentFilterModel::selectNone); const auto contentLayout = ((m_ui->contentLayoutComboBox->currentIndex() == 0) ? BitTorrent::detectContentLayout(m_torrentInfo.filePaths()) diff --git a/src/gui/addnewtorrentdialog.ui b/src/gui/addnewtorrentdialog.ui index 9a444a3a5..1089c6970 100644 --- a/src/gui/addnewtorrentdialog.ui +++ b/src/gui/addnewtorrentdialog.ui @@ -392,22 +392,59 @@ - - - - 1 - 0 - - - - Qt::CustomContextMenu - - - QAbstractItemView::ExtendedSelection - - - true - + + + + + + + + Select All + + + + + + + Select None + + + + + + + Qt::Horizontal + + + + 168 + 20 + + + + + + + + + + + 1 + 0 + + + + Qt::CustomContextMenu + + + QAbstractItemView::ExtendedSelection + + + true + + + + From a8ad4f784adead4b167863fef449e157313b2190 Mon Sep 17 00:00:00 2001 From: thalieht Date: Sun, 30 Jan 2022 18:39:56 +0200 Subject: [PATCH 2/2] Fix "Free space on disk" in new torrent dialog Always initialize it. --- src/gui/addnewtorrentdialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/addnewtorrentdialog.cpp b/src/gui/addnewtorrentdialog.cpp index c41bccc27..4d989bcd3 100644 --- a/src/gui/addnewtorrentdialog.cpp +++ b/src/gui/addnewtorrentdialog.cpp @@ -991,9 +991,9 @@ void AddNewTorrentDialog::TMMChanged(int index) m_ui->groupBoxDownloadPath->blockSignals(true); m_ui->groupBoxDownloadPath->setChecked(!downloadPath.isEmpty()); - - updateDiskSpaceLabel(); } + + updateDiskSpaceLabel(); } void AddNewTorrentDialog::doNotDeleteTorrentClicked(bool checked)