Browse Source

Use check box to represent "Skip checking"

adaptive-webui-19844
Vladimir Golovnev (Glassez) 2 years ago
parent
commit
b953d223e4
No known key found for this signature in database
GPG Key ID: 52A2C7DEE2DFA6F7
  1. 15
      src/gui/addtorrentparamswidget.cpp
  2. 51
      src/gui/addtorrentparamswidget.ui

15
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("Yes"), true);
m_ui->startTorrentComboBox->addItem(tr("No"), false); 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("Default"));
m_ui->addToQueueTopComboBox->addItem(tr("Yes"), true); m_ui->addToQueueTopComboBox->addItem(tr("Yes"), true);
m_ui->addToQueueTopComboBox->addItem(tr("No"), false); m_ui->addToQueueTopComboBox->addItem(tr("No"), false);
@ -96,7 +93,8 @@ AddTorrentParamsWidget::AddTorrentParamsWidget(BitTorrent::AddTorrentParams addT
auto *miscParamsLayout = new FlowLayout(m_ui->miscParamsWidget); auto *miscParamsLayout = new FlowLayout(m_ui->miscParamsWidget);
miscParamsLayout->setContentsMargins(0, 0, 0, 0); miscParamsLayout->setContentsMargins(0, 0, 0, 0);
miscParamsLayout->addWidget(m_ui->contentLayoutWidget); 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->startTorrentWidget);
miscParamsLayout->addWidget(m_ui->stopConditionWidget); miscParamsLayout->addWidget(m_ui->stopConditionWidget);
miscParamsLayout->addWidget(m_ui->addToQueueTopWidget); miscParamsLayout->addWidget(m_ui->addToQueueTopWidget);
@ -223,12 +221,11 @@ void AddTorrentParamsWidget::populate()
m_addTorrentParams.addPaused = !data.toBool(); m_addTorrentParams.addPaused = !data.toBool();
}); });
m_ui->skipCheckingComboBox->disconnect(this); m_ui->skipCheckingCheckBox->disconnect(this);
m_ui->skipCheckingComboBox->setCurrentIndex(m_ui->skipCheckingComboBox->findData(m_addTorrentParams.skipChecking)); m_ui->skipCheckingCheckBox->setChecked(m_addTorrentParams.skipChecking);
connect(m_ui->skipCheckingComboBox, &QComboBox::currentIndexChanged, this, [this] connect(m_ui->skipCheckingCheckBox, &QCheckBox::toggled, this, [this]
{ {
const QVariant data = m_ui->skipCheckingComboBox->currentData(); m_addTorrentParams.skipChecking = m_ui->skipCheckingCheckBox->isChecked();
m_addTorrentParams.skipChecking = data.toBool();
}); });
m_ui->addToQueueTopComboBox->disconnect(this); m_ui->addToQueueTopComboBox->disconnect(this);

51
src/gui/addtorrentparamswidget.ui

@ -207,44 +207,6 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="skipCheckingWidget" native="true">
<property name="geometry">
<rect>
<x>9</x>
<y>37</y>
<width>164</width>
<height>22</height>
</rect>
</property>
<layout class="QHBoxLayout" name="skipCheckingLayout">
<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="skipCheckingLabel">
<property name="text">
<string>Skip hash check:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="skipCheckingComboBox">
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="contentLayoutWidget" native="true"> <widget class="QWidget" name="contentLayoutWidget" native="true">
<property name="geometry"> <property name="geometry">
<rect> <rect>
@ -359,6 +321,19 @@
</item> </item>
</layout> </layout>
</widget> </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> </widget>
</item> </item>
</layout> </layout>

Loading…
Cancel
Save