Browse Source

Add option to ignore global share ratio limits for torrents created in qBt.

adaptive-webui-19844
Nick Tiskov 11 years ago
parent
commit
a1298fbf58
  1. 32
      src/torrentcreator/createtorrent.ui
  2. 6
      src/torrentcreator/torrentcreatordlg.cpp

32
src/torrentcreator/createtorrent.ui

@ -241,6 +241,19 @@ @@ -241,6 +241,19 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkIgnoreShareLimits">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Ignore share ratio limits for this torrent</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="progressLbl">
<property name="text">
@ -302,5 +315,22 @@ @@ -302,5 +315,22 @@
</layout>
</widget>
<resources/>
<connections/>
<connections>
<connection>
<sender>checkStartSeeding</sender>
<signal>clicked(bool)</signal>
<receiver>checkIgnoreShareLimits</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>295</x>
<y>532</y>
</hint>
<hint type="destinationlabel">
<x>295</x>
<y>555</y>
</hint>
</hints>
</connection>
</connections>
</ui>

6
src/torrentcreator/torrentcreatordlg.cpp

@ -38,6 +38,7 @@ @@ -38,6 +38,7 @@
#include "qinisettings.h"
#include "torrentcreatorthread.h"
#include "iconprovider.h"
#include "qbtsession.h"
const uint NB_PIECES_MIN = 1200;
const uint NB_PIECES_MAX = 2200;
@ -169,6 +170,8 @@ void TorrentCreatorDlg::handleCreationSuccess(QString path, QString branch_path) @@ -169,6 +170,8 @@ void TorrentCreatorDlg::handleCreationSuccess(QString path, QString branch_path)
// Enable seeding mode (do not recheck the files)
TorrentTempData::setSeedingMode(hash, true);
emit torrent_to_seed(path);
if (checkIgnoreShareLimits->isChecked())
QBtSession::instance()->setMaxRatioPerTorrent(hash, -1);
}
QMessageBox::information(0, tr("Torrent creation"), tr("Torrent was created successfully:")+" "+path);
close();
@ -202,6 +205,7 @@ void TorrentCreatorDlg::setInteractionEnabled(bool enabled) @@ -202,6 +205,7 @@ void TorrentCreatorDlg::setInteractionEnabled(bool enabled)
check_private->setEnabled(enabled);
checkStartSeeding->setEnabled(enabled);
createButton->setEnabled(enabled);
checkIgnoreShareLimits->setEnabled(enabled && checkStartSeeding->isChecked());
//cancelButton->setEnabled(!enabled);
}
@ -259,12 +263,14 @@ void TorrentCreatorDlg::saveSettings() @@ -259,12 +263,14 @@ void TorrentCreatorDlg::saveSettings()
{
QIniSettings settings;
settings.setValue("CreateTorrent/dimensions", saveGeometry());
settings.setValue("CreateTorrent/IgnoreRatio", checkIgnoreShareLimits->isChecked());
}
void TorrentCreatorDlg::loadSettings()
{
QIniSettings settings;
restoreGeometry(settings.value("CreateTorrent/dimensions").toByteArray());
checkIgnoreShareLimits->setChecked(settings.value("CreateTorrent/IgnoreRatio").toBool());
}
void TorrentCreatorDlg::closeEvent(QCloseEvent *event)

Loading…
Cancel
Save