2009-04-09 18:55:47 +00:00
|
|
|
/*
|
2010-08-01 20:36:13 +00:00
|
|
|
* This file Copyright (C) Mnemosyne LLC
|
2009-04-09 18:55:47 +00:00
|
|
|
*
|
2010-08-01 20:36:13 +00:00
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License version 2
|
|
|
|
* as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
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>
|
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;
|
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
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2010-06-30 05:55:46 +00:00
|
|
|
private:
|
2010-07-27 19:43:32 +00:00
|
|
|
void getNewData( );
|
2010-06-30 05:55:46 +00:00
|
|
|
|
2009-04-09 18:55:47 +00:00
|
|
|
private slots:
|
|
|
|
void onTorrentChanged( );
|
|
|
|
void onTimer( );
|
|
|
|
|
|
|
|
public:
|
2010-04-03 14:23:29 +00:00
|
|
|
Details( Session&, Prefs&, 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:
|
2010-06-30 05:55:46 +00:00
|
|
|
QIcon getStockIcon( const QString& freedesktop_name, int fallback );
|
2010-04-03 14:23:29 +00:00
|
|
|
QString timeToStringRounded( int seconds );
|
2009-04-09 18:55:47 +00:00
|
|
|
QString trimToDesiredWidth( const QString& str );
|
|
|
|
void enableWhenChecked( QCheckBox *, QWidget * );
|
|
|
|
|
|
|
|
private:
|
|
|
|
Session& mySession;
|
2010-04-03 14:23:29 +00:00
|
|
|
Prefs& myPrefs;
|
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;
|
2010-05-05 09:41:14 +00:00
|
|
|
bool myChangedTorrents;
|
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 * 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;
|
2010-04-03 14:23:29 +00:00
|
|
|
QCheckBox * myShowTrackerScrapesCheck;
|
2010-07-28 14:43:47 +00:00
|
|
|
QCheckBox * myShowBackupTrackersCheck;
|
2010-06-30 05:55:46 +00:00
|
|
|
QPushButton * myAddTrackerButton;
|
|
|
|
QPushButton * myEditTrackerButton;
|
|
|
|
QPushButton * myRemoveTrackerButton;
|
2009-04-09 18:55:47 +00:00
|
|
|
QSpinBox * mySingleDownSpin;
|
|
|
|
QSpinBox * mySingleUpSpin;
|
2010-07-24 04:14:43 +00:00
|
|
|
QComboBox * myRatioCombo;
|
|
|
|
QDoubleSpinBox * myRatioSpin;
|
|
|
|
QComboBox * myIdleCombo;
|
|
|
|
QSpinBox * myIdleSpin;
|
2009-04-09 18:55:47 +00:00
|
|
|
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;
|
|
|
|
|
2010-07-27 19:43:32 +00:00
|
|
|
TrackerModel * myTrackerModel;
|
2010-07-28 14:43:47 +00:00
|
|
|
TrackerModelFilter * myTrackerFilter;
|
2010-07-27 19:43:32 +00:00
|
|
|
TrackerDelegate * myTrackerDelegate;
|
|
|
|
QTreeView * myTrackerView;
|
|
|
|
//QMap<QString,QTreeWidgetItem*> myTrackerTiers;
|
|
|
|
//QMap<QString,QTreeWidgetItem*> myTrackerItems;
|
|
|
|
|
2009-04-09 18:55:47 +00:00
|
|
|
QTreeWidget * myPeerTree;
|
|
|
|
QMap<QString,QTreeWidgetItem*> myPeers;
|
2010-07-27 19:43:32 +00:00
|
|
|
|
2009-04-18 23:18:28 +00:00
|
|
|
QWidgetList myWidgets;
|
2009-04-09 18:55:47 +00:00
|
|
|
|
|
|
|
FileTreeView * myFileTreeView;
|
|
|
|
|
|
|
|
private slots:
|
2010-07-27 19:43:32 +00:00
|
|
|
void refreshPref( int key );
|
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 );
|
2010-07-24 04:14:43 +00:00
|
|
|
void onRatioModeChanged( int );
|
|
|
|
void onRatioLimitChanged( double );
|
|
|
|
void onIdleModeChanged( int );
|
|
|
|
void onIdleLimitChanged( int );
|
2010-04-03 14:23:29 +00:00
|
|
|
void onShowTrackerScrapesToggled( bool );
|
2010-07-28 14:43:47 +00:00
|
|
|
void onShowBackupTrackersToggled( bool );
|
2010-06-30 05:55:46 +00:00
|
|
|
void onTrackerSelectionChanged( );
|
2010-07-27 19:43:32 +00:00
|
|
|
void onAddTrackerClicked( );
|
|
|
|
void onEditTrackerClicked( );
|
|
|
|
void onRemoveTrackerClicked( );
|
2009-04-12 21:15:35 +00:00
|
|
|
void onMaxPeersChanged( int );
|
2009-04-18 23:18:28 +00:00
|
|
|
void refresh( );
|
2009-04-09 18:55:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|