mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-01 13:18:06 -06:00
Add speedwidget based on QGraphicsView
This commit is contained in:
@@ -50,6 +50,46 @@ int SessionStatus::payloadUploadRate() const
|
||||
return m_nativeStatus.payload_upload_rate;
|
||||
}
|
||||
|
||||
int SessionStatus::downloadRate() const
|
||||
{
|
||||
return m_nativeStatus.download_rate;
|
||||
}
|
||||
|
||||
int SessionStatus::uploadRate() const
|
||||
{
|
||||
return m_nativeStatus.upload_rate;
|
||||
}
|
||||
|
||||
int SessionStatus::ipOverheadDownloadRate() const
|
||||
{
|
||||
return m_nativeStatus.ip_overhead_download_rate;
|
||||
}
|
||||
|
||||
int SessionStatus::ipOverheadUploadRate() const
|
||||
{
|
||||
return m_nativeStatus.ip_overhead_upload_rate;
|
||||
}
|
||||
|
||||
int SessionStatus::dhtDownloadRate() const
|
||||
{
|
||||
return m_nativeStatus.dht_download_rate;
|
||||
}
|
||||
|
||||
int SessionStatus::dhtUploadRate() const
|
||||
{
|
||||
return m_nativeStatus.dht_upload_rate;
|
||||
}
|
||||
|
||||
int SessionStatus::trackerDownloadRate() const
|
||||
{
|
||||
return m_nativeStatus.tracker_download_rate;
|
||||
}
|
||||
|
||||
int SessionStatus::trackerUploadRate() const
|
||||
{
|
||||
return m_nativeStatus.tracker_upload_rate;
|
||||
}
|
||||
|
||||
qlonglong SessionStatus::totalDownload() const
|
||||
{
|
||||
return m_nativeStatus.total_download;
|
||||
|
||||
@@ -51,6 +51,16 @@ namespace BitTorrent
|
||||
// account "useful" part of the rate
|
||||
int payloadUploadRate() const;
|
||||
|
||||
// Additional download/upload rates
|
||||
int uploadRate() const;
|
||||
int downloadRate() const;
|
||||
int ipOverheadUploadRate() const;
|
||||
int ipOverheadDownloadRate() const;
|
||||
int dhtUploadRate() const;
|
||||
int dhtDownloadRate() const;
|
||||
int trackerUploadRate() const;
|
||||
int trackerDownloadRate() const;
|
||||
|
||||
qlonglong totalDownload() const;
|
||||
qlonglong totalUpload() const;
|
||||
qlonglong totalPayloadDownload() const;
|
||||
|
||||
@@ -2501,6 +2501,25 @@ void Preferences::setHostNameCookies(const QString &host_name, const QList<QByte
|
||||
setValue("Rss/hosts_cookies", hosts_table);
|
||||
}
|
||||
|
||||
int Preferences::getSpeedWidgetPeriod() const {
|
||||
return value("SpeedWidget/period", 1).toInt();
|
||||
}
|
||||
|
||||
void Preferences::setSpeedWidgetPeriod(const int period) {
|
||||
setValue("SpeedWidget/period", period);
|
||||
}
|
||||
|
||||
bool Preferences::getSpeedWidgetGraphEnable(int id) const
|
||||
{
|
||||
// UP and DOWN graphs enabled by default
|
||||
return value("SpeedWidget/graph_enable_" + QString::number(id), (id == 0 || id == 1)).toBool();
|
||||
}
|
||||
|
||||
void Preferences::setSpeedWidgetGraphEnable(int id, const bool enable)
|
||||
{
|
||||
setValue("SpeedWidget/graph_enable_" + QString::number(id), enable);
|
||||
}
|
||||
|
||||
void Preferences::apply()
|
||||
{
|
||||
if (save())
|
||||
|
||||
@@ -534,6 +534,12 @@ public:
|
||||
QList<QNetworkCookie> getHostNameQNetworkCookies(const QString& host_name) const;
|
||||
void setHostNameCookies(const QString &host_name, const QList<QByteArray> &cookies);
|
||||
|
||||
// SpeedWidget
|
||||
int getSpeedWidgetPeriod() const;
|
||||
void setSpeedWidgetPeriod(const int period);
|
||||
bool getSpeedWidgetGraphEnable(int id) const;
|
||||
void setSpeedWidgetGraphEnable(int id, const bool enable);
|
||||
|
||||
public slots:
|
||||
void setStatusFilterState(bool checked);
|
||||
void setLabelFilterState(bool checked);
|
||||
|
||||
Reference in New Issue
Block a user