2007-04-04 01:36:55 +00:00
|
|
|
/*
|
|
|
|
* Bittorrent Client using Qt4 and libtorrent.
|
2007-07-14 14:31:59 +00:00
|
|
|
* Copyright (C) 2006 Christophe Dumez
|
2007-04-04 01:36:55 +00:00
|
|
|
*
|
2007-07-14 14:31:59 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2007-04-04 01:36:55 +00:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2007-07-14 14:31:59 +00:00
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
2009-04-05 17:00:55 +00:00
|
|
|
* In addition, as a special exception, the copyright holders give permission to
|
|
|
|
* link this program with the OpenSSL project's "OpenSSL" library (or with
|
|
|
|
* modified versions of it that use the same license as the "OpenSSL" library),
|
|
|
|
* and distribute the linked executables. You must obey the GNU General Public
|
|
|
|
* License in all respects for all of the code used other than "OpenSSL". If you
|
|
|
|
* modify file(s), you may extend this exception to your version of the file(s),
|
|
|
|
* but you are not obligated to do so. If you do not wish to do so, delete this
|
|
|
|
* exception statement from your version.
|
|
|
|
*
|
2007-07-14 14:31:59 +00:00
|
|
|
* Contact : chris@qbittorrent.org
|
2007-04-04 01:36:55 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SEEDING_H
|
|
|
|
#define SEEDING_H
|
|
|
|
|
|
|
|
#include "ui_seeding.h"
|
2007-08-20 06:29:18 +00:00
|
|
|
#include "qtorrenthandle.h"
|
2007-07-23 12:12:55 +00:00
|
|
|
|
|
|
|
class QStandardItemModel;
|
2009-08-26 05:46:15 +00:00
|
|
|
class QSortFilterProxyModel;
|
2007-07-23 12:12:55 +00:00
|
|
|
class bittorrent;
|
|
|
|
class FinishedListDelegate;
|
|
|
|
|
|
|
|
using namespace libtorrent;
|
2007-04-04 01:36:55 +00:00
|
|
|
|
2007-08-26 16:25:22 +00:00
|
|
|
class FinishedTorrents : public QWidget, public Ui::seeding {
|
2007-04-04 01:36:55 +00:00
|
|
|
Q_OBJECT
|
|
|
|
private:
|
2007-08-28 16:17:32 +00:00
|
|
|
QObject *parent;
|
2007-04-04 01:36:55 +00:00
|
|
|
bittorrent *BTSession;
|
2007-07-23 07:44:58 +00:00
|
|
|
FinishedListDelegate *finishedListDelegate;
|
2007-04-04 01:36:55 +00:00
|
|
|
QStandardItemModel *finishedListModel;
|
2009-08-26 05:46:15 +00:00
|
|
|
QSortFilterProxyModel *proxyModel;
|
2007-04-04 12:01:32 +00:00
|
|
|
unsigned int nbFinished;
|
2007-11-19 00:58:14 +00:00
|
|
|
void hideOrShowColumn(int index);
|
|
|
|
bool loadHiddenColumns();
|
|
|
|
void saveHiddenColumns();
|
|
|
|
QAction* getActionHoSCol(int index);
|
2007-04-04 01:36:55 +00:00
|
|
|
|
|
|
|
public:
|
2007-04-04 12:01:32 +00:00
|
|
|
FinishedTorrents(QObject *parent, bittorrent *BTSession);
|
|
|
|
~FinishedTorrents();
|
|
|
|
// Methods
|
2007-04-11 13:10:13 +00:00
|
|
|
bool loadColWidthFinishedList();
|
2007-07-22 09:47:27 +00:00
|
|
|
int getRowFromHash(QString hash) const;
|
2007-08-26 16:25:22 +00:00
|
|
|
QStringList getSelectedTorrents(bool only_one=false) const;
|
|
|
|
unsigned int getNbTorrentsInList() const;
|
|
|
|
QString getHashFromRow(unsigned int row) const;
|
2007-04-04 12:01:32 +00:00
|
|
|
|
2007-08-26 16:25:22 +00:00
|
|
|
protected slots:
|
2007-04-04 12:52:50 +00:00
|
|
|
void showProperties(const QModelIndex &index);
|
2007-04-04 13:12:11 +00:00
|
|
|
void displayFinishedListMenu(const QPoint&);
|
2007-11-24 00:14:19 +00:00
|
|
|
void displayFinishedHoSMenu(const QPoint&);
|
2007-07-22 09:47:27 +00:00
|
|
|
void setRowColor(int row, QString color);
|
2007-04-11 13:10:13 +00:00
|
|
|
void saveColWidthFinishedList() const;
|
2007-07-23 07:44:58 +00:00
|
|
|
void updateFileSize(QString hash);
|
2007-04-10 10:11:36 +00:00
|
|
|
void on_actionSet_upload_limit_triggered();
|
2007-08-26 16:25:22 +00:00
|
|
|
void notifyTorrentDoubleClicked(const QModelIndex& index);
|
2007-11-24 00:14:19 +00:00
|
|
|
void hideOrShowColumnName();
|
|
|
|
void hideOrShowColumnSize();
|
|
|
|
void hideOrShowColumnUpSpeed();
|
2009-07-12 05:37:09 +00:00
|
|
|
void hideOrShowColumnSwarm();
|
|
|
|
void hideOrShowColumnPeers();
|
2009-03-09 18:37:17 +00:00
|
|
|
void hideOrShowColumnUpload();
|
2007-11-24 00:14:19 +00:00
|
|
|
void hideOrShowColumnRatio();
|
2008-11-02 13:53:45 +00:00
|
|
|
void forceRecheck();
|
2007-08-26 16:25:22 +00:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void addTorrent(QString hash);
|
2008-12-26 21:18:33 +00:00
|
|
|
void updateTorrent(QTorrentHandle h);
|
2007-08-26 16:25:22 +00:00
|
|
|
void pauseTorrent(QString hash);
|
|
|
|
void propertiesSelection();
|
|
|
|
void deleteTorrent(QString hash);
|
2007-11-06 21:11:09 +00:00
|
|
|
void showPropertiesFromHash(QString hash);
|
2008-11-02 18:19:14 +00:00
|
|
|
void loadLastSortedColumn();
|
2009-08-26 05:46:15 +00:00
|
|
|
void saveLastSortedColumn();
|
2009-08-17 05:14:03 +00:00
|
|
|
void updateMetadata(QTorrentHandle &h);
|
2007-04-10 10:11:36 +00:00
|
|
|
|
2007-04-15 18:15:22 +00:00
|
|
|
signals:
|
2007-08-26 16:25:22 +00:00
|
|
|
void torrentMovedFromFinishedList(QString);
|
2007-11-06 21:11:09 +00:00
|
|
|
void torrentDoubleClicked(QString hash, bool finished);
|
2007-08-26 16:25:22 +00:00
|
|
|
void finishedTorrentsNumberChanged(unsigned int);
|
2007-04-15 18:15:22 +00:00
|
|
|
|
2007-04-04 01:36:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|