2007-04-04 05:36:55 +04:00
|
|
|
/*
|
|
|
|
* Bittorrent Client using Qt4 and libtorrent.
|
2007-07-14 18:31:59 +04:00
|
|
|
* Copyright (C) 2006 Christophe Dumez
|
2007-04-04 05:36:55 +04:00
|
|
|
*
|
2007-07-14 18:31:59 +04: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 05:36:55 +04: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 18:31:59 +04:00
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
* Contact : chris@qbittorrent.org
|
2007-04-04 05:36:55 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SEEDING_H
|
|
|
|
#define SEEDING_H
|
|
|
|
|
|
|
|
#include "ui_seeding.h"
|
2007-08-20 10:29:18 +04:00
|
|
|
#include "qtorrenthandle.h"
|
2007-07-23 16:12:55 +04:00
|
|
|
|
|
|
|
class QStandardItemModel;
|
|
|
|
class bittorrent;
|
|
|
|
class FinishedListDelegate;
|
|
|
|
|
|
|
|
using namespace libtorrent;
|
2007-04-04 05:36:55 +04:00
|
|
|
|
2007-08-26 20:25:22 +04:00
|
|
|
class FinishedTorrents : public QWidget, public Ui::seeding {
|
2007-04-04 05:36:55 +04:00
|
|
|
Q_OBJECT
|
|
|
|
private:
|
2007-08-28 20:17:32 +04:00
|
|
|
QObject *parent;
|
2007-04-04 05:36:55 +04:00
|
|
|
bittorrent *BTSession;
|
2007-07-23 11:44:58 +04:00
|
|
|
FinishedListDelegate *finishedListDelegate;
|
2007-04-04 05:36:55 +04:00
|
|
|
QStandardItemModel *finishedListModel;
|
2007-04-04 16:01:32 +04:00
|
|
|
unsigned int nbFinished;
|
2007-04-04 05:36:55 +04:00
|
|
|
|
|
|
|
public:
|
2007-04-04 16:01:32 +04:00
|
|
|
FinishedTorrents(QObject *parent, bittorrent *BTSession);
|
|
|
|
~FinishedTorrents();
|
|
|
|
// Methods
|
2007-04-11 17:10:13 +04:00
|
|
|
bool loadColWidthFinishedList();
|
2007-07-22 13:47:27 +04:00
|
|
|
int getRowFromHash(QString hash) const;
|
2007-08-26 20:25:22 +04:00
|
|
|
QStringList getSelectedTorrents(bool only_one=false) const;
|
|
|
|
unsigned int getNbTorrentsInList() const;
|
|
|
|
QString getHashFromRow(unsigned int row) const;
|
2007-04-04 16:01:32 +04:00
|
|
|
|
2007-08-26 20:25:22 +04:00
|
|
|
protected slots:
|
2007-04-04 16:52:50 +04:00
|
|
|
void showProperties(const QModelIndex &index);
|
2007-04-04 17:12:11 +04:00
|
|
|
void displayFinishedListMenu(const QPoint&);
|
2007-07-22 13:47:27 +04:00
|
|
|
void setRowColor(int row, QString color);
|
2007-04-11 17:10:13 +04:00
|
|
|
void saveColWidthFinishedList() const;
|
2007-04-11 17:19:58 +04:00
|
|
|
void sortFinishedList(int index);
|
|
|
|
void sortFinishedListFloat(int index, Qt::SortOrder sortOrder);
|
|
|
|
void sortFinishedListString(int index, Qt::SortOrder sortOrder);
|
2007-07-23 11:44:58 +04:00
|
|
|
void updateFileSize(QString hash);
|
2007-08-26 20:25:22 +04:00
|
|
|
void torrentAdded(QString path, QTorrentHandle& h, bool fastResume);
|
2007-04-10 14:11:36 +04:00
|
|
|
void on_actionSet_upload_limit_triggered();
|
2007-08-26 20:25:22 +04:00
|
|
|
void notifyTorrentDoubleClicked(const QModelIndex& index);
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void addTorrent(QString hash);
|
|
|
|
void updateFinishedList();
|
|
|
|
void pauseTorrent(QString hash);
|
|
|
|
void resumeTorrent(QString hash);
|
|
|
|
void propertiesSelection();
|
|
|
|
void deleteTorrent(QString hash);
|
2007-04-10 14:11:36 +04:00
|
|
|
|
2007-04-15 22:15:22 +04:00
|
|
|
signals:
|
2007-08-26 20:25:22 +04:00
|
|
|
void torrentMovedFromFinishedList(QString);
|
|
|
|
void torrentDoubleClicked(QString hash);
|
|
|
|
void finishedTorrentsNumberChanged(unsigned int);
|
2007-04-15 22:15:22 +04:00
|
|
|
|
2007-04-04 05:36:55 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|