From c3754703584d78d900c6d82dea26b7e49062e146 Mon Sep 17 00:00:00 2001 From: Sergio Chouhy Date: Fri, 5 Jun 2026 22:57:19 -0300 Subject: [PATCH] private account copy button copies public keys json --- src/qml/ExecutionZoneWalletView.qml | 10 ++++++++++ src/qml/controls/AccountComboBox.qml | 2 ++ src/qml/controls/AccountDelegate.qml | 5 ++++- src/qml/views/AccountsPanel.qml | 2 ++ src/qml/views/DashboardView.qml | 2 ++ 5 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/qml/ExecutionZoneWalletView.qml b/src/qml/ExecutionZoneWalletView.qml index efb7136..e7d2b34 100644 --- a/src/qml/ExecutionZoneWalletView.qml +++ b/src/qml/ExecutionZoneWalletView.qml @@ -227,6 +227,16 @@ Rectangle { clipHelper.selectAll() clipHelper.copy() } + onCopyPublicKeysRequested: (accountIdHex) => { + if (!backend) return + logos.watch(backend.getPrivateAccountKeys(accountIdHex), + function(keys) { + clipHelper.text = keys + clipHelper.selectAll() + clipHelper.copy() + }, + function(error) { console.warn("getPrivateAccountKeys failed:", error) }) + } } } } diff --git a/src/qml/controls/AccountComboBox.qml b/src/qml/controls/AccountComboBox.qml index ab213df..8c81196 100644 --- a/src/qml/controls/AccountComboBox.qml +++ b/src/qml/controls/AccountComboBox.qml @@ -12,6 +12,7 @@ ComboBox { // Forwarded from AccountDelegate's copy button — bubble up to the parent // view, which calls backend.copyToClipboard(). signal copyRequested(string text) + signal copyPublicKeysRequested(string accountIdHex) leftPadding: 12 rightPadding: 12 @@ -61,6 +62,7 @@ ComboBox { width: root.popup ? (root.popup.width - root.popup.leftPadding - root.popup.rightPadding) : 368 highlighted: root.highlightedIndex === index onCopyRequested: (text) => root.copyRequested(text) + onCopyPublicKeysRequested: (id) => root.copyPublicKeysRequested(id) } popup: Popup { diff --git a/src/qml/controls/AccountDelegate.qml b/src/qml/controls/AccountDelegate.qml index f45f739..698d346 100644 --- a/src/qml/controls/AccountDelegate.qml +++ b/src/qml/controls/AccountDelegate.qml @@ -14,6 +14,7 @@ ItemDelegate { // the global QML scope for `backend` since it now lives behind the // logos.module() bridge in the parent view. signal copyRequested(string text) + signal copyPublicKeysRequested(string accountIdHex) leftPadding: Theme.spacing.medium rightPadding: Theme.spacing.medium @@ -77,7 +78,9 @@ ItemDelegate { LogosCopyButton { Layout.preferredHeight: 40 Layout.preferredWidth: 40 - onCopyText: root.copyRequested(Base58.encode(model.address ?? "")) + onCopyText: model.isPublic + ? root.copyRequested(Base58.encode(model.address ?? "")) + : root.copyPublicKeysRequested(model.address ?? "") visible: addressLabel.text icon.color: Theme.palette.textMuted } diff --git a/src/qml/views/AccountsPanel.qml b/src/qml/views/AccountsPanel.qml index 797c5e1..aefce03 100644 --- a/src/qml/views/AccountsPanel.qml +++ b/src/qml/views/AccountsPanel.qml @@ -21,6 +21,7 @@ Rectangle { signal createPrivateAccountRequested() signal fetchBalancesRequested() signal copyRequested(string text) + signal copyPublicKeysRequested(string accountIdHex) radius: Theme.spacing.radiusXlarge color: Theme.palette.backgroundSecondary @@ -129,6 +130,7 @@ Rectangle { delegate: AccountDelegate { width: listView.width onCopyRequested: (text) => root.copyRequested(text) + onCopyPublicKeysRequested: (id) => root.copyPublicKeysRequested(id) } } diff --git a/src/qml/views/DashboardView.qml b/src/qml/views/DashboardView.qml index c3d70cf..0172165 100644 --- a/src/qml/views/DashboardView.qml +++ b/src/qml/views/DashboardView.qml @@ -29,6 +29,7 @@ Rectangle { signal transferShieldedOwnedRequested(string fromAccountId, string toAccountId, string amount) signal transferDeshieldedRequested(string fromAccountId, string toAccountId, string amount) signal copyRequested(string copyText) + signal copyPublicKeysRequested(string accountIdHex) color: Theme.palette.background @@ -50,6 +51,7 @@ Rectangle { onCreatePrivateAccountRequested: root.createPrivateAccountRequested() onFetchBalancesRequested: root.fetchBalancesRequested() onCopyRequested: (text) => root.copyRequested(text) + onCopyPublicKeysRequested: (id) => root.copyPublicKeysRequested(id) } TransferPanel {