Brand new torrent model for the transfer list

This commit is contained in:
Christophe Dumez
2010-11-14 15:28:22 +00:00
parent 01cc4452b2
commit d76877b1a2
12 changed files with 609 additions and 602 deletions

View File

@@ -38,9 +38,9 @@
class QStandardItemModel;
class QSortFilterProxyModel;
class QBtSession;
class QTimer;
class TransferListDelegate;
class MainWindow;
class TorrentModel;
enum TorrentFilter {FILTER_ALL, FILTER_DOWNLOADING, FILTER_COMPLETED, FILTER_PAUSED, FILTER_ACTIVE, FILTER_INACTIVE};
@@ -51,13 +51,9 @@ public:
TransferListWidget(QWidget *parent, MainWindow *main_window, QBtSession* BTSession);
~TransferListWidget();
int getNbTorrents() const;
QStandardItemModel* getSourceModel() const;
TorrentModel* getSourceModel() const;
public slots:
void refreshList(bool force=false);
void addTorrent(QTorrentHandle& h);
void pauseTorrent(QTorrentHandle &h);
void setFinished(QTorrentHandle &h);
void setSelectionLabel(QString label);
void setRefreshInterval(int t);
void setSelectedTorrentsLocation();
@@ -73,7 +69,6 @@ public slots:
void decreasePrioSelectedTorrents();
void topPrioSelectedTorrents();
void bottomPrioSelectedTorrents();
void buySelectedTorrents() const;
void copySelectedMagnetURIs() const;
void openSelectedTorrentsFolder() const;
void recheckSelectedTorrents();
@@ -102,41 +97,28 @@ protected:
QStringList getSelectedTorrentsHashes() const;
protected slots:
int updateTorrent(int row);
void deleteTorrent(QString hash);
void deleteTorrent(int row, bool refresh_list=true);
void pauseTorrent(int row, bool refresh_list=true);
void resumeTorrent(int row, bool refresh_list=true);
void torrentDoubleClicked(const QModelIndex& index);
bool loadHiddenColumns();
void saveHiddenColumns() const;
void displayListMenu(const QPoint&);
void updateMetadata(QTorrentHandle &h);
void currentChanged(const QModelIndex& current, const QModelIndex&);
void resumeTorrent(QTorrentHandle &h);
#if LIBTORRENT_VERSION_MINOR > 14
void toggleSelectedTorrentsSuperSeeding() const;
#endif
void toggleSelectedTorrentsSequentialDownload() const;
void toggleSelectedFirstLastPiecePrio() const;
void askNewLabelForSelection();
void setRowColor(int row, QColor color);
signals:
void currentTorrentChanged(QTorrentHandle &h);
void torrentStatusUpdate(uint nb_downloading, uint nb_seeding, uint nb_active, uint nb_inactive, uint nb_paused);
void torrentAdded(QModelIndex index);
void torrentAboutToBeRemoved(QModelIndex index);
void torrentChangedLabel(QString old_label, QString new_label);
private:
TransferListDelegate *listDelegate;
QStandardItemModel *listModel;
TorrentModel *listModel;
QSortFilterProxyModel *nameFilterModel;
QSortFilterProxyModel *statusFilterModel;
QSortFilterProxyModel *labelFilterModel;
QBtSession* BTSession;
QTimer *refreshTimer;
MainWindow *main_window;
};