|
|
@ -301,7 +301,6 @@ OptionsDialog::OptionsDialog(QWidget *parent) |
|
|
|
void (QSpinBox::*qSpinBoxValueChanged)(int) = &QSpinBox::valueChanged; |
|
|
|
void (QSpinBox::*qSpinBoxValueChanged)(int) = &QSpinBox::valueChanged; |
|
|
|
|
|
|
|
|
|
|
|
connect(m_ui->comboProxyType, qComboBoxCurrentIndexChanged, this, &ThisType::enableProxy); |
|
|
|
connect(m_ui->comboProxyType, qComboBoxCurrentIndexChanged, this, &ThisType::enableProxy); |
|
|
|
connect(m_ui->checkRandomPort, &QAbstractButton::toggled, m_ui->spinPort, &ThisType::setDisabled); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Apply button is activated when a value is changed
|
|
|
|
// Apply button is activated when a value is changed
|
|
|
|
// Behavior tab
|
|
|
|
// Behavior tab
|
|
|
@ -409,7 +408,6 @@ OptionsDialog::OptionsDialog(QWidget *parent) |
|
|
|
// Connection tab
|
|
|
|
// Connection tab
|
|
|
|
connect(m_ui->comboProtocol, qComboBoxCurrentIndexChanged, this, &ThisType::enableApplyButton); |
|
|
|
connect(m_ui->comboProtocol, qComboBoxCurrentIndexChanged, this, &ThisType::enableApplyButton); |
|
|
|
connect(m_ui->spinPort, qSpinBoxValueChanged, this, &ThisType::enableApplyButton); |
|
|
|
connect(m_ui->spinPort, qSpinBoxValueChanged, this, &ThisType::enableApplyButton); |
|
|
|
connect(m_ui->checkRandomPort, &QAbstractButton::toggled, this, &ThisType::enableApplyButton); |
|
|
|
|
|
|
|
connect(m_ui->checkUPnP, &QAbstractButton::toggled, this, &ThisType::enableApplyButton); |
|
|
|
connect(m_ui->checkUPnP, &QAbstractButton::toggled, this, &ThisType::enableApplyButton); |
|
|
|
connect(m_ui->spinUploadLimit, qSpinBoxValueChanged, this, &ThisType::enableApplyButton); |
|
|
|
connect(m_ui->spinUploadLimit, qSpinBoxValueChanged, this, &ThisType::enableApplyButton); |
|
|
|
connect(m_ui->spinDownloadLimit, qSpinBoxValueChanged, this, &ThisType::enableApplyButton); |
|
|
|
connect(m_ui->spinDownloadLimit, qSpinBoxValueChanged, this, &ThisType::enableApplyButton); |
|
|
@ -775,7 +773,6 @@ void OptionsDialog::saveOptions() |
|
|
|
// Connection preferences
|
|
|
|
// Connection preferences
|
|
|
|
session->setBTProtocol(static_cast<BitTorrent::BTProtocol>(m_ui->comboProtocol->currentIndex())); |
|
|
|
session->setBTProtocol(static_cast<BitTorrent::BTProtocol>(m_ui->comboProtocol->currentIndex())); |
|
|
|
session->setPort(getPort()); |
|
|
|
session->setPort(getPort()); |
|
|
|
session->setUseRandomPort(m_ui->checkRandomPort->isChecked()); |
|
|
|
|
|
|
|
Net::PortForwarder::instance()->setEnabled(isUPnPEnabled()); |
|
|
|
Net::PortForwarder::instance()->setEnabled(isUPnPEnabled()); |
|
|
|
session->setGlobalDownloadSpeedLimit(m_ui->spinDownloadLimit->value() * 1024); |
|
|
|
session->setGlobalDownloadSpeedLimit(m_ui->spinDownloadLimit->value() * 1024); |
|
|
|
session->setGlobalUploadSpeedLimit(m_ui->spinUploadLimit->value() * 1024); |
|
|
|
session->setGlobalUploadSpeedLimit(m_ui->spinUploadLimit->value() * 1024); |
|
|
@ -1072,10 +1069,8 @@ void OptionsDialog::loadOptions() |
|
|
|
|
|
|
|
|
|
|
|
// Connection preferences
|
|
|
|
// Connection preferences
|
|
|
|
m_ui->comboProtocol->setCurrentIndex(static_cast<int>(session->btProtocol())); |
|
|
|
m_ui->comboProtocol->setCurrentIndex(static_cast<int>(session->btProtocol())); |
|
|
|
m_ui->checkUPnP->setChecked(Net::PortForwarder::instance()->isEnabled()); |
|
|
|
|
|
|
|
m_ui->checkRandomPort->setChecked(session->useRandomPort()); |
|
|
|
|
|
|
|
m_ui->spinPort->setValue(session->port()); |
|
|
|
m_ui->spinPort->setValue(session->port()); |
|
|
|
m_ui->spinPort->setDisabled(m_ui->checkRandomPort->isChecked()); |
|
|
|
m_ui->checkUPnP->setChecked(Net::PortForwarder::instance()->isEnabled()); |
|
|
|
|
|
|
|
|
|
|
|
intValue = session->maxConnections(); |
|
|
|
intValue = session->maxConnections(); |
|
|
|
if (intValue > 0) |
|
|
|
if (intValue > 0) |
|
|
|