BUGFIX: Fix 'Add in pause' setting in torrent addition dialog

This commit is contained in:
Christophe Dumez
2010-01-07 18:29:20 +00:00
parent 781f579037
commit 739390134f
4 changed files with 15 additions and 3 deletions

View File

@@ -1,3 +1,6 @@
* Unreleased - Christophe Dumez <chris@qbittorrent.org> - v2.0.7
- BUGFIX: Fix 'Add in pause' setting in torrent addition dialog
* Tue Jan 5 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.6 * Tue Jan 5 2009 - Christophe Dumez <chris@qbittorrent.org> - v2.0.6
- BUGFIX: Fix detection of invalid torrent files - BUGFIX: Fix detection of invalid torrent files
- BUGFIX: Stop catching signals once one has been caught to avoid possible infinite loop - BUGFIX: Stop catching signals once one has been caught to avoid possible infinite loop

View File

@@ -157,6 +157,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{
// Methods // Methods
int getCurrentTabIndex() const; int getCurrentTabIndex() const;
QPoint screenCenter() const; QPoint screenCenter() const;
TransferListWidget* getTransferList() const { return transferList; }
}; };
#endif #endif

View File

@@ -51,6 +51,8 @@
#include "torrentpersistentdata.h" #include "torrentpersistentdata.h"
#include "torrentfilesmodel.h" #include "torrentfilesmodel.h"
#include "preferences.h" #include "preferences.h"
#include "GUI.h"
#include "transferlistwidget.h"
using namespace libtorrent; using namespace libtorrent;
@@ -69,9 +71,10 @@ private:
boost::intrusive_ptr<torrent_info> t; boost::intrusive_ptr<torrent_info> t;
public: public:
torrentAdditionDialog(QWidget *parent, Bittorrent* _BTSession) : QDialog(parent) { torrentAdditionDialog(GUI *parent, Bittorrent* _BTSession) : QDialog((QWidget*)parent) {
setupUi(this); setupUi(this);
setAttribute(Qt::WA_DeleteOnClose); setAttribute(Qt::WA_DeleteOnClose);
connect(this, SIGNAL(torrentPaused(QTorrentHandle&)), parent->getTransferList(), SLOT(pauseTorrent(QTorrentHandle&)));
BTSession = _BTSession; BTSession = _BTSession;
// Set Properties list model // Set Properties list model
PropListModel = new TorrentFilesModel(); PropListModel = new TorrentFilesModel();
@@ -341,10 +344,15 @@ public slots:
savePiecesPriorities(); savePiecesPriorities();
// Add to download list // Add to download list
QTorrentHandle h = BTSession->addTorrent(filePath, false, from_url); QTorrentHandle h = BTSession->addTorrent(filePath, false, from_url);
if(addInPause->isChecked() && h.is_valid()) if(addInPause->isChecked() && h.is_valid()) {
h.pause(); h.pause();
emit torrentPaused(h);
}
close(); close();
} }
signals:
void torrentPaused(QTorrentHandle &h);
}; };
#endif #endif

View File

@@ -77,7 +77,6 @@ protected slots:
void displayListMenu(const QPoint&); void displayListMenu(const QPoint&);
void updateMetadata(QTorrentHandle &h); void updateMetadata(QTorrentHandle &h);
void currentChanged(const QModelIndex& current, const QModelIndex&); void currentChanged(const QModelIndex& current, const QModelIndex&);
void pauseTorrent(QTorrentHandle &h);
void resumeTorrent(QTorrentHandle &h); void resumeTorrent(QTorrentHandle &h);
#ifdef LIBTORRENT_0_15 #ifdef LIBTORRENT_0_15
void toggleSelectedTorrentsSuperSeeding(); void toggleSelectedTorrentsSuperSeeding();
@@ -89,6 +88,7 @@ protected slots:
public slots: public slots:
void refreshList(); void refreshList();
void addTorrent(QTorrentHandle& h); void addTorrent(QTorrentHandle& h);
void pauseTorrent(QTorrentHandle &h);
void setFinished(QTorrentHandle &h); void setFinished(QTorrentHandle &h);
void setRefreshInterval(int t); void setRefreshInterval(int t);
void startSelectedTorrents(); void startSelectedTorrents();