transmission/qt/DetailsDialog.h

106 lines
2.3 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
*
*/
#pragma once
2009-04-09 18:55:47 +00:00
#include <QString>
#include <QMap>
#include <QSet>
#include <QTimer>
#include "BaseDialog.h"
#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 BaseDialog
2009-04-09 18:55:47 +00:00
{
Q_OBJECT
public:
DetailsDialog(Session&, Prefs&, TorrentModel const&, QWidget* parent = nullptr);
virtual ~DetailsDialog();
2015-06-12 22:12:12 +00:00
void setIds(QSet<int> const& 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();
void getNewData();
QIcon getStockIcon(QString const& freedesktop_name, int fallback);
private slots:
void refresh();
void refreshPref(int key);
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(QSet<int> const& fileIndices, int);
void onFileWantedChanged(QSet<int> const& fileIndices, bool);
void onPathEdited(QString const& oldpath, QString const& newname);
void onOpenRequested(QString const& 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();
private:
2015-06-12 22:12:12 +00:00
Session& mySession;
Prefs& myPrefs;
TorrentModel const& myModel;
2015-06-12 22:12:12 +00:00
Ui::DetailsDialog ui;
QSet<int> myIds;
QTimer myTimer;
bool myChangedTorrents;
bool myHavePendingRefresh;
TrackerModel* myTrackerModel;
TrackerModelFilter* myTrackerFilter;
TrackerDelegate* myTrackerDelegate;
2015-06-12 22:12:12 +00:00
QMap<QString, QTreeWidgetItem*> myPeers;
2009-04-09 18:55:47 +00:00
};