qml: remove yesClicked signal, use accept()/accepted signal in MessageDialog.
This commit is contained in:
@@ -249,7 +249,7 @@ Pane {
|
||||
: qsTr('Are you sure you want to delete this channel? This will purge associated transactions from your wallet history.'),
|
||||
yesno: true
|
||||
})
|
||||
dialog.yesClicked.connect(function() {
|
||||
dialog.accepted.connect(function() {
|
||||
channeldetails.deleteChannel()
|
||||
app.stack.pop()
|
||||
Daemon.currentWallet.historyModel.init_model(true) // needed here?
|
||||
|
||||
@@ -16,8 +16,6 @@ ElDialog {
|
||||
property alias text: message.text
|
||||
property bool richText: false
|
||||
|
||||
signal yesClicked
|
||||
|
||||
z: 1 // raise z so it also covers dialogs using overlay as parent
|
||||
|
||||
anchors.centerIn: parent
|
||||
@@ -49,7 +47,7 @@ ElDialog {
|
||||
text: qsTr('Ok')
|
||||
icon.source: Qt.resolvedUrl('../../icons/confirmed.png')
|
||||
visible: !yesno
|
||||
onClicked: dialog.close()
|
||||
onClicked: accept()
|
||||
}
|
||||
|
||||
FlatButton {
|
||||
@@ -59,10 +57,7 @@ ElDialog {
|
||||
text: qsTr('Yes')
|
||||
icon.source: Qt.resolvedUrl('../../icons/confirmed.png')
|
||||
visible: yesno
|
||||
onClicked: {
|
||||
yesClicked()
|
||||
dialog.close()
|
||||
}
|
||||
onClicked: accept()
|
||||
}
|
||||
FlatButton {
|
||||
Layout.fillWidth: true
|
||||
@@ -71,10 +66,7 @@ ElDialog {
|
||||
text: qsTr('No')
|
||||
icon.source: Qt.resolvedUrl('../../icons/closebutton.png')
|
||||
visible: yesno
|
||||
onClicked: {
|
||||
reject()
|
||||
dialog.close()
|
||||
}
|
||||
onClicked: reject()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ ElDialog {
|
||||
onConflictingBackup: {
|
||||
var dialog = app.messageDialog.createObject(app, { 'text': message, 'yesno': true })
|
||||
dialog.open()
|
||||
dialog.yesClicked.connect(function() {
|
||||
dialog.accepted.connect(function() {
|
||||
channelopener.open_channel(true)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -258,7 +258,7 @@ Pane {
|
||||
text: qsTr('Using plain gossip mode is not recommended on mobile. Are you sure?'),
|
||||
yesno: true
|
||||
})
|
||||
dialog.yesClicked.connect(function() {
|
||||
dialog.accepted.connect(function() {
|
||||
Config.useGossip = true
|
||||
})
|
||||
dialog.rejected.connect(function() {
|
||||
|
||||
@@ -400,8 +400,7 @@ Pane {
|
||||
onLabelChanged: root.detailsChanged()
|
||||
onConfirmRemoveLocalTx: {
|
||||
var dialog = app.messageDialog.createObject(app, { text: message, yesno: true })
|
||||
dialog.yesClicked.connect(function() {
|
||||
dialog.close()
|
||||
dialog.accepted.connect(function() {
|
||||
txdetails.removeLocalTx(true)
|
||||
root.close()
|
||||
})
|
||||
|
||||
@@ -18,7 +18,7 @@ Pane {
|
||||
function enableLightning() {
|
||||
var dialog = app.messageDialog.createObject(rootItem,
|
||||
{'text': qsTr('Enable Lightning for this wallet?'), 'yesno': true})
|
||||
dialog.yesClicked.connect(function() {
|
||||
dialog.accepted.connect(function() {
|
||||
Daemon.currentWallet.enableLightning()
|
||||
})
|
||||
dialog.open()
|
||||
@@ -27,7 +27,7 @@ Pane {
|
||||
function deleteWallet() {
|
||||
var dialog = app.messageDialog.createObject(rootItem,
|
||||
{'text': qsTr('Really delete this wallet?'), 'yesno': true})
|
||||
dialog.yesClicked.connect(function() {
|
||||
dialog.accepted.connect(function() {
|
||||
Daemon.checkThenDeleteWallet(Daemon.currentWallet)
|
||||
})
|
||||
dialog.open()
|
||||
@@ -476,13 +476,13 @@ Pane {
|
||||
function onWalletDeleteError(code, message) {
|
||||
if (code == 'unpaid_requests') {
|
||||
var dialog = app.messageDialog.createObject(app, {text: message, yesno: true })
|
||||
dialog.yesClicked.connect(function() {
|
||||
dialog.accepted.connect(function() {
|
||||
Daemon.checkThenDeleteWallet(Daemon.currentWallet, true)
|
||||
})
|
||||
dialog.open()
|
||||
} else if (code == 'balance') {
|
||||
var dialog = app.messageDialog.createObject(app, {text: message, yesno: true })
|
||||
dialog.yesClicked.connect(function() {
|
||||
dialog.accepted.connect(function() {
|
||||
Daemon.checkThenDeleteWallet(Daemon.currentWallet, true, true)
|
||||
})
|
||||
dialog.open()
|
||||
|
||||
@@ -372,7 +372,7 @@ Item {
|
||||
text: qsTr('Import Channel backup?'),
|
||||
yesno: true
|
||||
})
|
||||
dialog.yesClicked.connect(function() {
|
||||
dialog.accepted.connect(function() {
|
||||
Daemon.currentWallet.importChannelBackup(data)
|
||||
close()
|
||||
})
|
||||
|
||||
@@ -382,8 +382,7 @@ ApplicationWindow
|
||||
wallet: Daemon.currentWallet
|
||||
onConfirm: {
|
||||
var dialog = app.messageDialog.createObject(app, {text: message, yesno: true})
|
||||
dialog.yesClicked.connect(function() {
|
||||
dialog.close()
|
||||
dialog.accepted.connect(function() {
|
||||
__swaphelper.executeSwap(true)
|
||||
})
|
||||
dialog.open()
|
||||
@@ -459,8 +458,7 @@ ApplicationWindow
|
||||
text: qsTr('Close Electrum?'),
|
||||
yesno: true
|
||||
})
|
||||
dialog.yesClicked.connect(function() {
|
||||
dialog.close()
|
||||
dialog.accepted.connect(function() {
|
||||
app._wantClose = true
|
||||
app.close()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user