From 0b0d58b289b2acc60efd33147c4c7a91751d3881 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Mon, 10 Jul 2023 11:22:50 +0000 Subject: [PATCH] qml: fix "copy" and "share" buttons for channel backup dialogs The QR code was shown but the copy/share buttons did not do anything. --- electrum/gui/qml/components/GenericShareDialog.qml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/electrum/gui/qml/components/GenericShareDialog.qml b/electrum/gui/qml/components/GenericShareDialog.qml index aa85a12e2..423d6819c 100644 --- a/electrum/gui/qml/components/GenericShareDialog.qml +++ b/electrum/gui/qml/components/GenericShareDialog.qml @@ -10,7 +10,11 @@ ElDialog { property string text property string text_qr - // if text_qr is undefined text will be used + // If text is set, it is displayed as a string and also used as data in the QR code shown. + // text_qr can also be set if we want to show different data in the QR code. + // If only text_qr is set, the QR code is shown but the string itself is not, + // however the copy button still exposes the string. + property string text_help property int helpTextIconStyle: InfoTextArea.IconStyle.Info @@ -84,7 +88,7 @@ ElDialog { text: qsTr('Copy') icon.source: '../../icons/copy_bw.png' onClicked: { - AppController.textToClipboard(dialog.text) + AppController.textToClipboard(dialog.text ? dialog.text : dialog.text_qr) toaster.show(this, qsTr('Copied!')) } } @@ -95,7 +99,7 @@ ElDialog { text: qsTr('Share') icon.source: '../../icons/share.png' onClicked: { - AppController.doShare(dialog.text, dialog.title) + AppController.doShare(dialog.text ? dialog.text : dialog.text_qr, dialog.title) } } }