feat: support proxy user and password
This commit is contained in:
@@ -743,11 +743,15 @@ void Controller::setApplicationProxy()
|
|||||||
proxy.setType(QNetworkProxy::HttpProxy);
|
proxy.setType(QNetworkProxy::HttpProxy);
|
||||||
proxy.setHostName(cfg->proxyHost());
|
proxy.setHostName(cfg->proxyHost());
|
||||||
proxy.setPort(cfg->proxyPort());
|
proxy.setPort(cfg->proxyPort());
|
||||||
|
proxy.setUser(cfg->proxyUser());
|
||||||
|
proxy.setPassword(cfg->proxyPassword());
|
||||||
break;
|
break;
|
||||||
case 2: // SOCKS 5
|
case 2: // SOCKS 5
|
||||||
proxy.setType(QNetworkProxy::Socks5Proxy);
|
proxy.setType(QNetworkProxy::Socks5Proxy);
|
||||||
proxy.setHostName(cfg->proxyHost());
|
proxy.setHostName(cfg->proxyHost());
|
||||||
proxy.setPort(cfg->proxyPort());
|
proxy.setPort(cfg->proxyPort());
|
||||||
|
proxy.setUser(cfg->proxyUser());
|
||||||
|
proxy.setPassword(cfg->proxyPassword());
|
||||||
break;
|
break;
|
||||||
case 0: // System Default
|
case 0: // System Default
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -133,6 +133,14 @@
|
|||||||
<label>The port number of the proxy</label>
|
<label>The port number of the proxy</label>
|
||||||
<default>1080</default>
|
<default>1080</default>
|
||||||
</entry>
|
</entry>
|
||||||
|
<entry name="ProxyUser" type="String">
|
||||||
|
<label>The user of the proxy</label>
|
||||||
|
<default></default>
|
||||||
|
</entry>
|
||||||
|
<entry name="ProxyPassword" type="Password">
|
||||||
|
<label>The password of the proxy</label>
|
||||||
|
<default></default>
|
||||||
|
</entry>
|
||||||
</group>
|
</group>
|
||||||
</kcfg>
|
</kcfg>
|
||||||
|
|
||||||
|
|||||||
@@ -93,6 +93,25 @@ Kirigami.ScrollablePage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
MobileForm.FormTextFieldDelegate {
|
||||||
|
id: userField
|
||||||
|
label: i18n("User")
|
||||||
|
text: Config.proxyUser
|
||||||
|
inputMethodHints: Qt.ImhUrlCharactersOnly
|
||||||
|
onEditingFinished: {
|
||||||
|
proxyConfigChanged = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MobileForm.FormTextFieldDelegate {
|
||||||
|
id: passwordField
|
||||||
|
label: i18n("Password")
|
||||||
|
text: Config.proxyPassword
|
||||||
|
echoMode: TextInput.Password
|
||||||
|
inputMethodHints: Qt.ImhUrlCharactersOnly
|
||||||
|
onEditingFinished: {
|
||||||
|
proxyConfigChanged = true
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -111,6 +130,8 @@ Kirigami.ScrollablePage {
|
|||||||
Config.proxyType = currentType
|
Config.proxyType = currentType
|
||||||
Config.proxyHost = hostField.text
|
Config.proxyHost = hostField.text
|
||||||
Config.proxyPort = portField.value
|
Config.proxyPort = portField.value
|
||||||
|
Config.proxyUser = userField.text
|
||||||
|
Config.proxyPassword = passwordField.text
|
||||||
Config.save()
|
Config.save()
|
||||||
proxyConfigChanged = false
|
proxyConfigChanged = false
|
||||||
Controller.setApplicationProxy()
|
Controller.setApplicationProxy()
|
||||||
|
|||||||
Reference in New Issue
Block a user