private account copy button copies public keys json

This commit is contained in:
Sergio Chouhy 2026-06-05 22:57:19 -03:00
parent 85e4e0e2d7
commit c375470358
5 changed files with 20 additions and 1 deletions

View File

@ -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) })
}
}
}
}

View File

@ -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 {

View File

@ -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
}

View File

@ -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)
}
}

View File

@ -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 {