1
0

move wizard components to separate files, add initial bip39 refine page

This commit is contained in:
Sander van Grieken
2022-03-11 15:44:08 +01:00
parent 17820b9346
commit bbd0ff8b91
17 changed files with 719 additions and 562 deletions

View File

@@ -2,6 +2,8 @@ import QtQuick 2.6
import QtQuick.Layouts 1.0
import QtQuick.Controls 2.3
import "wizard"
Wizard {
id: serverconnectwizard
@@ -37,177 +39,15 @@ Wizard {
}
property Component autoconnect: Component {
WizardComponent {
valid: true
last: serverconnectgroup.checkedButton.connecttype === 'auto'
onAccept: {
wizard_data['autoconnect'] = serverconnectgroup.checkedButton.connecttype === 'auto'
}
ColumnLayout {
width: parent.width
InfoTextArea {
text: qsTr('Electrum communicates with remote servers to get information about your transactions and addresses. The servers all fulfill the same purpose only differing in hardware. In most cases you simply want to let Electrum pick one at random. However if you prefer feel free to select a server manually.')
Layout.fillWidth: true
}
ButtonGroup {
id: serverconnectgroup
}
RadioButton {
ButtonGroup.group: serverconnectgroup
property string connecttype: 'auto'
text: qsTr('Auto connect')
}
RadioButton {
ButtonGroup.group: serverconnectgroup
property string connecttype: 'manual'
checked: true
text: qsTr('Select servers manually')
}
}
}
WCAutoConnect {}
}
property Component proxyconfig: Component {
WizardComponent {
valid: true
onAccept: {
var p = {}
p['enabled'] = proxy_enabled.checked
if (proxy_enabled.checked) {
var type = proxytype.currentValue.toLowerCase()
if (type == 'tor')
type = 'socks5'
p['mode'] = type
p['host'] = address.text
p['port'] = port.text
p['user'] = username.text
p['password'] = password.text
}
wizard_data['proxy'] = p
}
ColumnLayout {
width: parent.width
Label {
text: qsTr('Proxy settings')
}
CheckBox {
id: proxy_enabled
text: qsTr('Enable Proxy')
}
ComboBox {
id: proxytype
enabled: proxy_enabled.checked
model: ['TOR', 'SOCKS5', 'SOCKS4']
onCurrentIndexChanged: {
if (currentIndex == 0) {
address.text = "127.0.0.1"
port.text = "9050"
}
}
}
GridLayout {
columns: 4
Layout.fillWidth: true
Label {
text: qsTr("Address")
enabled: address.enabled
}
TextField {
id: address
enabled: proxytype.enabled && proxytype.currentIndex > 0
}
Label {
text: qsTr("Port")
enabled: port.enabled
}
TextField {
id: port
enabled: proxytype.enabled && proxytype.currentIndex > 0
}
Label {
text: qsTr("Username")
enabled: username.enabled
}
TextField {
id: username
enabled: proxytype.enabled && proxytype.currentIndex > 0
}
Label {
text: qsTr("Password")
enabled: password.enabled
}
TextField {
id: password
enabled: proxytype.enabled && proxytype.currentIndex > 0
echoMode: TextInput.Password
}
}
}
}
WCProxyConfig {}
}
property Component serverconfig: Component {
WizardComponent {
valid: true
last: true
onAccept: {
wizard_data['oneserver'] = !auto_server.checked
wizard_data['server'] = address.text
}
ColumnLayout {
width: parent.width
Label {
text: qsTr('Server settings')
}
CheckBox {
id: auto_server
text: qsTr('Select server automatically')
checked: true
}
GridLayout {
columns: 2
Layout.fillWidth: true
Label {
text: qsTr("Server")
enabled: address.enabled
}
TextField {
id: address
enabled: !auto_server.checked
}
}
}
}
WCServerConfig {}
}
}