Add (experimental) I2P support

PR #18717.
Closes #16257.
This commit is contained in:
Vladimir Golovnev 2023-03-21 08:33:46 +03:00 committed by GitHub
parent 8cbe4a571c
commit cdded6cef7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 295 additions and 72 deletions

View file

@ -782,6 +782,11 @@ void OptionsDialog::loadConnectionTabOptions()
m_ui->spinMaxUploadsPerTorrent->setEnabled(false);
}
m_ui->textI2PHost->setText(session->I2PAddress());
m_ui->spinI2PPort->setValue(session->I2PPort());
m_ui->checkI2PMixed->setChecked(session->I2PMixedMode());
m_ui->groupI2P->setChecked(session->isI2PEnabled());
const auto *proxyConfigManager = Net::ProxyConfigurationManager::instance();
const Net::ProxyConfiguration proxyConf = proxyConfigManager->proxyConfiguration();
@ -831,6 +836,11 @@ void OptionsDialog::loadConnectionTabOptions()
connect(m_ui->textProxyIP, &QLineEdit::textChanged, this, &ThisType::enableApplyButton);
connect(m_ui->spinProxyPort, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
connect(m_ui->textI2PHost, &QLineEdit::textChanged, this, &ThisType::enableApplyButton);
connect(m_ui->spinI2PPort, qSpinBoxValueChanged, this, &ThisType::enableApplyButton);
connect(m_ui->checkI2PMixed, &QCheckBox::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->groupI2P, &QGroupBox::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkProxyBitTorrent, &QGroupBox::toggled, this, &ThisType::enableApplyButton);
connect(m_ui->checkProxyBitTorrent, &QGroupBox::toggled, this, &ThisType::adjustProxyOptions);
connect(m_ui->checkProxyPeerConnections, &QAbstractButton::toggled, this, &ThisType::enableApplyButton);
@ -862,6 +872,11 @@ void OptionsDialog::saveConnectionTabOptions() const
session->setMaxUploads(getMaxUploads());
session->setMaxUploadsPerTorrent(getMaxUploadsPerTorrent());
session->setI2PEnabled(m_ui->groupI2P->isChecked());
session->setI2PAddress(m_ui->textI2PHost->text().trimmed());
session->setI2PPort(m_ui->spinI2PPort->value());
session->setI2PMixedMode(m_ui->checkI2PMixed->isChecked());
auto proxyConfigManager = Net::ProxyConfigurationManager::instance();
Net::ProxyConfiguration proxyConf;
proxyConf.type = getProxyType();