2009-11-19 14:09:03 +03:00
|
|
|
/*
|
2017-06-15 15:40:59 +03:00
|
|
|
* Bittorrent Client using Qt and libtorrent.
|
|
|
|
* Copyright (C) 2006 Christophe Dumez <chris@qbittorrent.org>
|
2009-11-19 14:09:03 +03: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.
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2020-12-10 20:56:37 +03:00
|
|
|
#pragma once
|
2009-11-19 14:09:03 +03:00
|
|
|
|
|
|
|
#include <QTreeWidget>
|
2020-12-09 08:48:59 +03:00
|
|
|
#include <QtContainerFwd>
|
2010-06-05 17:43:36 +04:00
|
|
|
|
2019-07-12 11:50:36 +03:00
|
|
|
class PropertiesWidget;
|
2009-11-19 14:09:03 +03:00
|
|
|
|
2015-04-19 18:17:47 +03:00
|
|
|
namespace BitTorrent
|
|
|
|
{
|
2021-01-06 15:12:40 +03:00
|
|
|
class Torrent;
|
2015-04-19 18:17:47 +03:00
|
|
|
}
|
|
|
|
|
2018-06-14 12:54:23 +03:00
|
|
|
class TrackerListWidget : public QTreeWidget
|
2017-03-09 19:25:41 +03:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
2018-06-14 12:54:23 +03:00
|
|
|
Q_DISABLE_COPY(TrackerListWidget)
|
2009-11-19 14:09:03 +03:00
|
|
|
|
|
|
|
public:
|
2017-03-09 19:25:41 +03:00
|
|
|
enum TrackerListColumn
|
|
|
|
{
|
|
|
|
COL_TIER,
|
|
|
|
COL_URL,
|
|
|
|
COL_STATUS,
|
|
|
|
COL_PEERS,
|
2018-09-17 07:16:28 +03:00
|
|
|
COL_SEEDS,
|
|
|
|
COL_LEECHES,
|
2017-03-09 19:25:41 +03:00
|
|
|
COL_DOWNLOADED,
|
2017-03-10 12:43:59 +03:00
|
|
|
COL_MSG,
|
|
|
|
|
|
|
|
COL_COUNT
|
2017-03-09 19:25:41 +03:00
|
|
|
};
|
2009-11-19 14:09:03 +03:00
|
|
|
|
2018-12-16 10:51:36 +03:00
|
|
|
explicit TrackerListWidget(PropertiesWidget *properties);
|
2018-06-14 12:54:23 +03:00
|
|
|
~TrackerListWidget();
|
2009-11-19 18:43:00 +03:00
|
|
|
|
2017-03-10 12:43:59 +03:00
|
|
|
int visibleColumnsCount() const;
|
|
|
|
|
2009-11-19 14:09:03 +03:00
|
|
|
public slots:
|
2019-02-12 03:45:30 +03:00
|
|
|
void setRowColor(int row, const QColor &color);
|
2009-11-19 18:43:00 +03:00
|
|
|
|
2017-03-09 19:25:41 +03:00
|
|
|
void moveSelectionUp();
|
|
|
|
void moveSelectionDown();
|
2010-01-05 22:59:25 +03:00
|
|
|
|
2017-03-09 19:25:41 +03:00
|
|
|
void clear();
|
2021-01-06 15:12:40 +03:00
|
|
|
void loadStickyItems(const BitTorrent::Torrent *torrent);
|
2017-03-09 19:25:41 +03:00
|
|
|
void loadTrackers();
|
|
|
|
void askForTrackers();
|
|
|
|
void copyTrackerUrl();
|
|
|
|
void reannounceSelected();
|
|
|
|
void deleteSelectedTrackers();
|
|
|
|
void editSelectedTracker();
|
2019-06-03 10:10:19 +03:00
|
|
|
void showTrackerListMenu(const QPoint &);
|
2017-03-10 12:43:59 +03:00
|
|
|
void displayToggleColumnsMenu(const QPoint &);
|
2017-03-09 19:25:41 +03:00
|
|
|
void loadSettings();
|
|
|
|
void saveSettings() const;
|
2009-11-19 15:27:52 +03:00
|
|
|
|
2017-03-09 19:25:41 +03:00
|
|
|
protected:
|
2019-07-12 11:50:36 +03:00
|
|
|
QVector<QTreeWidgetItem *> getSelectedTrackerItems() const;
|
2017-03-09 19:25:41 +03:00
|
|
|
|
|
|
|
private:
|
2019-07-12 11:50:36 +03:00
|
|
|
static QStringList headerLabels();
|
|
|
|
|
2017-05-11 18:58:50 +03:00
|
|
|
PropertiesWidget *m_properties;
|
|
|
|
QHash<QString, QTreeWidgetItem *> m_trackerItems;
|
|
|
|
QTreeWidgetItem *m_DHTItem;
|
|
|
|
QTreeWidgetItem *m_PEXItem;
|
|
|
|
QTreeWidgetItem *m_LSDItem;
|
2009-11-19 14:09:03 +03:00
|
|
|
};
|