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"
|
|
|
|
#include "bittorrent.h"
|
|
|
|
#include "DLListDelegate.h"
|
|
|
|
#include <QStandardItemModel>
|
|
|
|
|
|
|
|
class FinishedTorrents : public QWidget, public Ui::seeding{
|
|
|
|
Q_OBJECT
|
|
|
|
private:
|
2007-04-04 16:01:32 +04:00
|
|
|
QObject *parent;
|
2007-04-04 05:36:55 +04:00
|
|
|
bittorrent *BTSession;
|
|
|
|
DLListDelegate *finishedListDelegate;
|
|
|
|
QStringList finishedSHAs;
|
|
|
|
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
|
|
|
|
QStringList getFinishedSHAs();
|
2007-04-04 16:52:50 +04:00
|
|
|
QTreeView* getFinishedList();
|
|
|
|
QStandardItemModel* getFinishedListModel();
|
2007-04-11 17:10:13 +04:00
|
|
|
bool loadColWidthFinishedList();
|
2007-04-15 22:15:22 +04:00
|
|
|
int getRowFromHash(const QString& hash) const;
|
2007-04-04 16:01:32 +04:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void addFinishedSHA(QString sha);
|
|
|
|
void updateFinishedList();
|
|
|
|
void deleteFromFinishedList(QString hash);
|
2007-04-04 16:52:50 +04:00
|
|
|
void showProperties(const QModelIndex &index);
|
|
|
|
void propertiesSelection();
|
2007-04-04 17:12:11 +04:00
|
|
|
void displayFinishedListMenu(const QPoint&);
|
2007-04-04 16:01:32 +04:00
|
|
|
void setRowColor(int row, const 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-04-04 05:36:55 +04:00
|
|
|
|
2007-04-10 14:11:36 +04:00
|
|
|
protected slots:
|
|
|
|
void on_actionSet_upload_limit_triggered();
|
|
|
|
|
2007-04-15 22:15:22 +04:00
|
|
|
signals:
|
|
|
|
void torrentMovedFromFinishedList(torrent_handle);
|
|
|
|
|
2007-04-04 05:36:55 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|