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

Loading…
Cancel
Save