1
0

qt,qml: add checkboxes for advanced network config on welcome page, remove separate proxy-ask and autoconnect pages

This commit is contained in:
Sander van Grieken
2023-12-18 14:34:42 +01:00
parent 5e39ff49bc
commit ebcecdccce
8 changed files with 92 additions and 212 deletions

View File

@@ -1,50 +0,0 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import "../controls"
WizardComponent {
valid: true
title: qsTr('Server')
function apply() {
wizard_data['autoconnect'] = serverconnectgroup.checkedButton.connecttype === 'auto'
}
ColumnLayout {
width: parent.width
Label {
Layout.fillWidth: true
text: qsTr('How do you want to connect to a server?')
wrapMode: Text.Wrap
}
InfoTextArea {
Layout.fillWidth: true
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.')
}
ButtonGroup {
id: serverconnectgroup
onCheckedButtonChanged: checkIsLast()
}
ElRadioButton {
Layout.fillWidth: true
ButtonGroup.group: serverconnectgroup
property string connecttype: 'auto'
text: qsTr('Auto connect')
checked: true
}
ElRadioButton {
Layout.fillWidth: true
ButtonGroup.group: serverconnectgroup
property string connecttype: 'manual'
text: qsTr('Select servers manually')
}
}
}

View File

@@ -1,44 +0,0 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import QtQuick.Controls.Material
import "../controls"
WizardComponent {
valid: true
title: qsTr('Proxy')
function apply() {
wizard_data['want_proxy'] = wantproxygroup.checkedButton.wantproxy
}
ColumnLayout {
width: parent.width
Label {
Layout.fillWidth: true
text: qsTr('Do you use a local proxy service such as TOR to reach the internet?')
wrapMode: Text.Wrap
}
ButtonGroup {
id: wantproxygroup
onCheckedButtonChanged: checkIsLast()
}
ElRadioButton {
ButtonGroup.group: wantproxygroup
property bool wantproxy: true
text: qsTr('Yes')
}
ElRadioButton {
ButtonGroup.group: wantproxygroup
property bool wantproxy: false
text: qsTr('No')
checked: true
}
}
}

View File

@@ -10,7 +10,7 @@ WizardComponent {
title: qsTr('Server')
function apply() {
wizard_data['autoconnect'] = sc.address == ""
wizard_data['autoconnect'] = sc.address.trim() == ""
wizard_data['server'] = sc.address
}

View File

@@ -2,22 +2,16 @@ import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
// import org.electrum 1.0
import "../controls"
WizardComponent {
valid: true
title: qsTr('Electrum Bitcoin Wallet')
wizard_title: qsTr('Electrum Bitcoin Wallet')
function apply() {
wizard_data['use_defaults'] = use_defaults.checked
wizard_data['want_proxy'] = false
if (use_defaults.checked) {
wizard_data['autoconnect'] = true
} else {
wizard_data['autoconnect'] = undefined
}
wizard_data['use_defaults'] = !config_advanced.checked
wizard_data['want_proxy'] = config_advanced.checked && config_proxy.checked
wizard_data['autoconnect'] = !config_server.checked || !config_advanced.checked
}
ColumnLayout {
@@ -29,22 +23,37 @@ WizardComponent {
source: Qt.resolvedUrl('../../../icons/electrum_presplash.png')
// reduce spacing a bit
Layout.topMargin: -50
Layout.bottomMargin: -160
}
Label {
Layout.alignment: Qt.AlignHCenter
text: qsTr('Welcome')
font.pixelSize: constants.fontSizeXLarge
Layout.bottomMargin: constants.paddingXXLarge
Layout.bottomMargin: -120
}
CheckBox {
id: use_defaults
id: config_advanced
Layout.alignment: Qt.AlignHCenter
text: qsTr('Use default network settings')
checked: true
text: qsTr('Advanced network settings')
checked: false
onCheckedChanged: checkIsLast()
}
ColumnLayout {
Layout.alignment: Qt.AlignHCenter
opacity: config_advanced.checked ? 1 : 0
Behavior on opacity {
NumberAnimation { duration: 300 }
}
CheckBox {
id: config_proxy
text: qsTr('Configure Proxy')
checked: false
onCheckedChanged: checkIsLast()
}
CheckBox {
id: config_server
text: qsTr('Select Server')
checked: false
onCheckedChanged: checkIsLast()
}
}
}
}