diff --git a/Changelog b/Changelog index 4837c042a..e2ed81f5e 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,6 @@ +* Unreleased - Christophe Dumez - v2.0.7 + - BUGFIX: Fix 'Add in pause' setting in torrent addition dialog + * Tue Jan 5 2009 - Christophe Dumez - v2.0.6 - BUGFIX: Fix detection of invalid torrent files - BUGFIX: Stop catching signals once one has been caught to avoid possible infinite loop diff --git a/src/GUI.h b/src/GUI.h index 86b1fe212..44ec4ae43 100644 --- a/src/GUI.h +++ b/src/GUI.h @@ -157,6 +157,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{ // Methods int getCurrentTabIndex() const; QPoint screenCenter() const; + TransferListWidget* getTransferList() const { return transferList; } }; #endif diff --git a/src/torrentadditiondlg.h b/src/torrentadditiondlg.h index 1f4609941..641a90871 100644 --- a/src/torrentadditiondlg.h +++ b/src/torrentadditiondlg.h @@ -51,6 +51,8 @@ #include "torrentpersistentdata.h" #include "torrentfilesmodel.h" #include "preferences.h" +#include "GUI.h" +#include "transferlistwidget.h" using namespace libtorrent; @@ -69,9 +71,10 @@ private: boost::intrusive_ptr t; public: - torrentAdditionDialog(QWidget *parent, Bittorrent* _BTSession) : QDialog(parent) { + torrentAdditionDialog(GUI *parent, Bittorrent* _BTSession) : QDialog((QWidget*)parent) { setupUi(this); setAttribute(Qt::WA_DeleteOnClose); + connect(this, SIGNAL(torrentPaused(QTorrentHandle&)), parent->getTransferList(), SLOT(pauseTorrent(QTorrentHandle&))); BTSession = _BTSession; // Set Properties list model PropListModel = new TorrentFilesModel(); @@ -341,10 +344,15 @@ public slots: savePiecesPriorities(); // Add to download list QTorrentHandle h = BTSession->addTorrent(filePath, false, from_url); - if(addInPause->isChecked() && h.is_valid()) + if(addInPause->isChecked() && h.is_valid()) { h.pause(); + emit torrentPaused(h); + } close(); } + +signals: + void torrentPaused(QTorrentHandle &h); }; #endif diff --git a/src/transferlistwidget.h b/src/transferlistwidget.h index d40f685f8..1abff9613 100644 --- a/src/transferlistwidget.h +++ b/src/transferlistwidget.h @@ -77,7 +77,6 @@ protected slots: void displayListMenu(const QPoint&); void updateMetadata(QTorrentHandle &h); void currentChanged(const QModelIndex& current, const QModelIndex&); - void pauseTorrent(QTorrentHandle &h); void resumeTorrent(QTorrentHandle &h); #ifdef LIBTORRENT_0_15 void toggleSelectedTorrentsSuperSeeding(); @@ -89,6 +88,7 @@ protected slots: public slots: void refreshList(); void addTorrent(QTorrentHandle& h); + void pauseTorrent(QTorrentHandle &h); void setFinished(QTorrentHandle &h); void setRefreshInterval(int t); void startSelectedTorrents();