|
|
|
@ -3,6 +3,8 @@ import QtQuick.Layouts 1.0 |
|
|
|
import QtQuick.Controls 2.1 |
|
|
|
import QtQuick.Controls 2.1 |
|
|
|
|
|
|
|
|
|
|
|
Item { |
|
|
|
Item { |
|
|
|
|
|
|
|
id: pc |
|
|
|
|
|
|
|
|
|
|
|
property alias proxy_enabled: proxy_enabled_cb.checked |
|
|
|
property alias proxy_enabled: proxy_enabled_cb.checked |
|
|
|
property alias proxy_type: proxytype.currentIndex |
|
|
|
property alias proxy_type: proxytype.currentIndex |
|
|
|
property alias proxy_address: address.text |
|
|
|
property alias proxy_address: address.text |
|
|
|
@ -12,8 +14,29 @@ Item { |
|
|
|
|
|
|
|
|
|
|
|
property var proxy_types: ['TOR', 'SOCKS5', 'SOCKS4'] |
|
|
|
property var proxy_types: ['TOR', 'SOCKS5', 'SOCKS4'] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
height: rootLayout.height |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function toProxyDict() { |
|
|
|
|
|
|
|
var p = {} |
|
|
|
|
|
|
|
p['enabled'] = pc.proxy_enabled |
|
|
|
|
|
|
|
if (pc.proxy_enabled) { |
|
|
|
|
|
|
|
var type = pc.proxy_types[pc.proxy_type].toLowerCase() |
|
|
|
|
|
|
|
if (type == 'tor') |
|
|
|
|
|
|
|
type = 'socks5' |
|
|
|
|
|
|
|
p['mode'] = type |
|
|
|
|
|
|
|
p['host'] = pc.proxy_address |
|
|
|
|
|
|
|
p['port'] = pc.proxy_port |
|
|
|
|
|
|
|
p['user'] = pc.username |
|
|
|
|
|
|
|
p['password'] = pc.password |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return p |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
ColumnLayout { |
|
|
|
ColumnLayout { |
|
|
|
|
|
|
|
id: rootLayout |
|
|
|
|
|
|
|
|
|
|
|
width: parent.width |
|
|
|
width: parent.width |
|
|
|
|
|
|
|
spacing: constants.paddingLarge |
|
|
|
|
|
|
|
|
|
|
|
Label { |
|
|
|
Label { |
|
|
|
text: qsTr('Proxy settings') |
|
|
|
text: qsTr('Proxy settings') |
|
|
|
|