2009-04-09 18:55:47 +00:00
|
|
|
/*
|
2010-01-04 21:00:47 +00:00
|
|
|
* This file Copyright (C) 2009-2010 Mnemosyne LLC
|
2009-04-09 18:55:47 +00:00
|
|
|
*
|
|
|
|
* This file is licensed by the GPL version 2. Works owned by the
|
|
|
|
* Transmission project are granted a special exemption to clause 2(b)
|
|
|
|
* so that the bulk of its code can remain under the MIT license.
|
|
|
|
* This exemption does not extend to derived works not owned by
|
|
|
|
* the Transmission project.
|
|
|
|
*
|
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>
|
2009-04-18 23:18:28 +00:00
|
|
|
#include <QWidgetList>
|
2009-04-09 18:55:47 +00:00
|
|
|
|
|
|
|
#include "prefs.h"
|
|
|
|
|
|
|
|
class FileTreeView;
|
|
|
|
class QTreeView;
|
2009-04-18 23:18:28 +00:00
|
|
|
class QComboBox;
|
2009-04-09 18:55:47 +00:00
|
|
|
class QCheckBox;
|
|
|
|
class QDoubleSpinBox;
|
|
|
|
class QLabel;
|
|
|
|
class QRadioButton;
|
|
|
|
class QSpinBox;
|
|
|
|
class QTextBrowser;
|
|
|
|
class QTreeWidget;
|
|
|
|
class QTreeWidgetItem;
|
|
|
|
class Session;
|
|
|
|
class Torrent;
|
2009-04-18 23:18:28 +00:00
|
|
|
class TorrentModel;
|
2009-04-09 18:55:47 +00:00
|
|
|
|
|
|
|
class Details: public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void onTorrentChanged( );
|
|
|
|
void onTimer( );
|
|
|
|
|
|
|
|
public:
|
2009-04-18 23:18:28 +00:00
|
|
|
Details( Session&, TorrentModel&, QWidget * parent = 0 );
|
2009-04-09 18:55:47 +00:00
|
|
|
~Details( );
|
2009-04-18 23:18:28 +00:00
|
|
|
void setIds( const QSet<int>& ids );
|
2009-04-09 18:55:47 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
QWidget * createPeersTab( );
|
|
|
|
QWidget * createTrackerTab( );
|
|
|
|
QWidget * createInfoTab( );
|
|
|
|
QWidget * createFilesTab( );
|
|
|
|
QWidget * createOptionsTab( );
|
|
|
|
|
|
|
|
private:
|
|
|
|
QString trimToDesiredWidth( const QString& str );
|
|
|
|
void enableWhenChecked( QCheckBox *, QWidget * );
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
Session& mySession;
|
2009-08-12 14:40:32 +00:00
|
|
|
TorrentModel& myModel;
|
2009-04-18 23:18:28 +00:00
|
|
|
QSet<int> myIds;
|
2009-04-09 18:55:47 +00:00
|
|
|
QTimer myTimer;
|
2009-04-18 23:18:28 +00:00
|
|
|
bool myHavePendingRefresh;
|
2009-04-09 18:55:47 +00:00
|
|
|
|
|
|
|
QLabel * myStateLabel;
|
|
|
|
QLabel * myHaveLabel;
|
2010-02-02 05:34:26 +00:00
|
|
|
QLabel * myAvailabilityLabel;
|
2009-04-09 18:55:47 +00:00
|
|
|
QLabel * myDownloadedLabel;
|
|
|
|
QLabel * myUploadedLabel;
|
|
|
|
QLabel * myRatioLabel;
|
|
|
|
QLabel * myErrorLabel;
|
2009-06-23 00:24:37 +00:00
|
|
|
QLabel * myRunTimeLabel;
|
2009-10-10 20:42:23 +00:00
|
|
|
QLabel * myETALabel;
|
2009-06-23 00:24:37 +00:00
|
|
|
QLabel * myLastActivityLabel;
|
2009-04-09 18:55:47 +00:00
|
|
|
|
|
|
|
QCheckBox * mySessionLimitCheck;
|
|
|
|
QCheckBox * mySingleDownCheck;
|
|
|
|
QCheckBox * mySingleUpCheck;
|
|
|
|
QSpinBox * mySingleDownSpin;
|
|
|
|
QSpinBox * mySingleUpSpin;
|
|
|
|
QRadioButton * mySeedGlobalRadio;
|
|
|
|
QRadioButton * mySeedForeverRadio;
|
|
|
|
QRadioButton * mySeedCustomRadio;
|
|
|
|
QDoubleSpinBox * mySeedCustomSpin;
|
|
|
|
QSpinBox * myPeerLimitSpin;
|
2009-04-18 23:18:28 +00:00
|
|
|
QComboBox * myBandwidthPriorityCombo;
|
2009-04-09 18:55:47 +00:00
|
|
|
|
2009-06-23 00:24:37 +00:00
|
|
|
QLabel * mySizeLabel;
|
2009-04-09 18:55:47 +00:00
|
|
|
QLabel * myHashLabel;
|
|
|
|
QLabel * myPrivacyLabel;
|
2009-06-23 00:24:37 +00:00
|
|
|
QLabel * myOriginLabel;
|
|
|
|
QLabel * myLocationLabel;
|
2009-04-09 18:55:47 +00:00
|
|
|
QTextBrowser * myCommentBrowser;
|
|
|
|
|
|
|
|
QLabel * myTrackerLabel;
|
|
|
|
QLabel * myScrapeTimePrevLabel;
|
|
|
|
QLabel * myScrapeTimeNextLabel;
|
|
|
|
QLabel * myScrapeResponseLabel;
|
|
|
|
QLabel * myAnnounceTimePrevLabel;
|
|
|
|
QLabel * myAnnounceTimeNextLabel;
|
|
|
|
QLabel * myAnnounceResponseLabel;
|
|
|
|
QLabel * myAnnounceManualLabel;
|
|
|
|
|
|
|
|
QTreeWidget * myPeerTree;
|
|
|
|
QMap<QString,QTreeWidgetItem*> myPeers;
|
2009-04-18 23:18:28 +00:00
|
|
|
QWidgetList myWidgets;
|
2009-04-09 18:55:47 +00:00
|
|
|
|
|
|
|
FileTreeView * myFileTreeView;
|
|
|
|
|
|
|
|
private slots:
|
2009-04-18 23:18:28 +00:00
|
|
|
void onBandwidthPriorityChanged( int );
|
2009-04-09 18:55:47 +00:00
|
|
|
void onFilePriorityChanged( const QSet<int>& fileIndices, int );
|
|
|
|
void onFileWantedChanged( const QSet<int>& fileIndices, bool );
|
2009-04-12 21:15:35 +00:00
|
|
|
void onHonorsSessionLimitsToggled( bool );
|
|
|
|
void onDownloadLimitedToggled( bool );
|
|
|
|
void onDownloadLimitChanged( int );
|
|
|
|
void onUploadLimitedToggled( bool );
|
|
|
|
void onUploadLimitChanged( int );
|
|
|
|
void onSeedUntilChanged( bool );
|
|
|
|
void onSeedRatioLimitChanged( double );
|
|
|
|
void onMaxPeersChanged( int );
|
2009-04-18 23:18:28 +00:00
|
|
|
void refresh( );
|
2009-04-09 18:55:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|