Browse Source

qml: remove yesClicked signal, use accept()/accepted signal in MessageDialog.

master
Sander van Grieken 3 years ago
parent
commit
75f63a4666
  1. 2
      electrum/gui/qml/components/ChannelDetails.qml
  2. 14
      electrum/gui/qml/components/MessageDialog.qml
  3. 2
      electrum/gui/qml/components/OpenChannelDialog.qml
  4. 2
      electrum/gui/qml/components/Preferences.qml
  5. 3
      electrum/gui/qml/components/TxDetails.qml
  6. 8
      electrum/gui/qml/components/WalletDetails.qml
  7. 2
      electrum/gui/qml/components/WalletMainView.qml
  8. 6
      electrum/gui/qml/components/main.qml

2
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?

14
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()
}
}
}

2
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)
})
}

2
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() {

3
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()
})

8
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()

2
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()
})

6
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()
})

Loading…
Cancel
Save