From 969f84913e25eae1442db4d600ad84ce17116f52 Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Wed, 30 Nov 2022 13:56:46 +0100 Subject: [PATCH] qml: keystore icon indicator for watch-only --- electrum/gui/qml/components/Constants.qml | 1 + electrum/gui/qml/components/WalletDetails.qml | 5 +++++ electrum/gui/qml/qewallet.py | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/electrum/gui/qml/components/Constants.qml b/electrum/gui/qml/components/Constants.qml index c52bc89df..7715de68e 100644 --- a/electrum/gui/qml/components/Constants.qml +++ b/electrum/gui/qml/components/Constants.qml @@ -18,6 +18,7 @@ Item { readonly property int fontSizeXLarge: 22 readonly property int fontSizeXXLarge: 28 + readonly property int iconSizeXSmall: 12 readonly property int iconSizeSmall: 16 readonly property int iconSizeMedium: 24 readonly property int iconSizeLarge: 32 diff --git a/electrum/gui/qml/components/WalletDetails.qml b/electrum/gui/qml/components/WalletDetails.qml index 3c2f30e2a..555100434 100644 --- a/electrum/gui/qml/components/WalletDetails.qml +++ b/electrum/gui/qml/components/WalletDetails.qml @@ -295,6 +295,11 @@ Pane { text: '#' + index visible: keystores.count > 1 } + Image { + Layout.preferredWidth: constants.iconSizeXSmall + Layout.preferredHeight: constants.iconSizeXSmall + source: modelData.watch_only ? '../../icons/eye1.png' : '../../icons/key.png' + } } TextHighlightPane { Layout.fillWidth: true diff --git a/electrum/gui/qml/qewallet.py b/electrum/gui/qml/qewallet.py index 7d91480c2..73bce87ce 100644 --- a/electrum/gui/qml/qewallet.py +++ b/electrum/gui/qml/qewallet.py @@ -345,7 +345,8 @@ class QEWallet(AuthMixin, QObject, QtEventListener): result.append({ 'derivation_prefix': k.get_derivation_prefix() or '', 'master_pubkey': k.get_master_public_key() or '', - 'fingerprint': k.get_root_fingerprint() or '' + 'fingerprint': k.get_root_fingerprint() or '', + 'watch_only': k.is_watching_only() }) return result