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
- BUGFIX: Fix detection of invalid torrent files
- 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
int getCurrentTabIndex() const;
QPoint screenCenter() const;
TransferListWidget* getTransferList() const { return transferList; }
};
#endif

View File

@@ -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<torrent_info> 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

View File

@@ -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();