1
0

qt,qml: add a welcome page as initial page for server connect wizard

This is much less intimidating than asking if the user wants to use a proxy
out of the gate.
This commit is contained in:
Sander van Grieken
2023-12-11 15:17:45 +01:00
parent 6e576f2a08
commit a03b2d7bae
14 changed files with 126 additions and 17 deletions

View File

@@ -6,6 +6,7 @@ import "../controls"
WizardComponent {
valid: true
title: qsTr('Server')
function apply() {
wizard_data['autoconnect'] = serverconnectgroup.checkedButton.connecttype === 'auto'

View File

@@ -7,6 +7,7 @@ import "../controls"
WizardComponent {
valid: true
title: qsTr('Proxy')
function apply() {
wizard_data['want_proxy'] = wantproxygroup.checkedButton.wantproxy

View File

@@ -6,6 +6,7 @@ import "../controls"
WizardComponent {
valid: true
title: qsTr('Proxy')
function apply() {
wizard_data['proxy'] = pc.toProxyDict()

View File

@@ -7,6 +7,7 @@ import "../controls"
WizardComponent {
valid: true
last: true
title: qsTr('Server')
function apply() {
wizard_data['autoconnect'] = sc.address == ""

View File

@@ -0,0 +1,48 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
// import org.electrum 1.0
import "../controls"
WizardComponent {
valid: true
title: qsTr('Electrum Bitcoin Wallet')
function apply() {
wizard_data['use_defaults'] = use_defaults.checked
if (use_defaults.checked) {
wizard_data['autoconnect'] = true
wizard_data['want_proxy'] = false
}
}
ColumnLayout {
width: parent.width
Image {
Layout.fillWidth: true
fillMode: Image.PreserveAspectFit
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
}
CheckBox {
id: use_defaults
Layout.alignment: Qt.AlignHCenter
text: qsTr('Use default network settings')
checked: true
onCheckedChanged: checkIsLast()
}
}
}

View File

@@ -15,7 +15,8 @@ ElDialog {
padding: 0
title: wizardTitle + (pages.currentItem.title ? ' - ' + pages.currentItem.title : '')
title: (pages.currentItem.wizard_title ? pages.currentItem.wizard_title : wizardTitle) +
(pages.currentItem.title ? ' - ' + pages.currentItem.title : '')
iconSource: '../../../icons/electrum.png'
// android back button triggers close() on Popups. Disabling close here,

View File

@@ -10,6 +10,7 @@ Pane {
property var wizard_data : ({})
property bool valid
property bool last: false
property string wizard_title: ''
property string title: ''
property bool securePage: false