|
|
@ -144,7 +144,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){ |
|
|
|
// Connection tab
|
|
|
|
// Connection tab
|
|
|
|
connect(spinPort, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); |
|
|
|
connect(spinPort, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); |
|
|
|
connect(checkUPnP, SIGNAL(toggled(bool)), 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(checkUploadLimit, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); |
|
|
|
connect(checkDownloadLimit, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); |
|
|
|
connect(checkDownloadLimit, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); |
|
|
|
connect(spinUploadLimit, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); |
|
|
|
connect(spinUploadLimit, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); |
|
|
@ -359,7 +358,6 @@ void options_imp::saveOptions(){ |
|
|
|
// Connection preferences
|
|
|
|
// Connection preferences
|
|
|
|
pref.setSessionPort(getPort()); |
|
|
|
pref.setSessionPort(getPort()); |
|
|
|
pref.setUPnPEnabled(isUPnPEnabled()); |
|
|
|
pref.setUPnPEnabled(isUPnPEnabled()); |
|
|
|
pref.setNATPMPEnabled(isNATPMPEnabled()); |
|
|
|
|
|
|
|
const QPair<int, int> down_up_limit = getGlobalBandwidthLimits(); |
|
|
|
const QPair<int, int> down_up_limit = getGlobalBandwidthLimits(); |
|
|
|
pref.setGlobalDownloadLimit(down_up_limit.first); |
|
|
|
pref.setGlobalDownloadLimit(down_up_limit.first); |
|
|
|
pref.setGlobalUploadLimit(down_up_limit.second); |
|
|
|
pref.setGlobalUploadLimit(down_up_limit.second); |
|
|
@ -529,7 +527,6 @@ void options_imp::loadOptions(){ |
|
|
|
// Connection preferences
|
|
|
|
// Connection preferences
|
|
|
|
spinPort->setValue(pref.getSessionPort()); |
|
|
|
spinPort->setValue(pref.getSessionPort()); |
|
|
|
checkUPnP->setChecked(pref.isUPnPEnabled()); |
|
|
|
checkUPnP->setChecked(pref.isUPnPEnabled()); |
|
|
|
checkNATPMP->setChecked(pref.isNATPMPEnabled()); |
|
|
|
|
|
|
|
intValue = pref.getGlobalDownloadLimit(); |
|
|
|
intValue = pref.getGlobalDownloadLimit(); |
|
|
|
if(intValue > 0) { |
|
|
|
if(intValue > 0) { |
|
|
|
// Enabled
|
|
|
|
// Enabled
|
|
|
@ -717,10 +714,6 @@ bool options_imp::isUPnPEnabled() const{ |
|
|
|
return checkUPnP->isChecked(); |
|
|
|
return checkUPnP->isChecked(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool options_imp::isNATPMPEnabled() const{ |
|
|
|
|
|
|
|
return checkNATPMP->isChecked(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Return Download & Upload limits in kbps
|
|
|
|
// Return Download & Upload limits in kbps
|
|
|
|
// [download,upload]
|
|
|
|
// [download,upload]
|
|
|
|
QPair<int,int> options_imp::getGlobalBandwidthLimits() const{ |
|
|
|
QPair<int,int> options_imp::getGlobalBandwidthLimits() const{ |
|
|
|