source: trunk/qt/details.h @ 14180

Last change on this file since 14180 was 14180, checked in by jordan, 10 years ago

add a size hint for the torrent properties dialog. (rb07)

  • Property svn:keywords set to Date Rev Author Id
File size: 4.2 KB
Line 
1/*
2 * This file Copyright (C) Mnemosyne LLC
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2
6 * as published by the Free Software Foundation.
7 *
8 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
9 *
10 * $Id: details.h 14180 2013-08-24 20:34:43Z jordan $
11 */
12
13#ifndef DETAILS_DIALOG_H
14#define DETAILS_DIALOG_H
15
16#include <QDialog>
17#include <QString>
18#include <QMap>
19#include <QSet>
20#include <QTimer>
21#include <QWidgetList>
22
23#include "prefs.h"
24
25class FileTreeView;
26class QTreeView;
27class QComboBox;
28class QCheckBox;
29class QDoubleSpinBox;
30class QLabel;
31class QRadioButton;
32class QSpinBox;
33class QTextBrowser;
34class QTreeWidget;
35class QTreeWidgetItem;
36class Session;
37class Torrent;
38class TorrentModel;
39class TrackerDelegate;
40class TrackerModel;
41class TrackerModelFilter;
42
43class Details: public QDialog
44{
45    Q_OBJECT
46
47  private:
48    void getNewData ();
49
50  private slots:
51    void onTorrentChanged ();
52    void onTimer ();
53
54  public:
55    Details (Session&, Prefs&, TorrentModel&, QWidget * parent = 0);
56    ~Details ();
57    void setIds (const QSet<int>& ids);
58    virtual QSize sizeHint () const { return QSize (440, 460); }
59
60  private:
61    QWidget * createPeersTab ();
62    QWidget * createTrackerTab ();
63    QWidget * createInfoTab ();
64    QWidget * createFilesTab ();
65    QWidget * createOptionsTab ();
66
67  private:
68    QIcon getStockIcon (const QString& freedesktop_name, int fallback);
69    QString timeToStringRounded (int seconds);
70    QString trimToDesiredWidth (const QString& str);
71    void enableWhenChecked (QCheckBox *, QWidget *);
72
73  private:
74    Session& mySession;
75    Prefs& myPrefs;
76    TorrentModel& myModel;
77    QSet<int> myIds;
78    QTimer myTimer;
79    bool myChangedTorrents;
80    bool myHavePendingRefresh;
81
82    QLabel * myStateLabel;
83    QLabel * myHaveLabel;
84    QLabel * myAvailabilityLabel;
85    QLabel * myDownloadedLabel;
86    QLabel * myUploadedLabel;
87    QLabel * myErrorLabel;
88    QLabel * myRunTimeLabel;
89    QLabel * myETALabel;
90    QLabel * myLastActivityLabel;
91
92    QCheckBox * mySessionLimitCheck;
93    QCheckBox * mySingleDownCheck;
94    QCheckBox * mySingleUpCheck;
95    QCheckBox * myShowTrackerScrapesCheck;
96    QCheckBox * myShowBackupTrackersCheck;
97    QPushButton * myAddTrackerButton;
98    QPushButton * myEditTrackerButton;
99    QPushButton * myRemoveTrackerButton;
100    QSpinBox * mySingleDownSpin;
101    QSpinBox * mySingleUpSpin;
102    QComboBox * myRatioCombo;
103    QDoubleSpinBox * myRatioSpin;
104    QComboBox * myIdleCombo;
105    QSpinBox * myIdleSpin;
106    QSpinBox * myPeerLimitSpin;
107    QComboBox * myBandwidthPriorityCombo;
108
109    QLabel * mySizeLabel;
110    QLabel * myHashLabel;
111    QLabel * myPrivacyLabel;
112    QLabel * myOriginLabel;
113    QLabel * myLocationLabel;
114    QTextBrowser * myCommentBrowser;
115
116    QLabel * myTrackerLabel;
117    QLabel * myScrapeTimePrevLabel;
118    QLabel * myScrapeTimeNextLabel;
119    QLabel * myScrapeResponseLabel;
120    QLabel * myAnnounceTimePrevLabel;
121    QLabel * myAnnounceTimeNextLabel;
122    QLabel * myAnnounceResponseLabel;
123    QLabel * myAnnounceManualLabel;
124
125    TrackerModel * myTrackerModel;
126    TrackerModelFilter * myTrackerFilter;
127    TrackerDelegate * myTrackerDelegate;
128    QTreeView * myTrackerView;
129    //QMap<QString,QTreeWidgetItem*> myTrackerTiers;
130    //QMap<QString,QTreeWidgetItem*> myTrackerItems;
131
132    QTreeWidget * myPeerTree;
133    QMap<QString,QTreeWidgetItem*> myPeers;
134
135    QWidgetList myWidgets;
136
137    FileTreeView * myFileTreeView;
138
139  private slots:
140    void refreshPref (int key);
141    void onBandwidthPriorityChanged (int);
142    void onFilePriorityChanged (const QSet<int>& fileIndices, int);
143    void onFileWantedChanged (const QSet<int>& fileIndices, bool);
144    void onPathEdited (const QString& oldpath, const QString& newname);
145    void onHonorsSessionLimitsToggled (bool);
146    void onDownloadLimitedToggled (bool);
147    void onSpinBoxEditingFinished ();
148    void onUploadLimitedToggled (bool);
149    void onRatioModeChanged (int);
150    void onIdleModeChanged (int);
151    void onShowTrackerScrapesToggled (bool);
152    void onShowBackupTrackersToggled (bool);
153    void onTrackerSelectionChanged ();
154    void onAddTrackerClicked ();
155    void onEditTrackerClicked ();
156    void onRemoveTrackerClicked ();
157    void refresh ();
158};
159
160#endif
Note: See TracBrowser for help on using the repository browser.