2009-04-09 18:55:47 +00:00
|
|
|
/*
|
2014-01-19 01:09:44 +00:00
|
|
|
* This file Copyright (C) 2009-2014 Mnemosyne LLC
|
2009-04-09 18:55:47 +00:00
|
|
|
*
|
2014-01-21 03:10:30 +00:00
|
|
|
* It may be used under the GNU GPL versions 2 or 3
|
2014-01-19 01:09:44 +00:00
|
|
|
* or any future license endorsed by Mnemosyne LLC.
|
2009-04-09 18:55:47 +00:00
|
|
|
*
|
2009-05-31 19:33:48 +00:00
|
|
|
* $Id$
|
2009-04-09 18:55:47 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef DETAILS_DIALOG_H
|
|
|
|
#define DETAILS_DIALOG_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
#include <QString>
|
|
|
|
#include <QMap>
|
|
|
|
#include <QSet>
|
|
|
|
#include <QTimer>
|
|
|
|
|
|
|
|
#include "prefs.h"
|
|
|
|
|
2014-12-14 18:12:21 +00:00
|
|
|
#include "ui_details.h"
|
|
|
|
|
2009-04-09 18:55:47 +00:00
|
|
|
class QTreeWidgetItem;
|
|
|
|
class Session;
|
|
|
|
class Torrent;
|
2009-04-18 23:18:28 +00:00
|
|
|
class TorrentModel;
|
2010-07-27 19:43:32 +00:00
|
|
|
class TrackerDelegate;
|
|
|
|
class TrackerModel;
|
2010-07-28 14:43:47 +00:00
|
|
|
class TrackerModelFilter;
|
2009-04-09 18:55:47 +00:00
|
|
|
|
|
|
|
class Details: public QDialog
|
|
|
|
{
|
2013-01-26 01:19:54 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
private:
|
|
|
|
void getNewData ();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void onTorrentChanged ();
|
|
|
|
void onTimer ();
|
|
|
|
|
|
|
|
public:
|
|
|
|
Details (Session&, Prefs&, TorrentModel&, QWidget * parent = 0);
|
|
|
|
~Details ();
|
|
|
|
void setIds (const QSet<int>& ids);
|
2013-08-24 20:34:43 +00:00
|
|
|
virtual QSize sizeHint () const { return QSize (440, 460); }
|
2013-01-26 01:19:54 +00:00
|
|
|
|
|
|
|
private:
|
2014-12-14 18:12:21 +00:00
|
|
|
void initPeersTab ();
|
|
|
|
void initTrackerTab ();
|
|
|
|
void initInfoTab ();
|
|
|
|
void initFilesTab ();
|
|
|
|
void initOptionsTab ();
|
2013-01-26 01:19:54 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
QIcon getStockIcon (const QString& freedesktop_name, int fallback);
|
|
|
|
QString timeToStringRounded (int seconds);
|
|
|
|
QString trimToDesiredWidth (const QString& str);
|
|
|
|
|
|
|
|
private:
|
|
|
|
Session& mySession;
|
|
|
|
Prefs& myPrefs;
|
|
|
|
TorrentModel& myModel;
|
|
|
|
QSet<int> myIds;
|
|
|
|
QTimer myTimer;
|
|
|
|
bool myChangedTorrents;
|
|
|
|
bool myHavePendingRefresh;
|
|
|
|
|
2014-12-14 18:12:21 +00:00
|
|
|
Ui::DetailsDialog ui;
|
2013-01-26 01:19:54 +00:00
|
|
|
|
|
|
|
TrackerModel * myTrackerModel;
|
|
|
|
TrackerModelFilter * myTrackerFilter;
|
|
|
|
TrackerDelegate * myTrackerDelegate;
|
|
|
|
|
|
|
|
QMap<QString,QTreeWidgetItem*> myPeers;
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void refreshPref (int key);
|
|
|
|
void onBandwidthPriorityChanged (int);
|
|
|
|
void onFilePriorityChanged (const QSet<int>& fileIndices, int);
|
|
|
|
void onFileWantedChanged (const QSet<int>& fileIndices, bool);
|
|
|
|
void onPathEdited (const QString& oldpath, const QString& newname);
|
2013-09-08 19:03:25 +00:00
|
|
|
void onOpenRequested (const QString& path);
|
2013-01-26 01:19:54 +00:00
|
|
|
void onHonorsSessionLimitsToggled (bool);
|
|
|
|
void onDownloadLimitedToggled (bool);
|
|
|
|
void onSpinBoxEditingFinished ();
|
|
|
|
void onUploadLimitedToggled (bool);
|
|
|
|
void onRatioModeChanged (int);
|
|
|
|
void onIdleModeChanged (int);
|
2014-12-22 03:06:09 +00:00
|
|
|
void onIdleLimitChanged ();
|
2013-01-26 01:19:54 +00:00
|
|
|
void onShowTrackerScrapesToggled (bool);
|
|
|
|
void onShowBackupTrackersToggled (bool);
|
|
|
|
void onTrackerSelectionChanged ();
|
|
|
|
void onAddTrackerClicked ();
|
|
|
|
void onEditTrackerClicked ();
|
|
|
|
void onRemoveTrackerClicked ();
|
|
|
|
void refresh ();
|
2009-04-09 18:55:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|