Vladimir Golovnev
2 years ago
committed by
GitHub
26 changed files with 1571 additions and 1167 deletions
@ -0,0 +1,170 @@ |
|||||||
|
/*
|
||||||
|
* Bittorrent Client using Qt and libtorrent. |
||||||
|
* Copyright (C) 2015-2023 Vladimir Golovnev <glassez@yandex.ru> |
||||||
|
* |
||||||
|
* This program is free software; you can redistribute it and/or |
||||||
|
* modify it under the terms of the GNU General Public License |
||||||
|
* as published by the Free Software Foundation; either version 2 |
||||||
|
* of the License, or (at your option) any later version. |
||||||
|
* |
||||||
|
* This program is distributed in the hope that it will be useful, |
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
* GNU General Public License for more details. |
||||||
|
* |
||||||
|
* You should have received a copy of the GNU General Public License |
||||||
|
* along with this program; if not, write to the Free Software |
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||||
|
* |
||||||
|
* In addition, as a special exception, the copyright holders give permission to |
||||||
|
* link this program with the OpenSSL project's "OpenSSL" library (or with |
||||||
|
* modified versions of it that use the same license as the "OpenSSL" library), |
||||||
|
* and distribute the linked executables. You must obey the GNU General Public |
||||||
|
* License in all respects for all of the code used other than "OpenSSL". If you |
||||||
|
* modify file(s), you may extend this exception to your version of the file(s), |
||||||
|
* but you are not obligated to do so. If you do not wish to do so, delete this |
||||||
|
* exception statement from your version. |
||||||
|
*/ |
||||||
|
|
||||||
|
#include "addtorrentparams.h" |
||||||
|
|
||||||
|
#include <tuple> |
||||||
|
|
||||||
|
#include <QJsonArray> |
||||||
|
#include <QJsonObject> |
||||||
|
#include <QJsonValue> |
||||||
|
|
||||||
|
#include "base/utils/string.h" |
||||||
|
|
||||||
|
const QString PARAM_CATEGORY = u"category"_qs; |
||||||
|
const QString PARAM_TAGS = u"tags"_qs; |
||||||
|
const QString PARAM_SAVEPATH = u"save_path"_qs; |
||||||
|
const QString PARAM_USEDOWNLOADPATH = u"use_download_path"_qs; |
||||||
|
const QString PARAM_DOWNLOADPATH = u"download_path"_qs; |
||||||
|
const QString PARAM_OPERATINGMODE = u"operating_mode"_qs; |
||||||
|
const QString PARAM_QUEUETOP = u"add_to_top_of_queue"_qs; |
||||||
|
const QString PARAM_STOPPED = u"stopped"_qs; |
||||||
|
const QString PARAM_SKIPCHECKING = u"skip_checking"_qs; |
||||||
|
const QString PARAM_CONTENTLAYOUT = u"content_layout"_qs; |
||||||
|
const QString PARAM_AUTOTMM = u"use_auto_tmm"_qs; |
||||||
|
const QString PARAM_UPLOADLIMIT = u"upload_limit"_qs; |
||||||
|
const QString PARAM_DOWNLOADLIMIT = u"download_limit"_qs; |
||||||
|
const QString PARAM_SEEDINGTIMELIMIT = u"seeding_time_limit"_qs; |
||||||
|
const QString PARAM_RATIOLIMIT = u"ratio_limit"_qs; |
||||||
|
|
||||||
|
namespace |
||||||
|
{ |
||||||
|
TagSet parseTagSet(const QJsonArray &jsonArr) |
||||||
|
{ |
||||||
|
TagSet tags; |
||||||
|
for (const QJsonValue &jsonVal : jsonArr) |
||||||
|
tags.insert(jsonVal.toString()); |
||||||
|
|
||||||
|
return tags; |
||||||
|
} |
||||||
|
|
||||||
|
QJsonArray serializeTagSet(const TagSet &tags) |
||||||
|
{ |
||||||
|
QJsonArray arr; |
||||||
|
for (const QString &tag : tags) |
||||||
|
arr.append(tag); |
||||||
|
|
||||||
|
return arr; |
||||||
|
} |
||||||
|
|
||||||
|
std::optional<bool> getOptionalBool(const QJsonObject &jsonObj, const QString &key) |
||||||
|
{ |
||||||
|
const QJsonValue jsonVal = jsonObj.value(key); |
||||||
|
if (jsonVal.isUndefined() || jsonVal.isNull()) |
||||||
|
return std::nullopt; |
||||||
|
|
||||||
|
return jsonVal.toBool(); |
||||||
|
} |
||||||
|
|
||||||
|
template <typename Enum> |
||||||
|
std::optional<Enum> getOptionalEnum(const QJsonObject &jsonObj, const QString &key) |
||||||
|
{ |
||||||
|
const QJsonValue jsonVal = jsonObj.value(key); |
||||||
|
if (jsonVal.isUndefined() || jsonVal.isNull()) |
||||||
|
return std::nullopt; |
||||||
|
|
||||||
|
return Utils::String::toEnum<Enum>(jsonVal.toString(), {}); |
||||||
|
} |
||||||
|
|
||||||
|
template <typename Enum> |
||||||
|
Enum getEnum(const QJsonObject &jsonObj, const QString &key) |
||||||
|
{ |
||||||
|
const QJsonValue jsonVal = jsonObj.value(key); |
||||||
|
return Utils::String::toEnum<Enum>(jsonVal.toString(), {}); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
bool BitTorrent::operator==(const AddTorrentParams &lhs, const AddTorrentParams &rhs) |
||||||
|
{ |
||||||
|
return std::tie(lhs.name, lhs.category, lhs.tags, |
||||||
|
lhs.savePath, lhs.useDownloadPath, lhs.downloadPath, |
||||||
|
lhs.sequential, lhs.firstLastPiecePriority, lhs.addForced, |
||||||
|
lhs.addToQueueTop, lhs.addPaused, lhs.stopCondition, |
||||||
|
lhs.filePaths, lhs.filePriorities, lhs.skipChecking, |
||||||
|
lhs.contentLayout, lhs.useAutoTMM, lhs.uploadLimit, |
||||||
|
lhs.downloadLimit, lhs.seedingTimeLimit, lhs.ratioLimit) |
||||||
|
== std::tie(rhs.name, rhs.category, rhs.tags, |
||||||
|
rhs.savePath, rhs.useDownloadPath, rhs.downloadPath, |
||||||
|
rhs.sequential, rhs.firstLastPiecePriority, rhs.addForced, |
||||||
|
rhs.addToQueueTop, rhs.addPaused, rhs.stopCondition, |
||||||
|
rhs.filePaths, rhs.filePriorities, rhs.skipChecking, |
||||||
|
rhs.contentLayout, rhs.useAutoTMM, rhs.uploadLimit, |
||||||
|
rhs.downloadLimit, rhs.seedingTimeLimit, rhs.ratioLimit); |
||||||
|
} |
||||||
|
|
||||||
|
BitTorrent::AddTorrentParams BitTorrent::parseAddTorrentParams(const QJsonObject &jsonObj) |
||||||
|
{ |
||||||
|
AddTorrentParams params; |
||||||
|
params.category = jsonObj.value(PARAM_CATEGORY).toString(); |
||||||
|
params.tags = parseTagSet(jsonObj.value(PARAM_TAGS).toArray()); |
||||||
|
params.savePath = Path(jsonObj.value(PARAM_SAVEPATH).toString()); |
||||||
|
params.useDownloadPath = getOptionalBool(jsonObj, PARAM_USEDOWNLOADPATH); |
||||||
|
params.downloadPath = Path(jsonObj.value(PARAM_DOWNLOADPATH).toString()); |
||||||
|
params.addForced = (getEnum<BitTorrent::TorrentOperatingMode>(jsonObj, PARAM_OPERATINGMODE) == BitTorrent::TorrentOperatingMode::Forced); |
||||||
|
params.addToQueueTop = getOptionalBool(jsonObj, PARAM_QUEUETOP); |
||||||
|
params.addPaused = getOptionalBool(jsonObj, PARAM_STOPPED); |
||||||
|
params.skipChecking = jsonObj.value(PARAM_SKIPCHECKING).toBool(); |
||||||
|
params.contentLayout = getOptionalEnum<BitTorrent::TorrentContentLayout>(jsonObj, PARAM_CONTENTLAYOUT); |
||||||
|
params.useAutoTMM = getOptionalBool(jsonObj, PARAM_AUTOTMM); |
||||||
|
params.uploadLimit = jsonObj.value(PARAM_UPLOADLIMIT).toInt(-1); |
||||||
|
params.downloadLimit = jsonObj.value(PARAM_DOWNLOADLIMIT).toInt(-1); |
||||||
|
params.seedingTimeLimit = jsonObj.value(PARAM_SEEDINGTIMELIMIT).toInt(BitTorrent::Torrent::USE_GLOBAL_SEEDING_TIME); |
||||||
|
params.ratioLimit = jsonObj.value(PARAM_RATIOLIMIT).toDouble(BitTorrent::Torrent::USE_GLOBAL_RATIO); |
||||||
|
|
||||||
|
return params; |
||||||
|
} |
||||||
|
|
||||||
|
QJsonObject BitTorrent::serializeAddTorrentParams(const AddTorrentParams ¶ms) |
||||||
|
{ |
||||||
|
QJsonObject jsonObj { |
||||||
|
{PARAM_CATEGORY, params.category}, |
||||||
|
{PARAM_TAGS, serializeTagSet(params.tags)}, |
||||||
|
{PARAM_SAVEPATH, params.savePath.data()}, |
||||||
|
{PARAM_DOWNLOADPATH, params.downloadPath.data()}, |
||||||
|
{PARAM_OPERATINGMODE, Utils::String::fromEnum(params.addForced |
||||||
|
? BitTorrent::TorrentOperatingMode::Forced : BitTorrent::TorrentOperatingMode::AutoManaged)}, |
||||||
|
{PARAM_SKIPCHECKING, params.skipChecking}, |
||||||
|
{PARAM_UPLOADLIMIT, params.uploadLimit}, |
||||||
|
{PARAM_DOWNLOADLIMIT, params.downloadLimit}, |
||||||
|
{PARAM_SEEDINGTIMELIMIT, params.seedingTimeLimit}, |
||||||
|
{PARAM_RATIOLIMIT, params.ratioLimit} |
||||||
|
}; |
||||||
|
|
||||||
|
if (params.addToQueueTop) |
||||||
|
jsonObj[PARAM_QUEUETOP] = *params.addToQueueTop; |
||||||
|
if (params.addPaused) |
||||||
|
jsonObj[PARAM_STOPPED] = *params.addPaused; |
||||||
|
if (params.contentLayout) |
||||||
|
jsonObj[PARAM_CONTENTLAYOUT] = Utils::String::fromEnum(*params.contentLayout); |
||||||
|
if (params.useAutoTMM) |
||||||
|
jsonObj[PARAM_AUTOTMM] = *params.useAutoTMM; |
||||||
|
if (params.useDownloadPath) |
||||||
|
jsonObj[PARAM_USEDOWNLOADPATH] = *params.useDownloadPath; |
||||||
|
|
||||||
|
return jsonObj; |
||||||
|
} |
@ -0,0 +1,392 @@ |
|||||||
|
/*
|
||||||
|
* Bittorrent Client using Qt and libtorrent. |
||||||
|
* Copyright (C) 2023 Vladimir Golovnev <glassez@yandex.ru> |
||||||
|
* |
||||||
|
* This program is free software; you can redistribute it and/or |
||||||
|
* modify it under the terms of the GNU General Public License |
||||||
|
* as published by the Free Software Foundation; either version 2 |
||||||
|
* of the License, or (at your option) any later version. |
||||||
|
* |
||||||
|
* This program is distributed in the hope that it will be useful, |
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
* GNU General Public License for more details. |
||||||
|
* |
||||||
|
* You should have received a copy of the GNU General Public License |
||||||
|
* along with this program; if not, write to the Free Software |
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||||
|
* |
||||||
|
* In addition, as a special exception, the copyright holders give permission to |
||||||
|
* link this program with the OpenSSL project's "OpenSSL" library (or with |
||||||
|
* modified versions of it that use the same license as the "OpenSSL" library), |
||||||
|
* and distribute the linked executables. You must obey the GNU General Public |
||||||
|
* License in all respects for all of the code used other than "OpenSSL". If you |
||||||
|
* modify file(s), you may extend this exception to your version of the file(s), |
||||||
|
* but you are not obligated to do so. If you do not wish to do so, delete this |
||||||
|
* exception statement from your version. |
||||||
|
*/ |
||||||
|
|
||||||
|
#include "addtorrentparamswidget.h" |
||||||
|
|
||||||
|
#include <QVariant> |
||||||
|
|
||||||
|
#include "base/bittorrent/session.h" |
||||||
|
#include "base/bittorrent/torrent.h" |
||||||
|
#include "base/utils/compare.h" |
||||||
|
#include "flowlayout.h" |
||||||
|
#include "fspathedit.h" |
||||||
|
#include "torrenttagsdialog.h" |
||||||
|
#include "ui_addtorrentparamswidget.h" |
||||||
|
|
||||||
|
namespace |
||||||
|
{ |
||||||
|
std::optional<bool> toOptionalBool(const QVariant &data) |
||||||
|
{ |
||||||
|
if (!data.isValid()) |
||||||
|
return std::nullopt; |
||||||
|
|
||||||
|
Q_ASSERT(data.userType() == QMetaType::Bool); |
||||||
|
return data.toBool(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
AddTorrentParamsWidget::AddTorrentParamsWidget(BitTorrent::AddTorrentParams addTorrentParams, QWidget *parent) |
||||||
|
: QWidget(parent) |
||||||
|
, m_ui {new Ui::AddTorrentParamsWidget} |
||||||
|
, m_addTorrentParams {std::move(addTorrentParams)} |
||||||
|
{ |
||||||
|
m_ui->setupUi(this); |
||||||
|
|
||||||
|
m_ui->savePathEdit->setMode(FileSystemPathEdit::Mode::DirectorySave); |
||||||
|
m_ui->savePathEdit->setDialogCaption(tr("Choose save path")); |
||||||
|
|
||||||
|
m_ui->downloadPathEdit->setMode(FileSystemPathEdit::Mode::DirectorySave); |
||||||
|
m_ui->downloadPathEdit->setDialogCaption(tr("Choose save path")); |
||||||
|
|
||||||
|
m_ui->useDownloadPathComboBox->addItem(tr("Default")); |
||||||
|
m_ui->useDownloadPathComboBox->addItem(tr("Yes"), true); |
||||||
|
m_ui->useDownloadPathComboBox->addItem(tr("No"), false); |
||||||
|
|
||||||
|
m_ui->comboTTM->addItem(tr("Default")); |
||||||
|
m_ui->comboTTM->addItem(tr("Manual"), false); |
||||||
|
m_ui->comboTTM->addItem(tr("Automatic"), true); |
||||||
|
|
||||||
|
m_ui->contentLayoutComboBox->addItem(tr("Default")); |
||||||
|
m_ui->contentLayoutComboBox->addItem(tr("Original"), QVariant::fromValue(BitTorrent::TorrentContentLayout::Original)); |
||||||
|
m_ui->contentLayoutComboBox->addItem(tr("Create subfolder"), QVariant::fromValue(BitTorrent::TorrentContentLayout::Subfolder)); |
||||||
|
m_ui->contentLayoutComboBox->addItem(tr("Don't create subfolder"), QVariant::fromValue(BitTorrent::TorrentContentLayout::NoSubfolder)); |
||||||
|
|
||||||
|
m_ui->stopConditionComboBox->addItem(tr("Default")); |
||||||
|
m_ui->stopConditionComboBox->addItem(tr("None"), QVariant::fromValue(BitTorrent::Torrent::StopCondition::None)); |
||||||
|
m_ui->stopConditionComboBox->addItem(tr("Metadata received"), QVariant::fromValue(BitTorrent::Torrent::StopCondition::MetadataReceived)); |
||||||
|
m_ui->stopConditionComboBox->addItem(tr("Files checked"), QVariant::fromValue(BitTorrent::Torrent::StopCondition::FilesChecked)); |
||||||
|
|
||||||
|
m_ui->startTorrentComboBox->addItem(tr("Default")); |
||||||
|
m_ui->startTorrentComboBox->addItem(tr("Yes"), true); |
||||||
|
m_ui->startTorrentComboBox->addItem(tr("No"), false); |
||||||
|
|
||||||
|
m_ui->addToQueueTopComboBox->addItem(tr("Default")); |
||||||
|
m_ui->addToQueueTopComboBox->addItem(tr("Yes"), true); |
||||||
|
m_ui->addToQueueTopComboBox->addItem(tr("No"), false); |
||||||
|
|
||||||
|
connect(m_ui->tagsEditButton, &QAbstractButton::clicked, this, [this] |
||||||
|
{ |
||||||
|
auto *dlg = new TorrentTagsDialog(m_addTorrentParams.tags, this); |
||||||
|
dlg->setAttribute(Qt::WA_DeleteOnClose); |
||||||
|
connect(dlg, &TorrentTagsDialog::accepted, this, [this, dlg] |
||||||
|
{ |
||||||
|
m_addTorrentParams.tags = dlg->tags(); |
||||||
|
m_ui->tagsLineEdit->setText(m_addTorrentParams.tags.join(u", "_qs)); |
||||||
|
}); |
||||||
|
dlg->open(); |
||||||
|
}); |
||||||
|
|
||||||
|
auto *miscParamsLayout = new FlowLayout(m_ui->miscParamsWidget); |
||||||
|
miscParamsLayout->setContentsMargins(0, 0, 0, 0); |
||||||
|
miscParamsLayout->addWidget(m_ui->contentLayoutWidget); |
||||||
|
miscParamsLayout->addWidget(m_ui->skipCheckingCheckBox); |
||||||
|
miscParamsLayout->setAlignment(m_ui->skipCheckingCheckBox, Qt::AlignVCenter); |
||||||
|
miscParamsLayout->addWidget(m_ui->startTorrentWidget); |
||||||
|
miscParamsLayout->addWidget(m_ui->stopConditionWidget); |
||||||
|
miscParamsLayout->addWidget(m_ui->addToQueueTopWidget); |
||||||
|
|
||||||
|
populate(); |
||||||
|
} |
||||||
|
|
||||||
|
AddTorrentParamsWidget::~AddTorrentParamsWidget() |
||||||
|
{ |
||||||
|
delete m_ui; |
||||||
|
} |
||||||
|
|
||||||
|
void AddTorrentParamsWidget::setAddTorrentParams(BitTorrent::AddTorrentParams addTorrentParams) |
||||||
|
{ |
||||||
|
m_addTorrentParams = std::move(addTorrentParams); |
||||||
|
populate(); |
||||||
|
} |
||||||
|
|
||||||
|
BitTorrent::AddTorrentParams AddTorrentParamsWidget::addTorrentParams() const |
||||||
|
{ |
||||||
|
return m_addTorrentParams; |
||||||
|
} |
||||||
|
|
||||||
|
void AddTorrentParamsWidget::populate() |
||||||
|
{ |
||||||
|
m_ui->comboTTM->disconnect(this); |
||||||
|
m_ui->comboTTM->setCurrentIndex(m_addTorrentParams.useAutoTMM |
||||||
|
? m_ui->comboTTM->findData(*m_addTorrentParams.useAutoTMM) : 0); |
||||||
|
connect(m_ui->comboTTM, &QComboBox::currentIndexChanged, this, [this] |
||||||
|
{ |
||||||
|
m_addTorrentParams.useAutoTMM = toOptionalBool(m_ui->comboTTM->currentData()); |
||||||
|
|
||||||
|
populateSavePathOptions(); |
||||||
|
}); |
||||||
|
|
||||||
|
m_ui->categoryComboBox->disconnect(this); |
||||||
|
m_ui->categoryComboBox->clear(); |
||||||
|
QStringList categories = BitTorrent::Session::instance()->categories(); |
||||||
|
std::sort(categories.begin(), categories.end(), Utils::Compare::NaturalLessThan<Qt::CaseInsensitive>()); |
||||||
|
if (!m_addTorrentParams.category.isEmpty()) |
||||||
|
m_ui->categoryComboBox->addItem(m_addTorrentParams.category); |
||||||
|
m_ui->categoryComboBox->addItem(u""_qs); |
||||||
|
for (const QString &category : asConst(categories)) |
||||||
|
{ |
||||||
|
if (category != m_addTorrentParams.category) |
||||||
|
m_ui->categoryComboBox->addItem(category); |
||||||
|
} |
||||||
|
connect(m_ui->categoryComboBox, &QComboBox::currentIndexChanged, this, [this] |
||||||
|
{ |
||||||
|
m_addTorrentParams.category = m_ui->categoryComboBox->currentText(); |
||||||
|
|
||||||
|
const auto *btSession = BitTorrent::Session::instance(); |
||||||
|
const bool useAutoTMM = m_addTorrentParams.useAutoTMM.value_or(!btSession->isAutoTMMDisabledByDefault()); |
||||||
|
if (useAutoTMM) |
||||||
|
{ |
||||||
|
const auto downloadPathOption = btSession->categoryOptions(m_addTorrentParams.category).downloadPath; |
||||||
|
m_ui->useDownloadPathComboBox->setCurrentIndex(downloadPathOption.has_value() |
||||||
|
? m_ui->useDownloadPathComboBox->findData(downloadPathOption->enabled) : 0); |
||||||
|
} |
||||||
|
|
||||||
|
populateDefaultPaths(); |
||||||
|
}); |
||||||
|
|
||||||
|
m_ui->savePathEdit->disconnect(this); |
||||||
|
m_ui->downloadPathEdit->disconnect(this); |
||||||
|
m_ui->useDownloadPathComboBox->disconnect(this); |
||||||
|
|
||||||
|
populateSavePathOptions(); |
||||||
|
|
||||||
|
connect(m_ui->savePathEdit, &FileSystemPathLineEdit::selectedPathChanged, this, [this] |
||||||
|
{ |
||||||
|
m_addTorrentParams.savePath = m_ui->savePathEdit->selectedPath(); |
||||||
|
}); |
||||||
|
connect(m_ui->downloadPathEdit, &FileSystemPathLineEdit::selectedPathChanged, this, [this] |
||||||
|
{ |
||||||
|
m_addTorrentParams.downloadPath = m_ui->downloadPathEdit->selectedPath(); |
||||||
|
}); |
||||||
|
connect(m_ui->useDownloadPathComboBox, &QComboBox::currentIndexChanged, this, [this] |
||||||
|
{ |
||||||
|
m_addTorrentParams.useDownloadPath = toOptionalBool(m_ui->useDownloadPathComboBox->currentData()); |
||||||
|
|
||||||
|
loadCustomDownloadPath(); |
||||||
|
}); |
||||||
|
|
||||||
|
m_ui->contentLayoutComboBox->disconnect(this); |
||||||
|
m_ui->contentLayoutComboBox->setCurrentIndex(m_addTorrentParams.contentLayout |
||||||
|
? m_ui->contentLayoutComboBox->findData(QVariant::fromValue(*m_addTorrentParams.contentLayout)) : 0); |
||||||
|
connect(m_ui->contentLayoutComboBox, &QComboBox::currentIndexChanged, this, [this] |
||||||
|
{ |
||||||
|
const QVariant data = m_ui->contentLayoutComboBox->currentData(); |
||||||
|
if (!data.isValid()) |
||||||
|
m_addTorrentParams.contentLayout = std::nullopt; |
||||||
|
else |
||||||
|
m_addTorrentParams.contentLayout = data.value<BitTorrent::TorrentContentLayout>(); |
||||||
|
}); |
||||||
|
|
||||||
|
m_ui->stopConditionComboBox->disconnect(this); |
||||||
|
m_ui->stopConditionComboBox->setCurrentIndex(m_addTorrentParams.stopCondition |
||||||
|
? m_ui->stopConditionComboBox->findData(QVariant::fromValue(*m_addTorrentParams.stopCondition)) : 0); |
||||||
|
connect(m_ui->stopConditionComboBox, &QComboBox::currentIndexChanged, this, [this] |
||||||
|
{ |
||||||
|
const QVariant data = m_ui->stopConditionComboBox->currentData(); |
||||||
|
if (!data.isValid()) |
||||||
|
m_addTorrentParams.stopCondition = std::nullopt; |
||||||
|
else |
||||||
|
m_addTorrentParams.stopCondition = data.value<BitTorrent::Torrent::StopCondition>(); |
||||||
|
}); |
||||||
|
|
||||||
|
m_ui->tagsLineEdit->setText(m_addTorrentParams.tags.join(u", "_qs)); |
||||||
|
|
||||||
|
m_ui->startTorrentComboBox->disconnect(this); |
||||||
|
m_ui->startTorrentComboBox->setCurrentIndex(m_addTorrentParams.addPaused |
||||||
|
? m_ui->startTorrentComboBox->findData(!*m_addTorrentParams.addPaused) : 0); |
||||||
|
connect(m_ui->startTorrentComboBox, &QComboBox::currentIndexChanged, this, [this] |
||||||
|
{ |
||||||
|
const QVariant data = m_ui->startTorrentComboBox->currentData(); |
||||||
|
if (!data.isValid()) |
||||||
|
m_addTorrentParams.addPaused = std::nullopt; |
||||||
|
else |
||||||
|
m_addTorrentParams.addPaused = !data.toBool(); |
||||||
|
}); |
||||||
|
|
||||||
|
m_ui->skipCheckingCheckBox->disconnect(this); |
||||||
|
m_ui->skipCheckingCheckBox->setChecked(m_addTorrentParams.skipChecking); |
||||||
|
connect(m_ui->skipCheckingCheckBox, &QCheckBox::toggled, this, [this] |
||||||
|
{ |
||||||
|
m_addTorrentParams.skipChecking = m_ui->skipCheckingCheckBox->isChecked(); |
||||||
|
}); |
||||||
|
|
||||||
|
m_ui->addToQueueTopComboBox->disconnect(this); |
||||||
|
m_ui->addToQueueTopComboBox->setCurrentIndex(m_addTorrentParams.addToQueueTop |
||||||
|
? m_ui->addToQueueTopComboBox->findData(*m_addTorrentParams.addToQueueTop) : 0); |
||||||
|
connect(m_ui->addToQueueTopComboBox, &QComboBox::currentIndexChanged, this, [this] |
||||||
|
{ |
||||||
|
const QVariant data = m_ui->addToQueueTopComboBox->currentData(); |
||||||
|
if (!data.isValid()) |
||||||
|
m_addTorrentParams.addToQueueTop = std::nullopt; |
||||||
|
else |
||||||
|
m_addTorrentParams.addToQueueTop = data.toBool(); |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
void AddTorrentParamsWidget::loadCustomSavePathOptions() |
||||||
|
{ |
||||||
|
[[maybe_unused]] const auto *btSession = BitTorrent::Session::instance(); |
||||||
|
Q_ASSERT(!m_addTorrentParams.useAutoTMM.value_or(!btSession->isAutoTMMDisabledByDefault())); |
||||||
|
|
||||||
|
m_ui->savePathEdit->setSelectedPath(m_addTorrentParams.savePath); |
||||||
|
|
||||||
|
m_ui->useDownloadPathComboBox->setCurrentIndex(m_addTorrentParams.useDownloadPath |
||||||
|
? m_ui->useDownloadPathComboBox->findData(*m_addTorrentParams.useDownloadPath) : 0); |
||||||
|
|
||||||
|
loadCustomDownloadPath(); |
||||||
|
} |
||||||
|
|
||||||
|
void AddTorrentParamsWidget::loadCustomDownloadPath() |
||||||
|
{ |
||||||
|
populateDefaultDownloadPath(); |
||||||
|
|
||||||
|
if (!m_addTorrentParams.useDownloadPath.has_value()) |
||||||
|
{ |
||||||
|
// Default "Download path" settings
|
||||||
|
|
||||||
|
m_ui->downloadPathEdit->setEnabled(false); |
||||||
|
m_ui->downloadPathEdit->blockSignals(true); |
||||||
|
m_ui->downloadPathEdit->setSelectedPath(Path()); |
||||||
|
} |
||||||
|
else |
||||||
|
{ |
||||||
|
// Overridden "Download path" settings
|
||||||
|
|
||||||
|
const bool useDownloadPath = m_addTorrentParams.useDownloadPath.value(); |
||||||
|
if (useDownloadPath) |
||||||
|
{ |
||||||
|
m_ui->downloadPathEdit->setSelectedPath(m_addTorrentParams.downloadPath); |
||||||
|
|
||||||
|
m_ui->downloadPathEdit->blockSignals(false); |
||||||
|
m_ui->downloadPathEdit->setEnabled(true); |
||||||
|
} |
||||||
|
else |
||||||
|
{ |
||||||
|
m_ui->downloadPathEdit->setEnabled(false); |
||||||
|
m_ui->downloadPathEdit->blockSignals(true); |
||||||
|
|
||||||
|
m_ui->downloadPathEdit->setSelectedPath(Path()); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
void AddTorrentParamsWidget::loadCategorySavePathOptions() |
||||||
|
{ |
||||||
|
const auto *btSession = BitTorrent::Session::instance(); |
||||||
|
Q_ASSERT(m_addTorrentParams.useAutoTMM.value_or(!btSession->isAutoTMMDisabledByDefault())); |
||||||
|
|
||||||
|
const auto downloadPathOption = btSession->categoryOptions(m_addTorrentParams.category).downloadPath; |
||||||
|
m_ui->useDownloadPathComboBox->setCurrentIndex(downloadPathOption.has_value() |
||||||
|
? m_ui->useDownloadPathComboBox->findData(downloadPathOption->enabled) : 0); |
||||||
|
} |
||||||
|
|
||||||
|
void AddTorrentParamsWidget::populateDefaultPaths() |
||||||
|
{ |
||||||
|
const auto *btSession = BitTorrent::Session::instance(); |
||||||
|
|
||||||
|
const Path defaultSavePath = btSession->suggestedSavePath( |
||||||
|
m_ui->categoryComboBox->currentText(), toOptionalBool(m_ui->comboTTM->currentData())); |
||||||
|
m_ui->savePathEdit->setPlaceholder(defaultSavePath); |
||||||
|
|
||||||
|
populateDefaultDownloadPath(); |
||||||
|
} |
||||||
|
|
||||||
|
void AddTorrentParamsWidget::populateDefaultDownloadPath() |
||||||
|
{ |
||||||
|
const auto *btSession = BitTorrent::Session::instance(); |
||||||
|
|
||||||
|
const std::optional<bool> useDownloadPath = toOptionalBool(m_ui->useDownloadPathComboBox->currentData()); |
||||||
|
if (useDownloadPath.value_or(btSession->isDownloadPathEnabled())) |
||||||
|
{ |
||||||
|
const Path defaultDownloadPath = btSession->suggestedDownloadPath( |
||||||
|
m_ui->categoryComboBox->currentText(), toOptionalBool(m_ui->comboTTM->currentData())); |
||||||
|
m_ui->downloadPathEdit->setPlaceholder(defaultDownloadPath); |
||||||
|
} |
||||||
|
else |
||||||
|
{ |
||||||
|
m_ui->downloadPathEdit->setPlaceholder(Path()); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
void AddTorrentParamsWidget::populateSavePathOptions() |
||||||
|
{ |
||||||
|
if (!m_addTorrentParams.useAutoTMM.has_value()) |
||||||
|
{ |
||||||
|
// Default TMM settings
|
||||||
|
|
||||||
|
m_ui->groupBoxSavePath->setEnabled(false); |
||||||
|
m_ui->defaultsNoteLabel->setVisible(true); |
||||||
|
m_ui->savePathEdit->blockSignals(true); |
||||||
|
m_ui->savePathEdit->setSelectedPath(Path()); |
||||||
|
m_ui->downloadPathEdit->blockSignals(true); |
||||||
|
m_ui->useDownloadPathComboBox->blockSignals(true); |
||||||
|
m_ui->downloadPathEdit->setSelectedPath(Path()); |
||||||
|
|
||||||
|
const auto *btSession = BitTorrent::Session::instance(); |
||||||
|
const bool useAutoTMM = !btSession->isAutoTMMDisabledByDefault(); |
||||||
|
|
||||||
|
if (useAutoTMM) |
||||||
|
{ |
||||||
|
loadCategorySavePathOptions(); |
||||||
|
} |
||||||
|
else |
||||||
|
{ |
||||||
|
m_ui->useDownloadPathComboBox->setCurrentIndex( |
||||||
|
m_ui->useDownloadPathComboBox->findData(btSession->isDownloadPathEnabled())); |
||||||
|
} |
||||||
|
} |
||||||
|
else |
||||||
|
{ |
||||||
|
// Overridden TMM settings
|
||||||
|
|
||||||
|
const bool useAutoTMM = m_addTorrentParams.useAutoTMM.value(); |
||||||
|
if (useAutoTMM) |
||||||
|
{ |
||||||
|
m_ui->groupBoxSavePath->setEnabled(false); |
||||||
|
m_ui->defaultsNoteLabel->setVisible(true); |
||||||
|
m_ui->savePathEdit->blockSignals(true); |
||||||
|
m_ui->savePathEdit->setSelectedPath(Path()); |
||||||
|
m_ui->downloadPathEdit->blockSignals(true); |
||||||
|
m_ui->useDownloadPathComboBox->blockSignals(true); |
||||||
|
m_ui->downloadPathEdit->setSelectedPath(Path()); |
||||||
|
|
||||||
|
loadCategorySavePathOptions(); |
||||||
|
} |
||||||
|
else |
||||||
|
{ |
||||||
|
loadCustomSavePathOptions(); |
||||||
|
|
||||||
|
m_ui->groupBoxSavePath->setEnabled(true); |
||||||
|
m_ui->defaultsNoteLabel->setVisible(false); |
||||||
|
m_ui->savePathEdit->blockSignals(false); |
||||||
|
m_ui->useDownloadPathComboBox->blockSignals(false); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
populateDefaultPaths(); |
||||||
|
} |
@ -0,0 +1,64 @@ |
|||||||
|
/*
|
||||||
|
* Bittorrent Client using Qt and libtorrent. |
||||||
|
* Copyright (C) 2023 Vladimir Golovnev <glassez@yandex.ru> |
||||||
|
* |
||||||
|
* This program is free software; you can redistribute it and/or |
||||||
|
* modify it under the terms of the GNU General Public License |
||||||
|
* as published by the Free Software Foundation; either version 2 |
||||||
|
* of the License, or (at your option) any later version. |
||||||
|
* |
||||||
|
* This program is distributed in the hope that it will be useful, |
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
* GNU General Public License for more details. |
||||||
|
* |
||||||
|
* You should have received a copy of the GNU General Public License |
||||||
|
* along with this program; if not, write to the Free Software |
||||||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
||||||
|
* |
||||||
|
* In addition, as a special exception, the copyright holders give permission to |
||||||
|
* link this program with the OpenSSL project's "OpenSSL" library (or with |
||||||
|
* modified versions of it that use the same license as the "OpenSSL" library), |
||||||
|
* and distribute the linked executables. You must obey the GNU General Public |
||||||
|
* License in all respects for all of the code used other than "OpenSSL". If you |
||||||
|
* modify file(s), you may extend this exception to your version of the file(s), |
||||||
|
* but you are not obligated to do so. If you do not wish to do so, delete this |
||||||
|
* exception statement from your version. |
||||||
|
*/ |
||||||
|
|
||||||
|
#pragma once |
||||||
|
|
||||||
|
#include <QWidget> |
||||||
|
|
||||||
|
#include "base/bittorrent/addtorrentparams.h" |
||||||
|
|
||||||
|
namespace Ui |
||||||
|
{ |
||||||
|
class AddTorrentParamsWidget; |
||||||
|
} |
||||||
|
|
||||||
|
class AddTorrentParamsWidget final : public QWidget |
||||||
|
{ |
||||||
|
Q_OBJECT |
||||||
|
Q_DISABLE_COPY_MOVE(AddTorrentParamsWidget) |
||||||
|
|
||||||
|
public: |
||||||
|
explicit AddTorrentParamsWidget(BitTorrent::AddTorrentParams addTorrentParams = {}, QWidget *parent = nullptr); |
||||||
|
~AddTorrentParamsWidget() override; |
||||||
|
|
||||||
|
void setAddTorrentParams(BitTorrent::AddTorrentParams addTorrentParams); |
||||||
|
BitTorrent::AddTorrentParams addTorrentParams() const; |
||||||
|
|
||||||
|
private: |
||||||
|
void populate(); |
||||||
|
void loadCustomSavePathOptions(); |
||||||
|
void loadCustomDownloadPath(); |
||||||
|
void loadCategorySavePathOptions(); |
||||||
|
void populateDefaultPaths(); |
||||||
|
void populateDefaultDownloadPath(); |
||||||
|
void populateSavePathOptions(); |
||||||
|
|
||||||
|
|
||||||
|
Ui::AddTorrentParamsWidget *m_ui; |
||||||
|
BitTorrent::AddTorrentParams m_addTorrentParams; |
||||||
|
}; |
@ -0,0 +1,363 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<ui version="4.0"> |
||||||
|
<class>AddTorrentParamsWidget</class> |
||||||
|
<widget class="QWidget" name="AddTorrentParamsWidget"> |
||||||
|
<property name="geometry"> |
||||||
|
<rect> |
||||||
|
<x>0</x> |
||||||
|
<y>0</y> |
||||||
|
<width>503</width> |
||||||
|
<height>366</height> |
||||||
|
</rect> |
||||||
|
</property> |
||||||
|
<property name="windowTitle"> |
||||||
|
<string>Form</string> |
||||||
|
</property> |
||||||
|
<layout class="QVBoxLayout" name="mainLayout"> |
||||||
|
<item> |
||||||
|
<layout class="QHBoxLayout" name="managementLayout"> |
||||||
|
<item> |
||||||
|
<widget class="QLabel" name="labelTorrentManagementMode"> |
||||||
|
<property name="text"> |
||||||
|
<string>Torrent Management Mode:</string> |
||||||
|
</property> |
||||||
|
</widget> |
||||||
|
</item> |
||||||
|
<item> |
||||||
|
<widget class="QComboBox" name="comboTTM"> |
||||||
|
<property name="toolTip"> |
||||||
|
<string>Automatic mode means that various torrent properties(eg save path) will be decided by the associated category</string> |
||||||
|
</property> |
||||||
|
</widget> |
||||||
|
</item> |
||||||
|
<item> |
||||||
|
<spacer name="horizontalSpacer"> |
||||||
|
<property name="orientation"> |
||||||
|
<enum>Qt::Horizontal</enum> |
||||||
|
</property> |
||||||
|
<property name="sizeHint" stdset="0"> |
||||||
|
<size> |
||||||
|
<width>20</width> |
||||||
|
<height>20</height> |
||||||
|
</size> |
||||||
|
</property> |
||||||
|
</spacer> |
||||||
|
</item> |
||||||
|
</layout> |
||||||
|
</item> |
||||||
|
<item> |
||||||
|
<widget class="QGroupBox" name="groupBoxSavePath"> |
||||||
|
<property name="title"> |
||||||
|
<string>Save at</string> |
||||||
|
</property> |
||||||
|
<layout class="QVBoxLayout" name="verticalLayout"> |
||||||
|
<item> |
||||||
|
<widget class="QLabel" name="defaultsNoteLabel"> |
||||||
|
<property name="font"> |
||||||
|
<font> |
||||||
|
<italic>true</italic> |
||||||
|
</font> |
||||||
|
</property> |
||||||
|
<property name="text"> |
||||||
|
<string>Note: the current defaults are displayed for reference.</string> |
||||||
|
</property> |
||||||
|
</widget> |
||||||
|
</item> |
||||||
|
<item> |
||||||
|
<widget class="FileSystemPathLineEdit" name="savePathEdit" native="true"/> |
||||||
|
</item> |
||||||
|
<item> |
||||||
|
<layout class="QHBoxLayout" name="downloadPathLayout"> |
||||||
|
<item> |
||||||
|
<widget class="QLabel" name="useDownloadPathLabel"> |
||||||
|
<property name="text"> |
||||||
|
<string>Use another path for incomplete torrents:</string> |
||||||
|
</property> |
||||||
|
</widget> |
||||||
|
</item> |
||||||
|
<item> |
||||||
|
<widget class="QComboBox" name="useDownloadPathComboBox"/> |
||||||
|
</item> |
||||||
|
<item> |
||||||
|
<spacer name="downloadPathSpacer"> |
||||||
|
<property name="orientation"> |
||||||
|
<enum>Qt::Horizontal</enum> |
||||||
|
</property> |
||||||
|
<property name="sizeHint" stdset="0"> |
||||||
|
<size> |
||||||
|
<width>40</width> |
||||||
|
<height>20</height> |
||||||
|
</size> |
||||||
|
</property> |
||||||
|
</spacer> |
||||||
|
</item> |
||||||
|
</layout> |
||||||
|
</item> |
||||||
|
<item> |
||||||
|
<widget class="FileSystemPathLineEdit" name="downloadPathEdit" native="true"/> |
||||||
|
</item> |
||||||
|
</layout> |
||||||
|
</widget> |
||||||
|
</item> |
||||||
|
<item> |
||||||
|
<layout class="QHBoxLayout" name="categoryLayout" stretch="0,2,1"> |
||||||
|
<item> |
||||||
|
<widget class="QLabel" name="labelCategory"> |
||||||
|
<property name="text"> |
||||||
|
<string>Category:</string> |
||||||
|
</property> |
||||||
|
</widget> |
||||||
|
</item> |
||||||
|
<item> |
||||||
|
<widget class="QComboBox" name="categoryComboBox"> |
||||||
|
<property name="sizePolicy"> |
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> |
||||||
|
<horstretch>0</horstretch> |
||||||
|
<verstretch>0</verstretch> |
||||||
|
</sizepolicy> |
||||||
|
</property> |
||||||
|
<property name="editable"> |
||||||
|
<bool>true</bool> |
||||||
|
</property> |
||||||
|
<property name="insertPolicy"> |
||||||
|
<enum>QComboBox::InsertAtTop</enum> |
||||||
|
</property> |
||||||
|
</widget> |
||||||
|
</item> |
||||||
|
<item> |
||||||
|
<spacer name="categorySpacer"> |
||||||
|
<property name="orientation"> |
||||||
|
<enum>Qt::Horizontal</enum> |
||||||
|
</property> |
||||||
|
<property name="sizeHint" stdset="0"> |
||||||
|
<size> |
||||||
|
<width>40</width> |
||||||
|
<height>20</height> |
||||||
|
</size> |
||||||
|
</property> |
||||||
|
</spacer> |
||||||
|
</item> |
||||||
|
</layout> |
||||||
|
</item> |
||||||
|
<item> |
||||||
|
<layout class="QHBoxLayout" name="tagsLayout" stretch="0,0,0"> |
||||||
|
<item> |
||||||
|
<widget class="QLabel" name="tagsLabel"> |
||||||
|
<property name="text"> |
||||||
|
<string>Tags:</string> |
||||||
|
</property> |
||||||
|
</widget> |
||||||
|
</item> |
||||||
|
<item> |
||||||
|
<widget class="QLineEdit" name="tagsLineEdit"> |
||||||
|
<property name="sizePolicy"> |
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> |
||||||
|
<horstretch>0</horstretch> |
||||||
|
<verstretch>0</verstretch> |
||||||
|
</sizepolicy> |
||||||
|
</property> |
||||||
|
<property name="readOnly"> |
||||||
|
<bool>true</bool> |
||||||
|
</property> |
||||||
|
<property name="placeholderText"> |
||||||
|
<string>Click [...] button to add/remove tags.</string> |
||||||
|
</property> |
||||||
|
<property name="clearButtonEnabled"> |
||||||
|
<bool>false</bool> |
||||||
|
</property> |
||||||
|
</widget> |
||||||
|
</item> |
||||||
|
<item> |
||||||
|
<widget class="QToolButton" name="tagsEditButton"> |
||||||
|
<property name="toolTip"> |
||||||
|
<string>Add/remove tags</string> |
||||||
|
</property> |
||||||
|
<property name="text"> |
||||||
|
<string>...</string> |
||||||
|
</property> |
||||||
|
</widget> |
||||||
|
</item> |
||||||
|
</layout> |
||||||
|
</item> |
||||||
|
<item> |
||||||
|
<widget class="QWidget" name="miscParamsWidget" native="true"> |
||||||
|
<widget class="QWidget" name="startTorrentWidget" native="true"> |
||||||
|
<property name="geometry"> |
||||||
|
<rect> |
||||||
|
<x>9</x> |
||||||
|
<y>65</y> |
||||||
|
<width>143</width> |
||||||
|
<height>22</height> |
||||||
|
</rect> |
||||||
|
</property> |
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2"> |
||||||
|
<property name="leftMargin"> |
||||||
|
<number>0</number> |
||||||
|
</property> |
||||||
|
<property name="topMargin"> |
||||||
|
<number>0</number> |
||||||
|
</property> |
||||||
|
<property name="rightMargin"> |
||||||
|
<number>2</number> |
||||||
|
</property> |
||||||
|
<property name="bottomMargin"> |
||||||
|
<number>0</number> |
||||||
|
</property> |
||||||
|
<item> |
||||||
|
<widget class="QLabel" name="startTorrentLabel"> |
||||||
|
<property name="text"> |
||||||
|
<string>Start torrent:</string> |
||||||
|
</property> |
||||||
|
</widget> |
||||||
|
</item> |
||||||
|
<item> |
||||||
|
<widget class="QComboBox" name="startTorrentComboBox"> |
||||||
|
<property name="currentIndex"> |
||||||
|
<number>-1</number> |
||||||
|
</property> |
||||||
|
</widget> |
||||||
|
</item> |
||||||
|
</layout> |
||||||
|
</widget> |
||||||
|
<widget class="QWidget" name="contentLayoutWidget" native="true"> |
||||||
|
<property name="geometry"> |
||||||
|
<rect> |
||||||
|
<x>9</x> |
||||||
|
<y>9</y> |
||||||
|
<width>159</width> |
||||||
|
<height>22</height> |
||||||
|
</rect> |
||||||
|
</property> |
||||||
|
<layout class="QHBoxLayout" name="contentLayoutLayout"> |
||||||
|
<property name="leftMargin"> |
||||||
|
<number>0</number> |
||||||
|
</property> |
||||||
|
<property name="topMargin"> |
||||||
|
<number>0</number> |
||||||
|
</property> |
||||||
|
<property name="rightMargin"> |
||||||
|
<number>2</number> |
||||||
|
</property> |
||||||
|
<property name="bottomMargin"> |
||||||
|
<number>0</number> |
||||||
|
</property> |
||||||
|
<item> |
||||||
|
<widget class="QLabel" name="contentLayoutLabel"> |
||||||
|
<property name="text"> |
||||||
|
<string>Content layout:</string> |
||||||
|
</property> |
||||||
|
</widget> |
||||||
|
</item> |
||||||
|
<item> |
||||||
|
<widget class="QComboBox" name="contentLayoutComboBox"> |
||||||
|
<property name="currentIndex"> |
||||||
|
<number>-1</number> |
||||||
|
</property> |
||||||
|
</widget> |
||||||
|
</item> |
||||||
|
</layout> |
||||||
|
</widget> |
||||||
|
<widget class="QWidget" name="stopConditionWidget" native="true"> |
||||||
|
<property name="geometry"> |
||||||
|
<rect> |
||||||
|
<x>9</x> |
||||||
|
<y>93</y> |
||||||
|
<width>158</width> |
||||||
|
<height>22</height> |
||||||
|
</rect> |
||||||
|
</property> |
||||||
|
<layout class="QHBoxLayout" name="stopConditionLayout"> |
||||||
|
<property name="leftMargin"> |
||||||
|
<number>0</number> |
||||||
|
</property> |
||||||
|
<property name="topMargin"> |
||||||
|
<number>0</number> |
||||||
|
</property> |
||||||
|
<property name="rightMargin"> |
||||||
|
<number>2</number> |
||||||
|
</property> |
||||||
|
<property name="bottomMargin"> |
||||||
|
<number>0</number> |
||||||
|
</property> |
||||||
|
<item> |
||||||
|
<widget class="QLabel" name="stopConditionLabel"> |
||||||
|
<property name="text"> |
||||||
|
<string>Stop condition:</string> |
||||||
|
</property> |
||||||
|
</widget> |
||||||
|
</item> |
||||||
|
<item> |
||||||
|
<widget class="QComboBox" name="stopConditionComboBox"> |
||||||
|
<property name="currentIndex"> |
||||||
|
<number>-1</number> |
||||||
|
</property> |
||||||
|
</widget> |
||||||
|
</item> |
||||||
|
</layout> |
||||||
|
</widget> |
||||||
|
<widget class="QWidget" name="addToQueueTopWidget" native="true"> |
||||||
|
<property name="geometry"> |
||||||
|
<rect> |
||||||
|
<x>9</x> |
||||||
|
<y>121</y> |
||||||
|
<width>187</width> |
||||||
|
<height>22</height> |
||||||
|
</rect> |
||||||
|
</property> |
||||||
|
<layout class="QHBoxLayout" name="addToQueueTopLayout"> |
||||||
|
<property name="leftMargin"> |
||||||
|
<number>0</number> |
||||||
|
</property> |
||||||
|
<property name="topMargin"> |
||||||
|
<number>0</number> |
||||||
|
</property> |
||||||
|
<property name="rightMargin"> |
||||||
|
<number>2</number> |
||||||
|
</property> |
||||||
|
<property name="bottomMargin"> |
||||||
|
<number>0</number> |
||||||
|
</property> |
||||||
|
<item> |
||||||
|
<widget class="QLabel" name="addToQueueTopLabel"> |
||||||
|
<property name="text"> |
||||||
|
<string>Add to top of queue:</string> |
||||||
|
</property> |
||||||
|
</widget> |
||||||
|
</item> |
||||||
|
<item> |
||||||
|
<widget class="QComboBox" name="addToQueueTopComboBox"> |
||||||
|
<property name="currentIndex"> |
||||||
|
<number>-1</number> |
||||||
|
</property> |
||||||
|
</widget> |
||||||
|
</item> |
||||||
|
</layout> |
||||||
|
</widget> |
||||||
|
<widget class="QCheckBox" name="skipCheckingCheckBox"> |
||||||
|
<property name="geometry"> |
||||||
|
<rect> |
||||||
|
<x>10</x> |
||||||
|
<y>30</y> |
||||||
|
<width>83</width> |
||||||
|
<height>21</height> |
||||||
|
</rect> |
||||||
|
</property> |
||||||
|
<property name="text"> |
||||||
|
<string>Skip hash check</string> |
||||||
|
</property> |
||||||
|
</widget> |
||||||
|
</widget> |
||||||
|
</item> |
||||||
|
</layout> |
||||||
|
</widget> |
||||||
|
<customwidgets> |
||||||
|
<customwidget> |
||||||
|
<class>FileSystemPathLineEdit</class> |
||||||
|
<extends>QWidget</extends> |
||||||
|
<header>gui/fspathedit.h</header> |
||||||
|
<container>1</container> |
||||||
|
</customwidget> |
||||||
|
</customwidgets> |
||||||
|
<resources/> |
||||||
|
<connections/> |
||||||
|
</ui> |
Loading…
Reference in new issue