diff --git a/Changelog b/Changelog index 3bca631cf..cee037f3e 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,6 @@ +* Unreleased - Christophe Dumez - v2.6.0 + - FEATURE: Simplify program preferences + * Sun Dec 5 2010 - Christophe Dumez - v2.5.0 - FEATURE: qBittorrent can now act as a tracker - FEATURE: New and improved RSS feed automated downloader diff --git a/src/Icons/qBittorrent.desktop b/src/Icons/qBittorrent.desktop index cfcf919eb..b4eb91ee3 100644 --- a/src/Icons/qBittorrent.desktop +++ b/src/Icons/qBittorrent.desktop @@ -1,6 +1,6 @@ [Desktop Entry] Categories=Qt;Network;P2P; -Comment=V2.5.0 +Comment=V2.6.0 Exec=qbittorrent %f GenericName=Bittorrent client GenericName[ar]=العميل Bittorrent diff --git a/src/Info.plist b/src/Info.plist index a4fc45e8b..bc22a6817 100644 --- a/src/Info.plist +++ b/src/Info.plist @@ -47,7 +47,7 @@ CFBundlePackageType APPL CFBundleGetInfoString - 2.5.0 + 2.6.0 CFBundleSignature ???? CFBundleExecutable diff --git a/src/preferences/options.ui b/src/preferences/options.ui index a644d0814..899f10080 100644 --- a/src/preferences/options.ui +++ b/src/preferences/options.ui @@ -941,7 +941,7 @@ QGroupBox { 0 0 507 - 485 + 457 @@ -1000,17 +1000,7 @@ QGroupBox { - Enable UPnP port mapping - - - true - - - - - - - Enable NAT-PMP port mapping + Use UPnP / NAT-PMP port forwarding from my router true @@ -1409,8 +1399,8 @@ QGroupBox { 0 0 - 524 - 406 + 423 + 334 @@ -2181,8 +2171,8 @@ QGroupBox { 0 0 - 524 - 406 + 396 + 229 @@ -2344,8 +2334,8 @@ QGroupBox { 0 0 - 524 - 406 + 98 + 28 @@ -2401,7 +2391,6 @@ QGroupBox { checkStartPaused spinPort checkUPnP - checkNATPMP checkLSD comboEncryption checkMaxRatio diff --git a/src/preferences/options_imp.cpp b/src/preferences/options_imp.cpp index abf591f36..c3b0715ea 100644 --- a/src/preferences/options_imp.cpp +++ b/src/preferences/options_imp.cpp @@ -144,7 +144,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){ // Connection tab connect(spinPort, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); connect(checkUPnP, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); - connect(checkNATPMP, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); connect(checkUploadLimit, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); connect(checkDownloadLimit, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); connect(spinUploadLimit, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); @@ -359,7 +358,6 @@ void options_imp::saveOptions(){ // Connection preferences pref.setSessionPort(getPort()); pref.setUPnPEnabled(isUPnPEnabled()); - pref.setNATPMPEnabled(isNATPMPEnabled()); const QPair down_up_limit = getGlobalBandwidthLimits(); pref.setGlobalDownloadLimit(down_up_limit.first); pref.setGlobalUploadLimit(down_up_limit.second); @@ -529,7 +527,6 @@ void options_imp::loadOptions(){ // Connection preferences spinPort->setValue(pref.getSessionPort()); checkUPnP->setChecked(pref.isUPnPEnabled()); - checkNATPMP->setChecked(pref.isNATPMPEnabled()); intValue = pref.getGlobalDownloadLimit(); if(intValue > 0) { // Enabled @@ -717,10 +714,6 @@ bool options_imp::isUPnPEnabled() const{ return checkUPnP->isChecked(); } -bool options_imp::isNATPMPEnabled() const{ - return checkNATPMP->isChecked(); -} - // Return Download & Upload limits in kbps // [download,upload] QPair options_imp::getGlobalBandwidthLimits() const{ diff --git a/src/preferences/options_imp.h b/src/preferences/options_imp.h index 0da29ffde..4ef635626 100644 --- a/src/preferences/options_imp.h +++ b/src/preferences/options_imp.h @@ -114,7 +114,6 @@ private: // Connection options int getPort() const; bool isUPnPEnabled() const; - bool isNATPMPEnabled() const; QPair getGlobalBandwidthLimits() const; // Bittorrent options int getMaxConnecs() const; diff --git a/src/preferences/preferences.h b/src/preferences/preferences.h index 458380a88..b760aeaa8 100644 --- a/src/preferences/preferences.h +++ b/src/preferences/preferences.h @@ -335,14 +335,6 @@ public: setValue(QString::fromUtf8("Preferences/Connection/UPnP"), enabled); } - bool isNATPMPEnabled() const { - return value(QString::fromUtf8("Preferences/Connection/NAT-PMP"), true).toBool(); - } - - void setNATPMPEnabled(bool enabled) { - setValue(QString::fromUtf8("Preferences/Connection/NAT-PMP"), enabled); - } - int getGlobalDownloadLimit() const { return value("Preferences/Connection/GlobalDLLimit", -1).toInt(); } diff --git a/src/qtlibtorrent/qbtsession.cpp b/src/qtlibtorrent/qbtsession.cpp index 7707cfc58..aeb7bf52b 100644 --- a/src/qtlibtorrent/qbtsession.cpp +++ b/src/qtlibtorrent/qbtsession.cpp @@ -86,7 +86,7 @@ enum VersionType { NORMAL,ALPHA,BETA,RELEASE_CANDIDATE,DEVEL }; QBtSession::QBtSession() : m_scanFolders(ScanFoldersModel::instance(this)), preAllocateAll(false), addInPause(false), ratio_limit(-1), - UPnPEnabled(false), NATPMPEnabled(false), LSDEnabled(false), + UPnPEnabled(false), LSDEnabled(false), DHTEnabled(false), current_dht_port(0), queueingEnabled(false), torrentExport(false) #ifndef DISABLE_GUI @@ -354,21 +354,13 @@ void QBtSession::configureSession() { } } #endif - // * UPnP + // * UPnP / NAT-PMP if(pref.isUPnPEnabled()) { enableUPnP(true); - addConsoleMessage(tr("UPnP support [ON]"), QString::fromUtf8("blue")); + addConsoleMessage(tr("UPnP / NAT-PMP support [ON]"), QString::fromUtf8("blue")); } else { enableUPnP(false); - addConsoleMessage(tr("UPnP support [OFF]"), QString::fromUtf8("blue")); - } - // * NAT-PMP - if(pref.isNATPMPEnabled()) { - enableNATPMP(true); - addConsoleMessage(tr("NAT-PMP support [ON]"), QString::fromUtf8("blue")); - } else { - enableNATPMP(false); - addConsoleMessage(tr("NAT-PMP support [OFF]"), QString::fromUtf8("blue")); + addConsoleMessage(tr("UPnP / NAT-PMP support [OFF]"), QString::fromUtf8("blue")); } // * Session settings session_settings sessionSettings; @@ -1307,31 +1299,17 @@ void QBtSession::setMaxUploadsPerTorrent(int max) { void QBtSession::enableUPnP(bool b) { if(b) { if(!UPnPEnabled) { - qDebug("Enabling UPnP"); + qDebug("Enabling UPnP / NAT-PMP"); s->start_upnp(); + s->start_natpmp(); UPnPEnabled = true; } } else { if(UPnPEnabled) { - qDebug("Disabling UPnP"); + qDebug("Disabling UPnP / NAT-PMP"); s->stop_upnp(); - UPnPEnabled = false; - } - } -} - -void QBtSession::enableNATPMP(bool b) { - if(b) { - if(!NATPMPEnabled) { - qDebug("Enabling NAT-PMP"); - s->start_natpmp(); - NATPMPEnabled = true; - } - } else { - if(NATPMPEnabled) { - qDebug("Disabling NAT-PMP"); s->stop_natpmp(); - NATPMPEnabled = false; + UPnPEnabled = false; } } } diff --git a/src/qtlibtorrent/qbtsession.h b/src/qtlibtorrent/qbtsession.h index 61286bd5a..3d27e0eb9 100644 --- a/src/qtlibtorrent/qbtsession.h +++ b/src/qtlibtorrent/qbtsession.h @@ -145,7 +145,6 @@ public slots: void setDownloadLimit(QString hash, long val); void setUploadLimit(QString hash, long val); void enableUPnP(bool b); - void enableNATPMP(bool b); void enableLSD(bool b); bool enableDHT(bool b); #ifdef DISABLE_GUI @@ -232,7 +231,6 @@ private: float ratio_limit; int high_ratio_action; bool UPnPEnabled; - bool NATPMPEnabled; bool LSDEnabled; bool DHTEnabled; int current_dht_port;