Browse Source

Merge pull request #7500 from Chocobo1/mergeName

Show torrent name in "add new torrent" dialog on merging trackers
adaptive-webui-19844
Mike Tzou 7 years ago committed by GitHub
parent
commit
15babe97ea
  1. 10
      src/gui/addnewtorrentdialog.cpp

10
src/gui/addnewtorrentdialog.cpp

@ -263,12 +263,12 @@ bool AddNewTorrentDialog::loadTorrent(const QString &torrentPath)
BitTorrent::TorrentHandle *const torrent = BitTorrent::Session::instance()->findTorrent(m_hash); BitTorrent::TorrentHandle *const torrent = BitTorrent::Session::instance()->findTorrent(m_hash);
if (torrent) { if (torrent) {
if (torrent->isPrivate() || m_torrentInfo.isPrivate()) { if (torrent->isPrivate() || m_torrentInfo.isPrivate()) {
MessageBoxRaised::critical(this, tr("Already in download list"), tr("Torrent is already in download list. Trackers weren't merged because it is a private torrent."), QMessageBox::Ok); MessageBoxRaised::critical(this, tr("Already in download list"), tr("Torrent '%1' is already in download list. Trackers weren't merged because it is a private torrent.").arg(torrent->name()), QMessageBox::Ok);
} }
else { else {
torrent->addTrackers(m_torrentInfo.trackers()); torrent->addTrackers(m_torrentInfo.trackers());
torrent->addUrlSeeds(m_torrentInfo.urlSeeds()); torrent->addUrlSeeds(m_torrentInfo.urlSeeds());
MessageBoxRaised::information(this, tr("Already in download list"), tr("Torrent is already in download list. Trackers were merged."), QMessageBox::Ok); MessageBoxRaised::information(this, tr("Already in download list"), tr("Torrent '%1' is already in download list. Trackers were merged.").arg(torrent->name()), QMessageBox::Ok);
} }
} }
else { else {
@ -297,12 +297,12 @@ bool AddNewTorrentDialog::loadMagnet(const BitTorrent::MagnetUri &magnetUri)
BitTorrent::TorrentHandle *const torrent = BitTorrent::Session::instance()->findTorrent(m_hash); BitTorrent::TorrentHandle *const torrent = BitTorrent::Session::instance()->findTorrent(m_hash);
if (torrent) { if (torrent) {
if (torrent->isPrivate()) { if (torrent->isPrivate()) {
MessageBoxRaised::critical(this, tr("Already in download list"), tr("Torrent is already in download list. Trackers weren't merged because it is a private torrent."), QMessageBox::Ok); MessageBoxRaised::critical(this, tr("Already in download list"), tr("Torrent '%1' is already in download list. Trackers weren't merged because it is a private torrent.").arg(torrent->name()), QMessageBox::Ok);
} }
else { else {
torrent->addTrackers(magnetUri.trackers()); torrent->addTrackers(magnetUri.trackers());
torrent->addUrlSeeds(magnetUri.urlSeeds()); torrent->addUrlSeeds(magnetUri.urlSeeds());
MessageBoxRaised::information(this, tr("Already in download list"), tr("Magnet link is already in download list. Trackers were merged."), QMessageBox::Ok); MessageBoxRaised::information(this, tr("Already in download list"), tr("Magnet link '%1' is already in download list. Trackers were merged.").arg(torrent->name()), QMessageBox::Ok);
} }
} }
else { else {
@ -556,7 +556,7 @@ void AddNewTorrentDialog::populateSavePathComboBox()
foreach (const QString &savePath, settings()->loadValue(KEY_SAVEPATHHISTORY).toStringList()) foreach (const QString &savePath, settings()->loadValue(KEY_SAVEPATHHISTORY).toStringList())
if (QDir(savePath) != defaultSaveDir) if (QDir(savePath) != defaultSaveDir)
ui->savePath->addItem(savePath); ui->savePath->addItem(savePath);
if (!m_torrentParams.savePath.isEmpty()) if (!m_torrentParams.savePath.isEmpty())
setSavePath(m_torrentParams.savePath); setSavePath(m_torrentParams.savePath);
} }

Loading…
Cancel
Save