Add checkbox for "Excluded file names"

PR #17206.
This commit is contained in:
thalieht 2022-06-15 08:16:01 +03:00 committed by GitHub
parent 7faa8b7a02
commit d1515456bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 83 additions and 30 deletions

View file

@ -375,6 +375,7 @@ OptionsDialog::OptionsDialog(QWidget *parent)
connect(m_ui->checkUseDownloadPath, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkUseDownloadPath, &QAbstractButton::toggled, m_ui->textDownloadPath, &QWidget::setEnabled);
connect(m_ui->addWatchedFolderButton, &QAbstractButton::clicked, this, &ThisType::enableApplyButton);
connect(m_ui->groupExcludedFileNames, &QGroupBox::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->textExcludedFileNames, &QPlainTextEdit::textChanged, this, &ThisType::enableApplyButton);
connect(m_ui->removeWatchedFolderButton, &QAbstractButton::clicked, this, &ThisType::enableApplyButton);
connect(m_ui->groupMailNotification, &QGroupBox::toggled, this, &ThisType::enableApplyButton);
@ -758,6 +759,7 @@ void OptionsDialog::saveOptions()
session->setTorrentContentLayout(static_cast<BitTorrent::TorrentContentLayout>(m_ui->contentLayoutComboBox->currentIndex()));
auto watchedFoldersModel = static_cast<WatchedFoldersModel *>(m_ui->scanFoldersView->model());
watchedFoldersModel->apply();
session->setExcludedFileNamesEnabled(m_ui->groupExcludedFileNames->isChecked());
session->setExcludedFileNames(m_ui->textExcludedFileNames->toPlainText().split(u'\n', Qt::SkipEmptyParts));
session->setTorrentExportDirectory(getTorrentExportDir());
session->setFinishedTorrentExportDirectory(getFinishedTorrentExportDir());
@ -1018,6 +1020,7 @@ void OptionsDialog::loadOptions()
m_ui->checkAppendqB->setChecked(session->isAppendExtensionEnabled());
m_ui->checkPreallocateAll->setChecked(session->isPreallocationEnabled());
m_ui->checkRecursiveDownload->setChecked(!pref->recursiveDownloadDisabled());
m_ui->groupExcludedFileNames->setChecked(session->isExcludedFileNamesEnabled());
m_ui->textExcludedFileNames->setPlainText(session->excludedFileNames().join(u'\n'));
if (session->torrentExportDirectory().isEmpty())