From b953d223e49f715afd3fd2871831fde6475b81d8 Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Sat, 22 Apr 2023 13:14:01 +0300 Subject: [PATCH] Use check box to represent "Skip checking" --- src/gui/addtorrentparamswidget.cpp | 15 ++++----- src/gui/addtorrentparamswidget.ui | 51 ++++++++---------------------- 2 files changed, 19 insertions(+), 47 deletions(-) diff --git a/src/gui/addtorrentparamswidget.cpp b/src/gui/addtorrentparamswidget.cpp index b1400c5a1..224b36cbe 100644 --- a/src/gui/addtorrentparamswidget.cpp +++ b/src/gui/addtorrentparamswidget.cpp @@ -74,9 +74,6 @@ AddTorrentParamsWidget::AddTorrentParamsWidget(BitTorrent::AddTorrentParams addT m_ui->startTorrentComboBox->addItem(tr("Yes"), true); m_ui->startTorrentComboBox->addItem(tr("No"), false); - m_ui->skipCheckingComboBox->addItem(tr("Yes"), true); - m_ui->skipCheckingComboBox->addItem(tr("No"), false); - m_ui->addToQueueTopComboBox->addItem(tr("Default")); m_ui->addToQueueTopComboBox->addItem(tr("Yes"), true); m_ui->addToQueueTopComboBox->addItem(tr("No"), false); @@ -96,7 +93,8 @@ AddTorrentParamsWidget::AddTorrentParamsWidget(BitTorrent::AddTorrentParams addT auto *miscParamsLayout = new FlowLayout(m_ui->miscParamsWidget); miscParamsLayout->setContentsMargins(0, 0, 0, 0); miscParamsLayout->addWidget(m_ui->contentLayoutWidget); - miscParamsLayout->addWidget(m_ui->skipCheckingWidget); + 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); @@ -223,12 +221,11 @@ void AddTorrentParamsWidget::populate() m_addTorrentParams.addPaused = !data.toBool(); }); - m_ui->skipCheckingComboBox->disconnect(this); - m_ui->skipCheckingComboBox->setCurrentIndex(m_ui->skipCheckingComboBox->findData(m_addTorrentParams.skipChecking)); - connect(m_ui->skipCheckingComboBox, &QComboBox::currentIndexChanged, this, [this] + m_ui->skipCheckingCheckBox->disconnect(this); + m_ui->skipCheckingCheckBox->setChecked(m_addTorrentParams.skipChecking); + connect(m_ui->skipCheckingCheckBox, &QCheckBox::toggled, this, [this] { - const QVariant data = m_ui->skipCheckingComboBox->currentData(); - m_addTorrentParams.skipChecking = data.toBool(); + m_addTorrentParams.skipChecking = m_ui->skipCheckingCheckBox->isChecked(); }); m_ui->addToQueueTopComboBox->disconnect(this); diff --git a/src/gui/addtorrentparamswidget.ui b/src/gui/addtorrentparamswidget.ui index af16a9462..eaf34250d 100644 --- a/src/gui/addtorrentparamswidget.ui +++ b/src/gui/addtorrentparamswidget.ui @@ -207,44 +207,6 @@ - - - - 9 - 37 - 164 - 22 - - - - - 0 - - - 0 - - - 2 - - - 0 - - - - - Skip hash check: - - - - - - - -1 - - - - - @@ -359,6 +321,19 @@ + + + + 10 + 30 + 83 + 21 + + + + Skip hash check + +