From d916bfd73efa786baa0752cdae4035f16bf1487e Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Thu, 26 Jun 2008 17:31:29 +0000 Subject: [PATCH] - Ask if we want to redownload a torrent if its content gets deleted from hard drive (patch from e-stealth) --- Changelog | 1 + src/FinishedTorrents.cpp | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Changelog b/Changelog index 7cb565a9e..1cc740119 100644 --- a/Changelog +++ b/Changelog @@ -17,6 +17,7 @@ - FEATURE: Allow to add several trackers at once - BUGFIX: Do not display seeds number in seeding list (always 0) - BUGFIX: Threadified IP filter file parser to avoid GUI freeze + - BUGFIX: Ask if we want to redownload if content was deleted from hard drive - COSMETIC: Do not display progress bar in seeding list (always 100%) - COSMETIC: Added a progress bar for torrent creation - COSMETIC: Display tracker errors in a cleaner way diff --git a/src/FinishedTorrents.cpp b/src/FinishedTorrents.cpp index 95d746354..c93ff3f68 100644 --- a/src/FinishedTorrents.cpp +++ b/src/FinishedTorrents.cpp @@ -31,6 +31,7 @@ #include #include #include +#include FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession) : parent(parent), BTSession(BTSession), nbFinished(0){ setupUi(this); @@ -242,10 +243,17 @@ void FinishedTorrents::updateFinishedList(){ } if(h.state() == torrent_status::downloading || (h.state() != torrent_status::checking_files && h.state() != torrent_status::queued_for_checking && h.progress() < 1.)) { // What are you doing here? go back to download tab! - qDebug("Info: a torrent was moved from finished to download tab"); - deleteTorrent(hash); - BTSession->setFinishedTorrent(hash); - emit torrentMovedFromFinishedList(hash); + int reponse = QMessageBox::question(this, tr("Finished torrent not found"), tr("Would you like to put it put it in the download list ?"), QMessageBox::Yes | QMessageBox::No); + if (reponse == QMessageBox::Yes) { + qDebug("Info: a torrent was moved from finished to download tab"); + deleteTorrent(hash); + BTSession->setFinishedTorrent(hash); + emit torrentMovedFromFinishedList(hash); + } + else if (reponse == QMessageBox::No) { + qDebug("Deleted from the finished"); + BTSession->deleteTorrent(hash, true); + } continue; } if(h.state() == torrent_status::checking_files){