diff --git a/electrum/gui/qml/components/ChannelDetails.qml b/electrum/gui/qml/components/ChannelDetails.qml index 99d9fdd01..b57708bc5 100644 --- a/electrum/gui/qml/components/ChannelDetails.qml +++ b/electrum/gui/qml/components/ChannelDetails.qml @@ -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? diff --git a/electrum/gui/qml/components/MessageDialog.qml b/electrum/gui/qml/components/MessageDialog.qml index b8c10335c..4b01c915a 100644 --- a/electrum/gui/qml/components/MessageDialog.qml +++ b/electrum/gui/qml/components/MessageDialog.qml @@ -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() } } } diff --git a/electrum/gui/qml/components/OpenChannelDialog.qml b/electrum/gui/qml/components/OpenChannelDialog.qml index 759ff4190..1870d8186 100644 --- a/electrum/gui/qml/components/OpenChannelDialog.qml +++ b/electrum/gui/qml/components/OpenChannelDialog.qml @@ -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) }) } diff --git a/electrum/gui/qml/components/Preferences.qml b/electrum/gui/qml/components/Preferences.qml index bc090c9ea..b4d07c127 100644 --- a/electrum/gui/qml/components/Preferences.qml +++ b/electrum/gui/qml/components/Preferences.qml @@ -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() { diff --git a/electrum/gui/qml/components/TxDetails.qml b/electrum/gui/qml/components/TxDetails.qml index b8c99bd96..6e46904f2 100644 --- a/electrum/gui/qml/components/TxDetails.qml +++ b/electrum/gui/qml/components/TxDetails.qml @@ -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() }) diff --git a/electrum/gui/qml/components/WalletDetails.qml b/electrum/gui/qml/components/WalletDetails.qml index 1c3e977ac..290b25bf0 100644 --- a/electrum/gui/qml/components/WalletDetails.qml +++ b/electrum/gui/qml/components/WalletDetails.qml @@ -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() diff --git a/electrum/gui/qml/components/WalletMainView.qml b/electrum/gui/qml/components/WalletMainView.qml index 30d56158f..921e5a117 100644 --- a/electrum/gui/qml/components/WalletMainView.qml +++ b/electrum/gui/qml/components/WalletMainView.qml @@ -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() }) diff --git a/electrum/gui/qml/components/main.qml b/electrum/gui/qml/components/main.qml index 7baaf45ee..2a83729a0 100644 --- a/electrum/gui/qml/components/main.qml +++ b/electrum/gui/qml/components/main.qml @@ -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() })