qml: add server and proxy config dialogs
This commit is contained in:
@@ -10,7 +10,7 @@ Image {
|
||||
property bool lagging: connected && Network.isLagging
|
||||
property bool fork: connected && Network.chaintips > 1
|
||||
property bool syncing: connected && Daemon.currentWallet && Daemon.currentWallet.synchronizing
|
||||
property bool proxy: connected && Network.proxy.mode
|
||||
property bool proxy: connected && 'mode' in Network.proxy && Network.proxy.mode
|
||||
|
||||
// ?: in order to keep this a binding..
|
||||
source: !connected
|
||||
|
||||
@@ -3,6 +3,8 @@ import QtQuick.Layouts 1.0
|
||||
import QtQuick.Controls 2.1
|
||||
|
||||
Item {
|
||||
id: pc
|
||||
|
||||
property alias proxy_enabled: proxy_enabled_cb.checked
|
||||
property alias proxy_type: proxytype.currentIndex
|
||||
property alias proxy_address: address.text
|
||||
@@ -12,8 +14,29 @@ Item {
|
||||
|
||||
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 {
|
||||
id: rootLayout
|
||||
|
||||
width: parent.width
|
||||
spacing: constants.paddingLarge
|
||||
|
||||
Label {
|
||||
text: qsTr('Proxy settings')
|
||||
|
||||
@@ -6,8 +6,13 @@ Item {
|
||||
property alias auto_server: auto_server_cb.checked
|
||||
property alias address: address_tf.text
|
||||
|
||||
height: rootLayout.height
|
||||
|
||||
ColumnLayout {
|
||||
id: rootLayout
|
||||
|
||||
width: parent.width
|
||||
spacing: constants.paddingLarge
|
||||
|
||||
Label {
|
||||
text: qsTr('Server settings')
|
||||
@@ -31,6 +36,7 @@ Item {
|
||||
TextField {
|
||||
id: address_tf
|
||||
enabled: !auto_server_cb.checked
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user