Browse Source

Merge trackers when torrent already exists instead of showing an AddNewTorrent dialog.

adaptive-webui-19844
sledgehammer999 11 years ago
parent
commit
37f821556e
  1. 9
      src/addnewtorrentdialog.cpp

9
src/addnewtorrentdialog.cpp

@ -188,6 +188,13 @@ bool AddNewTorrentDialog::loadTorrent(const QString& torrent_path, const QString
return false; return false;
} }
// Prevent showing the dialog if download is already present
if (QBtSession::instance()->getTorrentHandle(m_hash).is_valid()) {
QMessageBox::information(0, tr("Already in download list"), tr("Torrent is already in download list. Merging trackers."), QMessageBox::Ok);
QBtSession::instance()->addTorrent(m_filePath, false, m_url);;
return false;
}
// Set dialog title // Set dialog title
setWindowTitle(misc::toQStringU(m_torrentInfo->name())); setWindowTitle(misc::toQStringU(m_torrentInfo->name()));
@ -260,7 +267,7 @@ bool AddNewTorrentDialog::loadMagnet(const QString &magnet_uri)
// Prevent showing the dialog if download is already present // Prevent showing the dialog if download is already present
if (QBtSession::instance()->getTorrentHandle(m_hash).is_valid()) { if (QBtSession::instance()->getTorrentHandle(m_hash).is_valid()) {
QMessageBox::information(0, tr("Already in download list"), tr("Magnet link is already in download list."), QMessageBox::Ok); QMessageBox::information(0, tr("Already in download list"), tr("Magnet link is already in download list. Merging trackers."), QMessageBox::Ok);
QBtSession::instance()->addMagnetUri(m_url, false); QBtSession::instance()->addMagnetUri(m_url, false);
return false; return false;
} }

Loading…
Cancel
Save