diff --git a/electrum/gui/qml/components/AddressDetails.qml b/electrum/gui/qml/components/AddressDetails.qml index d07d3781d..ad1d34d61 100644 --- a/electrum/gui/qml/components/AddressDetails.qml +++ b/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 {} - } } diff --git a/electrum/gui/qml/components/ChannelDetails.qml b/electrum/gui/qml/components/ChannelDetails.qml index cea3b5b90..e08f1cfc6 100644 --- a/electrum/gui/qml/components/ChannelDetails.qml +++ b/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 {} diff --git a/electrum/gui/qml/components/LightningPaymentDetails.qml b/electrum/gui/qml/components/LightningPaymentDetails.qml index 03ed8d31c..41c2c0f57 100644 --- a/electrum/gui/qml/components/LightningPaymentDetails.qml +++ b/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 {} - } - } diff --git a/electrum/gui/qml/components/TxDetails.qml b/electrum/gui/qml/components/TxDetails.qml index f36ad6dfa..9a2b29ed1 100644 --- a/electrum/gui/qml/components/TxDetails.qml +++ b/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 {} - } - } diff --git a/electrum/gui/qml/components/Wallets.qml b/electrum/gui/qml/components/Wallets.qml index 578ab3f9b..4ccac677c 100644 --- a/electrum/gui/qml/components/Wallets.qml +++ b/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() - } - } }