-
Notifications
You must be signed in to change notification settings - Fork 50
Get new address from selected wallet in receive tab #496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: qt6
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested,
I did not encounter any issues✅
@@ -208,6 +208,14 @@ Page { | |||
} | |||
} | |||
|
|||
function clear() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to the root? It is a reasonable function at the component level.
} | ||
} | ||
|
||
Connections { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to not rely on walletController
, move this to DesktopWallets
where walletController
is already referenced, add an id
to RequestPayment
and call clear()
.
@@ -16,6 +16,7 @@ Page { | |||
background: null | |||
|
|||
property int requestCounter: 0 | |||
property WalletQmlModel wallet: walletController.selectedWallet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make required
and move binding to DesktopWallets
:
RequestPayment {
wallet: walletController.selectedWallet
}
@@ -63,6 +63,16 @@ QString WalletQmlModel::name() const | |||
return QString::fromStdString(m_wallet->getWalletName()); | |||
} | |||
|
|||
QString WalletQmlModel::newAddress(QString label) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe rename to getNewAddress
.
@@ -198,8 +199,10 @@ Page { | |||
requestCounter = requestCounter + 1 | |||
clearRequest.visible = true | |||
title.text = qsTr("Payment request #" + requestCounter) | |||
address.text = "bc1q f5xe y2tf 89k9 zy6k gnru wszy 5fsa truy 9te1 bu" | |||
qrImage.code = "bc1qf5xey2tf89k9zy6kgnruwszy5fsatruy9te1bu" | |||
var newAddress = root.wallet.newAddress(label.text) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const address = root.wallet.getNewAddress(label.text)
qrImage.code = address
address.text = address.replace(/(.{4})/g, "$1 ").trim()
Closes #491
"Create bitcoin address" button now connects to the wallet interface and gets a new address. It generates a QR code and everything clears when switching wallets. It should also save the label if used.