mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-06 15:42:32 -06:00
Merge pull request #7894 from Piccirello/auto-management
Disable options when Force Proxy is enabled
This commit is contained in:
@@ -192,6 +192,7 @@ OptionsDialog::OptionsDialog(QWidget *parent)
|
||||
void (QComboBox::*qComboBoxCurrentIndexChanged)(int) = &QComboBox::currentIndexChanged;
|
||||
void (QSpinBox::*qSpinBoxValueChanged)(int) = &QSpinBox::valueChanged;
|
||||
|
||||
connect(m_ui->checkForceProxy, &QAbstractButton::toggled, this, &ThisType::enableForceProxy);
|
||||
connect(m_ui->comboProxyType, qComboBoxCurrentIndexChanged, this, &ThisType::enableProxy);
|
||||
connect(m_ui->checkRandomPort, &QAbstractButton::toggled, m_ui->spinPort, &ThisType::setDisabled);
|
||||
|
||||
@@ -962,6 +963,7 @@ void OptionsDialog::loadOptions()
|
||||
|
||||
m_ui->checkProxyPeerConnecs->setChecked(session->isProxyPeerConnectionsEnabled());
|
||||
m_ui->checkForceProxy->setChecked(session->isForceProxyEnabled());
|
||||
enableForceProxy(session->isForceProxyEnabled());
|
||||
m_ui->isProxyOnlyForTorrents->setChecked(proxyConfigManager->isProxyOnlyForTorrents());
|
||||
enableProxy(m_ui->comboProxyType->currentIndex());
|
||||
|
||||
@@ -1317,6 +1319,13 @@ void OptionsDialog::toggleComboRatioLimitAct()
|
||||
m_ui->comboRatioLimitAct->setEnabled(m_ui->checkMaxRatio->isChecked() || m_ui->checkMaxSeedingMinutes->isChecked());
|
||||
}
|
||||
|
||||
void OptionsDialog::enableForceProxy(bool enable)
|
||||
{
|
||||
m_ui->checkUPnP->setEnabled(!enable);
|
||||
m_ui->checkDHT->setEnabled(!enable);
|
||||
m_ui->checkLSD->setEnabled(!enable);
|
||||
}
|
||||
|
||||
void OptionsDialog::enableProxy(int index)
|
||||
{
|
||||
if (index) {
|
||||
@@ -1337,6 +1346,7 @@ void OptionsDialog::enableProxy(int index)
|
||||
m_ui->isProxyOnlyForTorrents->setEnabled(false);
|
||||
m_ui->isProxyOnlyForTorrents->setChecked(true);
|
||||
}
|
||||
enableForceProxy(m_ui->checkForceProxy->isChecked());
|
||||
}
|
||||
else {
|
||||
//disable
|
||||
@@ -1349,6 +1359,7 @@ void OptionsDialog::enableProxy(int index)
|
||||
m_ui->isProxyOnlyForTorrents->setEnabled(false);
|
||||
m_ui->checkProxyAuth->setEnabled(false);
|
||||
m_ui->checkProxyAuth->setChecked(false);
|
||||
enableForceProxy(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -84,6 +84,7 @@ public slots:
|
||||
void showConnectionTab();
|
||||
|
||||
private slots:
|
||||
void enableForceProxy(bool enable);
|
||||
void enableProxy(int index);
|
||||
void on_buttonBox_accepted();
|
||||
void closeEvent(QCloseEvent *e);
|
||||
|
||||
@@ -1581,14 +1581,28 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkForceProxy">
|
||||
<property name="text">
|
||||
<string>Disable connections not supported by proxies</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<layout class="QHBoxLayout" name="forceProxyHorizontalLayout">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkForceProxy">
|
||||
<property name="text">
|
||||
<string>Disable connections not supported by proxies</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="labelForceProxy">
|
||||
<property name="text">
|
||||
<string>(<a href="https://github.com/qbittorrent/qBittorrent/wiki/Disable-connections-not-supported-by-proxies">More information</a>)</string>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="isProxyOnlyForTorrents">
|
||||
@@ -2222,7 +2236,7 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="label_anonymous">
|
||||
<property name="text">
|
||||
<string> (<a href="https://github.com/qbittorrent/qBittorrent/wiki/Anonymous-Mode">More information</a>)</string>
|
||||
<string>(<a href="https://github.com/qbittorrent/qBittorrent/wiki/Anonymous-Mode">More information</a>)</string>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
|
||||
Reference in New Issue
Block a user