2023-07-17 10:49:06 +02:00
|
|
|
import QtQuick
|
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
import QtQuick.Controls
|
|
|
|
|
import QtQuick.Controls.Material
|
2022-08-25 11:13:42 +02:00
|
|
|
|
|
|
|
|
import org.electrum 1.0
|
|
|
|
|
|
|
|
|
|
import "controls"
|
|
|
|
|
|
|
|
|
|
ElDialog {
|
|
|
|
|
id: rootItem
|
|
|
|
|
|
|
|
|
|
title: qsTr('Proxy settings')
|
2024-02-19 14:03:39 +01:00
|
|
|
iconSource: Qt.resolvedUrl('../../icons/status_connected_proxy.png')
|
2022-08-25 11:13:42 +02:00
|
|
|
|
|
|
|
|
width: parent.width
|
|
|
|
|
height: parent.height
|
|
|
|
|
|
2022-12-30 22:40:29 +01:00
|
|
|
padding: 0
|
|
|
|
|
|
2022-08-25 11:13:42 +02:00
|
|
|
ColumnLayout {
|
|
|
|
|
width: parent.width
|
2022-12-30 22:40:29 +01:00
|
|
|
height: parent.height
|
|
|
|
|
spacing: 0
|
2022-08-25 11:13:42 +02:00
|
|
|
|
|
|
|
|
ProxyConfig {
|
2022-12-30 22:40:29 +01:00
|
|
|
Layout.fillWidth: true
|
|
|
|
|
Layout.leftMargin: constants.paddingLarge
|
|
|
|
|
Layout.rightMargin: constants.paddingLarge
|
2022-08-25 11:13:42 +02:00
|
|
|
id: proxyconfig
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-30 22:40:29 +01:00
|
|
|
Item { Layout.fillHeight: true; Layout.preferredWidth: 1 }
|
|
|
|
|
|
|
|
|
|
FlatButton {
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
text: qsTr('Ok')
|
|
|
|
|
icon.source: '../../icons/confirmed.png'
|
|
|
|
|
onClicked: {
|
2025-03-03 13:34:05 +01:00
|
|
|
Network.proxy = proxyconfig.toProxyDict()
|
2022-12-30 22:40:29 +01:00
|
|
|
rootItem.close()
|
2022-08-25 11:13:42 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-30 22:40:29 +01:00
|
|
|
|
2022-08-25 11:13:42 +02:00
|
|
|
Component.onCompleted: {
|
|
|
|
|
var p = Network.proxy
|
|
|
|
|
|
2025-03-03 13:34:05 +01:00
|
|
|
proxyconfig.proxy_enabled = p['enabled']
|
|
|
|
|
proxyconfig.proxy_address = p['host']
|
|
|
|
|
proxyconfig.proxy_port = p['port']
|
|
|
|
|
proxyconfig.username = p['user']
|
|
|
|
|
proxyconfig.password = p['password']
|
|
|
|
|
proxyconfig.proxy_type = proxyconfig.proxy_type_map.map(function(x) {
|
|
|
|
|
return x.value
|
|
|
|
|
}).indexOf(p['mode'])
|
2022-08-25 11:13:42 +02:00
|
|
|
}
|
|
|
|
|
}
|