Simplify uTP settings

This commit is contained in:
Christophe Dumez
2011-04-17 18:11:03 +00:00
parent f843a4b13a
commit 52e7d4ad03
38 changed files with 2751 additions and 3244 deletions

View File

@@ -113,8 +113,6 @@ options_imp::options_imp(QWidget *parent):
comboTrayIcon->setVisible(false);
#endif
// Connect signals / slots
// Speeds
connect(comboBTProtocol, SIGNAL(currentIndexChanged(int)), SLOT(updateBTProtocolSettings(int)));
// Proxy tab
connect(comboProxyType, SIGNAL(currentIndexChanged(int)),this, SLOT(enableProxy(int)));
@@ -170,7 +168,7 @@ options_imp::options_imp(QWidget *parent):
connect(schedule_from, SIGNAL(timeChanged(QTime)), this, SLOT(enableApplyButton()));
connect(schedule_to, SIGNAL(timeChanged(QTime)), this, SLOT(enableApplyButton()));
connect(schedule_days, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton()));
connect(comboBTProtocol, SIGNAL(currentIndexChanged(int)), SLOT(enableApplyButton()));
connect(checkuTP, SIGNAL(toggled(bool)), SLOT(enableApplyButton()));
connect(checkLimituTPConnections, SIGNAL(toggled(bool)), SLOT(enableApplyButton()));
connect(checkLimitTransportOverhead, SIGNAL(toggled(bool)), SLOT(enableApplyButton()));
// Bittorrent tab
@@ -223,7 +221,7 @@ options_imp::options_imp(QWidget *parent):
checkAppendqB->setVisible(false);
#endif
#if LIBTORRENT_VERSION_MINOR < 16
comboBTProtocol->setVisible(false);
checkuTP->setVisible(false);
checkLimituTPConnections->setVisible(false);
#endif
// Load Advanced settings
@@ -391,7 +389,7 @@ void options_imp::saveOptions(){
const QPair<int, int> down_up_limit = getGlobalBandwidthLimits();
pref.setGlobalDownloadLimit(down_up_limit.first);
pref.setGlobalUploadLimit(down_up_limit.second);
pref.setBTProtocol(comboBTProtocol->currentIndex());
pref.setuTPEnabled(checkuTP->isChecked());
pref.setuTPRateLimited(checkLimituTPConnections->isChecked());
pref.includeOverheadInLimits(checkLimitTransportOverhead->isChecked());
pref.setAltGlobalDownloadLimit(spinDownloadLimitAlt->value());
@@ -586,7 +584,7 @@ void options_imp::loadOptions(){
spinUploadLimitAlt->setValue(pref.getAltGlobalUploadLimit());
spinDownloadLimitAlt->setValue(pref.getAltGlobalDownloadLimit());
// Options
comboBTProtocol->setCurrentIndex((int)pref.getBTProtocol());
checkuTP->setChecked(pref.isuTPEnabled());
checkLimituTPConnections->setChecked(pref.isuTPRateLimited());
checkLimitTransportOverhead->setChecked(pref.includeOverheadInLimits());
// Scheduler
@@ -1204,21 +1202,3 @@ QString options_imp::languageToLocalizedString(QLocale::Language language, const
}
}
}
void options_imp::updateBTProtocolSettings(int protocol)
{
switch(protocol) {
case BT::TCP:
checkLimituTPConnections->setEnabled(false);
break;
case BT::TCP_uTP:
checkLimituTPConnections->setEnabled(true);
break;
case BT::uTP:
checkLimituTPConnections->setEnabled(true);
break;
default:
Q_ASSERT(0);
break;
}
}