Browse Source

qml: use only genericsharedialog component defined in main

patch-4
Sander van Grieken 2 years ago
parent
commit
153a9f3a53
  1. 13
      electrum/gui/qml/components/AddressDetails.qml
  2. 9
      electrum/gui/qml/components/ChannelDetails.qml
  3. 17
      electrum/gui/qml/components/LightningPaymentDetails.qml
  4. 10
      electrum/gui/qml/components/TxDetails.qml
  5. 13
      electrum/gui/qml/components/Wallets.qml

13
electrum/gui/qml/components/AddressDetails.qml

@ -83,7 +83,9 @@ Pane {
icon.source: '../../icons/share.png'
icon.color: 'transparent'
onClicked: {
var dialog = share.createObject(root, { 'title': qsTr('Address'), 'text': root.address })
var dialog = app.genericShareDialog.createObject(root,
{ title: qsTr('Address'), text: root.address }
)
dialog.open()
}
}
@ -176,7 +178,9 @@ Pane {
icon.source: '../../icons/share.png'
icon.color: 'transparent'
onClicked: {
var dialog = share.createObject(root, { 'title': qsTr('Public key'), 'text': modelData })
var dialog = app.genericShareDialog.createObject(root,
{ title: qsTr('Public key'), text: modelData }
)
dialog.open()
}
}
@ -260,9 +264,4 @@ Pane {
onFrozenChanged: addressDetailsChanged()
onLabelChanged: addressDetailsChanged()
}
Component {
id: share
GenericShareDialog {}
}
}

9
electrum/gui/qml/components/ChannelDetails.qml

@ -242,7 +242,9 @@ Pane {
icon.source: '../../icons/share.png'
icon.color: 'transparent'
onClicked: {
var dialog = share.createObject(root, { 'title': qsTr('Channel node ID'), 'text': channeldetails.pubkey })
var dialog = app.genericShareDialog.createObject(root,
{ title: qsTr('Channel node ID'), text: channeldetails.pubkey }
)
dialog.open()
}
}
@ -258,11 +260,6 @@ Pane {
channelid: root.channelid
}
Component {
id: share
GenericShareDialog {}
}
Component {
id: closechannel
CloseChannelDialog {}

17
electrum/gui/qml/components/LightningPaymentDetails.qml

@ -168,7 +168,9 @@ Pane {
icon.source: '../../icons/share.png'
icon.color: 'transparent'
onClicked: {
var dialog = share.createObject(root, { 'title': qsTr('Payment hash'), 'text': lnpaymentdetails.payment_hash })
var dialog = app.genericShareDialog.createObject(root,
{ title: qsTr('Payment hash'), text: lnpaymentdetails.payment_hash }
)
dialog.open()
}
}
@ -200,7 +202,9 @@ Pane {
icon.source: '../../icons/share.png'
icon.color: 'transparent'
onClicked: {
var dialog = share.createObject(root, { 'title': qsTr('Preimage'), 'text': lnpaymentdetails.preimage })
var dialog = app.genericShareDialog.createObject(root,
{ title: qsTr('Preimage'), text: lnpaymentdetails.preimage }
)
dialog.open()
}
}
@ -235,7 +239,9 @@ Pane {
icon.color: enabled ? 'transparent' : constants.mutedForeground
enabled: lnpaymentdetails.invoice != ''
onClicked: {
var dialog = share.createObject(root, { 'title': qsTr('Lightning Invoice'), 'text': lnpaymentdetails.invoice })
var dialog = app.genericShareDialog.createObject(root,
{ title: qsTr('Lightning Invoice'), text: lnpaymentdetails.invoice }
)
dialog.open()
}
}
@ -253,9 +259,4 @@ Pane {
onLabelChanged: root.detailsChanged()
}
Component {
id: share
GenericShareDialog {}
}
}

10
electrum/gui/qml/components/TxDetails.qml

@ -261,7 +261,9 @@ Pane {
icon.source: '../../icons/share.png'
icon.color: 'transparent'
onClicked: {
var dialog = share.createObject(root, { 'title': qsTr('Transaction ID'), 'text': root.txid })
var dialog = app.genericShareDialog.createObject(root,
{ title: qsTr('Transaction ID'), text: root.txid }
)
dialog.open()
}
}
@ -314,10 +316,4 @@ Pane {
txid: root.txid
onLabelChanged: root.detailsChanged()
}
Component {
id: share
GenericShareDialog {}
}
}

13
electrum/gui/qml/components/Wallets.qml

@ -171,9 +171,9 @@ Pane {
icon.source: '../../icons/share.png'
icon.color: 'transparent'
onClicked: {
var dialog = share.createObject(rootItem, {
'title': qsTr('Master Public Key'),
'text': Daemon.currentWallet.masterPubkey
var dialog = app.genericShareDialog.createObject(rootItem, {
title: qsTr('Master Public Key'),
text: Daemon.currentWallet.masterPubkey
})
dialog.open()
}
@ -356,11 +356,4 @@ Pane {
dialog.open()
}
}
Component {
id: share
GenericShareDialog {
onClosed: destroy()
}
}
}

Loading…
Cancel
Save