|
|
|
|
@ -10,16 +10,14 @@ import "controls"
|
|
|
|
|
ElDialog { |
|
|
|
|
id: openwalletdialog |
|
|
|
|
|
|
|
|
|
width: parent.width * 4/5 |
|
|
|
|
|
|
|
|
|
anchors.centerIn: parent |
|
|
|
|
|
|
|
|
|
title: qsTr("Open Wallet") |
|
|
|
|
iconSource: '../../../icons/wallet.png' |
|
|
|
|
|
|
|
|
|
property string name |
|
|
|
|
property string path |
|
|
|
|
|
|
|
|
|
property bool _unlockClicked: false |
|
|
|
|
|
|
|
|
|
title: qsTr('Open Wallet') |
|
|
|
|
iconSource: Qt.resolvedUrl('../../icons/wallet.png') |
|
|
|
|
|
|
|
|
|
modal: true |
|
|
|
|
parent: Overlay.overlay |
|
|
|
|
Overlay.modal: Rectangle { |
|
|
|
|
@ -28,45 +26,43 @@ ElDialog {
|
|
|
|
|
|
|
|
|
|
focus: true |
|
|
|
|
|
|
|
|
|
property bool _unlockClicked: false |
|
|
|
|
width: parent.width * 4/5 |
|
|
|
|
anchors.centerIn: parent |
|
|
|
|
|
|
|
|
|
padding: 0 |
|
|
|
|
|
|
|
|
|
ColumnLayout { |
|
|
|
|
id: rootLayout |
|
|
|
|
spacing: 0 |
|
|
|
|
width: parent.width |
|
|
|
|
spacing: constants.paddingLarge |
|
|
|
|
|
|
|
|
|
Label { |
|
|
|
|
Layout.alignment: Qt.AlignHCenter |
|
|
|
|
text: name |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Item { |
|
|
|
|
Layout.alignment: Qt.AlignHCenter |
|
|
|
|
Layout.preferredWidth: passwordLayout.width |
|
|
|
|
Layout.preferredHeight: notice.height |
|
|
|
|
ColumnLayout { |
|
|
|
|
id: rootLayout |
|
|
|
|
Layout.fillWidth: true |
|
|
|
|
Layout.leftMargin: constants.paddingXXLarge |
|
|
|
|
Layout.rightMargin: constants.paddingXXLarge |
|
|
|
|
spacing: constants.paddingLarge |
|
|
|
|
|
|
|
|
|
InfoTextArea { |
|
|
|
|
id: notice |
|
|
|
|
text: qsTr("Wallet requires password to unlock") |
|
|
|
|
visible: wallet_db.needsPassword |
|
|
|
|
text: qsTr("Wallet <b>%1</b> requires password to unlock").arg(name) |
|
|
|
|
// visible: false //wallet_db.needsPassword |
|
|
|
|
iconStyle: InfoTextArea.IconStyle.Warn |
|
|
|
|
width: parent.width |
|
|
|
|
Layout.fillWidth: true |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
RowLayout { |
|
|
|
|
id: passwordLayout |
|
|
|
|
Layout.alignment: Qt.AlignHCenter |
|
|
|
|
Label { |
|
|
|
|
text: qsTr('Password') |
|
|
|
|
visible: wallet_db.needsPassword |
|
|
|
|
Layout.fillWidth: true |
|
|
|
|
color: Material.accentColor |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
PasswordField { |
|
|
|
|
id: password |
|
|
|
|
visible: wallet_db.needsPassword |
|
|
|
|
Layout.fillWidth: true |
|
|
|
|
Layout.leftMargin: constants.paddingXLarge |
|
|
|
|
visible: wallet_db.needsPassword |
|
|
|
|
|
|
|
|
|
onTextChanged: { |
|
|
|
|
unlockButton.enabled = true |
|
|
|
|
_unlockClicked = false |
|
|
|
|
@ -75,18 +71,33 @@ ElDialog {
|
|
|
|
|
unlock() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Label { |
|
|
|
|
Layout.alignment: Qt.AlignHCenter |
|
|
|
|
text: !wallet_db.validPassword && _unlockClicked ? qsTr("Invalid Password") : '' |
|
|
|
|
color: constants.colorError |
|
|
|
|
font.pixelSize: constants.fontSizeLarge |
|
|
|
|
Label { |
|
|
|
|
Layout.alignment: Qt.AlignHCenter |
|
|
|
|
text: !wallet_db.validPassword && _unlockClicked ? qsTr("Invalid Password") : '' |
|
|
|
|
color: constants.colorError |
|
|
|
|
font.pixelSize: constants.fontSizeLarge |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Label { |
|
|
|
|
Layout.alignment: Qt.AlignHCenter |
|
|
|
|
visible: wallet_db.requiresSplit |
|
|
|
|
text: qsTr('Wallet requires splitting') |
|
|
|
|
font.pixelSize: constants.fontSizeLarge |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
FlatButton { |
|
|
|
|
Layout.alignment: Qt.AlignHCenter |
|
|
|
|
visible: wallet_db.requiresSplit |
|
|
|
|
text: qsTr('Split wallet') |
|
|
|
|
onClicked: wallet_db.doSplit() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
FlatButton { |
|
|
|
|
id: unlockButton |
|
|
|
|
Layout.alignment: Qt.AlignHCenter |
|
|
|
|
// Layout.alignment: Qt.AlignHCenter |
|
|
|
|
Layout.fillWidth: true |
|
|
|
|
visible: wallet_db.needsPassword |
|
|
|
|
icon.source: '../../icons/unlock.png' |
|
|
|
|
text: qsTr("Unlock") |
|
|
|
|
@ -95,20 +106,6 @@ ElDialog {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Label { |
|
|
|
|
Layout.alignment: Qt.AlignHCenter |
|
|
|
|
visible: wallet_db.requiresSplit |
|
|
|
|
text: qsTr('Wallet requires splitting') |
|
|
|
|
font.pixelSize: constants.fontSizeLarge |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
FlatButton { |
|
|
|
|
Layout.alignment: Qt.AlignHCenter |
|
|
|
|
visible: wallet_db.requiresSplit |
|
|
|
|
text: qsTr('Split wallet') |
|
|
|
|
onClicked: wallet_db.doSplit() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function unlock() { |
|
|
|
|
@ -135,6 +132,9 @@ ElDialog {
|
|
|
|
|
onInvalidPassword: { |
|
|
|
|
password.tf.forceActiveFocus() |
|
|
|
|
} |
|
|
|
|
onNeedsPasswordChanged: { |
|
|
|
|
notice.visible = needsPassword |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Component.onCompleted: { |
|
|
|
|
|