Browse Source

qml: cleanup

master
Sander van Grieken 3 years ago
parent
commit
2eaf3dcc64
  1. 32
      electrum/gui/qml/components/WalletDetails.qml

32
electrum/gui/qml/components/WalletDetails.qml

@ -16,19 +16,16 @@ Pane {
property bool _is2fa: Daemon.currentWallet && Daemon.currentWallet.walletType == '2fa' property bool _is2fa: Daemon.currentWallet && Daemon.currentWallet.walletType == '2fa'
function enableLightning() { function enableLightning() {
var dialog = app.messageDialog.createObject(rootItem, var dialog = app.messageDialog.createObject(rootItem, {
{'title': qsTr('Enable Lightning for this wallet?'), 'yesno': true}) title: qsTr('Enable Lightning for this wallet?'),
yesno: true
})
dialog.accepted.connect(function() { dialog.accepted.connect(function() {
Daemon.currentWallet.enableLightning() Daemon.currentWallet.enableLightning()
}) })
dialog.open() dialog.open()
} }
function changePassword() {
// trigger dialog via wallet (auth then signal)
Daemon.startChangePassword()
}
function importAddressesKeys() { function importAddressesKeys() {
var dialog = importAddressesKeysDialog.createObject(rootItem) var dialog = importAddressesKeysDialog.createObject(rootItem)
dialog.open() dialog.open()
@ -44,7 +41,7 @@ Pane {
Layout.fillHeight: true Layout.fillHeight: true
contentHeight: flickableRoot.height contentHeight: flickableRoot.height
clip:true clip: true
interactive: height < contentHeight interactive: height < contentHeight
Pane { Pane {
@ -416,7 +413,7 @@ Pane {
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredWidth: 1 Layout.preferredWidth: 1
text: qsTr('Change Password') text: qsTr('Change Password')
onClicked: rootItem.changePassword() onClicked: Daemon.startChangePassword()
icon.source: '../../icons/lock.png' icon.source: '../../icons/lock.png'
} }
FlatButton { FlatButton {
@ -466,19 +463,30 @@ Pane {
} }
function onWalletDeleteError(code, message) { function onWalletDeleteError(code, message) {
if (code == 'unpaid_requests') { if (code == 'unpaid_requests') {
var dialog = app.messageDialog.createObject(app, {title: qsTr('Error'), text: message, yesno: true }) var dialog = app.messageDialog.createObject(app, {
title: qsTr('Error'),
text: message,
yesno: true
})
dialog.accepted.connect(function() { dialog.accepted.connect(function() {
Daemon.checkThenDeleteWallet(Daemon.currentWallet, true) Daemon.checkThenDeleteWallet(Daemon.currentWallet, true)
}) })
dialog.open() dialog.open()
} else if (code == 'balance') { } else if (code == 'balance') {
var dialog = app.messageDialog.createObject(app, {title: qsTr('Error'), text: message, yesno: true }) var dialog = app.messageDialog.createObject(app, {
title: qsTr('Error'),
text: message,
yesno: true
})
dialog.accepted.connect(function() { dialog.accepted.connect(function() {
Daemon.checkThenDeleteWallet(Daemon.currentWallet, true, true) Daemon.checkThenDeleteWallet(Daemon.currentWallet, true, true)
}) })
dialog.open() dialog.open()
} else { } else {
var dialog = app.messageDialog.createObject(app, {title: qsTr('Error'), text: message }) var dialog = app.messageDialog.createObject(app, {
title: qsTr('Error'),
text: message
})
dialog.open() dialog.open()
} }
} }

Loading…
Cancel
Save