transmission/qt/DetailsDialog.h

106 lines
2.4 KiB
C
Raw Normal View History

2009-04-09 18:55:47 +00:00
/*
* This file Copyright (C) 2009-2015 Mnemosyne LLC
2009-04-09 18:55:47 +00:00
*
* It may be used under the GNU GPL versions 2 or 3
* or any future license endorsed by Mnemosyne LLC.
2009-04-09 18:55:47 +00:00
*
* $Id$
2009-04-09 18:55:47 +00:00
*/
#ifndef QTR_DETAILS_DIALOG_H
#define QTR_DETAILS_DIALOG_H
2009-04-09 18:55:47 +00:00
#include <QDialog>
#include <QString>
#include <QMap>
#include <QSet>
#include <QTimer>
#include "ui_DetailsDialog.h"
2009-04-09 18:55:47 +00:00
class QTreeWidgetItem;
2015-06-12 22:12:12 +00:00
class Prefs;
2009-04-09 18:55:47 +00:00
class Session;
class Torrent;
class TorrentModel;
class TrackerDelegate;
class TrackerModel;
class TrackerModelFilter;
2009-04-09 18:55:47 +00:00
class DetailsDialog: public QDialog
2009-04-09 18:55:47 +00:00
{
Q_OBJECT
public:
2015-06-12 22:12:12 +00:00
DetailsDialog (Session&, Prefs&, const TorrentModel&, QWidget * parent = nullptr);
virtual ~DetailsDialog ();
void setIds (const QSet<int>& ids);
2015-06-12 22:12:12 +00:00
// QWidget
virtual QSize sizeHint () const { return QSize (440, 460); }
private:
void initPeersTab ();
void initTrackerTab ();
void initInfoTab ();
void initFilesTab ();
void initOptionsTab ();
2015-06-12 22:12:12 +00:00
void getNewData ();
2015-06-12 22:12:12 +00:00
QIcon getStockIcon (const QString& freedesktop_name, int fallback);
2015-06-12 22:12:12 +00:00
private slots:
void refresh ();
void refreshPref (int key);
2015-06-12 22:12:12 +00:00
void onTorrentChanged ();
void onTimer ();
2015-06-12 22:12:12 +00:00
// Tracker tab
void onTrackerSelectionChanged ();
void onAddTrackerClicked ();
void onEditTrackerClicked ();
void onRemoveTrackerClicked ();
void onShowTrackerScrapesToggled (bool);
void onShowBackupTrackersToggled (bool);
2015-06-12 22:12:12 +00:00
// Files tab
void onFilePriorityChanged (const QSet<int>& fileIndices, int);
void onFileWantedChanged (const QSet<int>& fileIndices, bool);
void onPathEdited (const QString& oldpath, const QString& newname);
void onOpenRequested (const QString& path);
2015-06-12 22:12:12 +00:00
// Options tab
void onBandwidthPriorityChanged (int);
void onHonorsSessionLimitsToggled (bool);
void onDownloadLimitedToggled (bool);
void onSpinBoxEditingFinished ();
void onUploadLimitedToggled (bool);
void onRatioModeChanged (int);
void onIdleModeChanged (int);
void onIdleLimitChanged ();
2015-06-12 22:12:12 +00:00
private:
Session& mySession;
Prefs& myPrefs;
const TorrentModel& myModel;
Ui::DetailsDialog ui;
QSet<int> myIds;
QTimer myTimer;
bool myChangedTorrents;
bool myHavePendingRefresh;
TrackerModel * myTrackerModel;
TrackerModelFilter * myTrackerFilter;
TrackerDelegate * myTrackerDelegate;
QMap<QString, QTreeWidgetItem*> myPeers;
2009-04-09 18:55:47 +00:00
};
#endif // QTR_DETAILS_DIALOG_H