diff --git a/Changelog b/Changelog index a51cdb05c..277e16466 100644 --- a/Changelog +++ b/Changelog @@ -6,6 +6,7 @@ - BUGFIX: Fix communication between qBittorrent and Web UI (Qt 4.6) - BUGFIX: Use Wildcard matching instead of full regex in RSS feed downloader - BUGFIX: Fix code for listening on a random port whenever it failed to listen on the one defined + - BUGFIX: Use global maximum transfer rates as maximum values in per-torrent speed limiting dialogs - COSMETIC: Display a disconnected icon in status bar whenever qBittorrent failed to listen on the port defined * Wed Dec 23 2009 - Christophe Dumez - v2.0.3 diff --git a/src/Icons/qBittorrent.desktop b/src/Icons/qBittorrent.desktop index 7fed3f9c3..10c38a7bc 100644 --- a/src/Icons/qBittorrent.desktop +++ b/src/Icons/qBittorrent.desktop @@ -1,6 +1,6 @@ [Desktop Entry] Categories=Qt;Network;P2P; -Comment=V2.0.3 +Comment=V2.0.4 Exec=qbittorrent %f GenericName=Bittorrent client GenericName[bg]=Торент клиент diff --git a/src/Icons/skin/splash.png b/src/Icons/skin/splash.png index 95ee74c33..10fab53cd 100644 Binary files a/src/Icons/skin/splash.png and b/src/Icons/skin/splash.png differ diff --git a/src/speedlimitdlg.h b/src/speedlimitdlg.h index f988f5a68..0a9aca6d9 100644 --- a/src/speedlimitdlg.h +++ b/src/speedlimitdlg.h @@ -56,9 +56,10 @@ class SpeedLimitDialog : public QDialog, private Ui_bandwidth_dlg { } // -2: if cancel - static long askSpeedLimit(bool *ok, QString title, long default_value) { + static long askSpeedLimit(bool *ok, QString title, long default_value, long max_value=1024000) { SpeedLimitDialog dlg; dlg.setWindowTitle(title); + dlg.setMaxValue(max_value/1024.); dlg.setDefaultValue(default_value/1024.); if(dlg.exec() == QDialog::Accepted) { *ok = true; @@ -90,8 +91,16 @@ class SpeedLimitDialog : public QDialog, private Ui_bandwidth_dlg { return -1; } + void setMaxValue(long val) const { + if(val > 0) { + bandwidthSlider->setMaximum(val); + spinBandwidth->setMaximum(val); + } + } + void setDefaultValue(long val) const { if(val < 0) val = 0; + if(val > bandwidthSlider->maximum()) val = bandwidthSlider->maximum(); bandwidthSlider->setValue(val); } }; diff --git a/src/src.pro b/src/src.pro index 61d7bf444..a79148aab 100644 --- a/src/src.pro +++ b/src/src.pro @@ -12,10 +12,10 @@ CONFIG += qt \ thread # Update this VERSION for each release -DEFINES += VERSION=\\\"v2.0.3\\\" +DEFINES += VERSION=\\\"v2.0.4\\\" DEFINES += VERSION_MAJOR=2 DEFINES += VERSION_MINOR=0 -DEFINES += VERSION_BUGFIX=3 +DEFINES += VERSION_BUGFIX=4 # !mac:QMAKE_LFLAGS += -Wl,--as-needed contains(DEBUG_MODE, 1) { diff --git a/src/transferlistwidget.cpp b/src/transferlistwidget.cpp index 8fc1c521b..bf65f4fda 100644 --- a/src/transferlistwidget.cpp +++ b/src/transferlistwidget.cpp @@ -36,6 +36,7 @@ #include "speedlimitdlg.h" #include "options_imp.h" #include "GUI.h" +#include "preferences.h" #include "deletionconfirmationdlg.h" #include #include @@ -665,7 +666,7 @@ void TransferListWidget::setDlLimitSelectedTorrents() { int default_limit = -1; if(all_same_limit) default_limit = selected_torrents.first().download_limit(); - long new_limit = SpeedLimitDialog::askSpeedLimit(&ok, tr("Torrent Download Speed Limiting"), default_limit); + long new_limit = SpeedLimitDialog::askSpeedLimit(&ok, tr("Torrent Download Speed Limiting"), default_limit, Preferences::getGlobalDownloadLimit()*1024.); if(ok) { foreach(QTorrentHandle h, selected_torrents) { qDebug("Applying download speed limit of %ld Kb/s to torrent %s", (long)(new_limit/1024.), h.hash().toLocal8Bit().data()); @@ -701,7 +702,7 @@ void TransferListWidget::setUpLimitSelectedTorrents() { int default_limit = -1; if(all_same_limit) default_limit = selected_torrents.first().upload_limit(); - long new_limit = SpeedLimitDialog::askSpeedLimit(&ok, tr("Torrent Upload Speed Limiting"), default_limit); + long new_limit = SpeedLimitDialog::askSpeedLimit(&ok, tr("Torrent Upload Speed Limiting"), default_limit, Preferences::getGlobalUploadLimit()*1024.); if(ok) { foreach(QTorrentHandle h, selected_torrents) { qDebug("Applying upload speed limit of %ld Kb/s to torrent %s", (long)(new_limit/1024.), h.hash().toLocal8Bit().data());