mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-12-24 12:39:25 +00:00
Receive: allow integrated addresses from custom payment ids
This needs a matching update from monero to not override invalid payment ids.
This commit is contained in:
parent
05046a5f21
commit
58cae5bebd
1 changed files with 11 additions and 7 deletions
|
@ -41,16 +41,19 @@ Rectangle {
|
||||||
property alias paymentIdText : paymentIdLine.text
|
property alias paymentIdText : paymentIdLine.text
|
||||||
property alias integratedAddressText : integratedAddressLine.text
|
property alias integratedAddressText : integratedAddressLine.text
|
||||||
|
|
||||||
function updatePaymentId() {
|
function updatePaymentId(payment_id) {
|
||||||
var payment_id = appWindow.persistentSettings.payment_id
|
if (typeof appWindow.currentWallet === 'undefined')
|
||||||
if (typeof appWindow.currentWallet !== 'undefined') {
|
return
|
||||||
|
// generate a new one if not given as argument
|
||||||
|
if (typeof payment_id === 'undefined') {
|
||||||
payment_id = appWindow.currentWallet.generatePaymentId()
|
payment_id = appWindow.currentWallet.generatePaymentId()
|
||||||
appWindow.persistentSettings.payment_id = payment_id
|
appWindow.persistentSettings.payment_id = payment_id
|
||||||
addressLine.text = appWindow.currentWallet.address
|
paymentIdLine.text = payment_id
|
||||||
integratedAddressLine.text = appWindow.currentWallet.integratedAddress(payment_id)
|
|
||||||
}
|
}
|
||||||
|
addressLine.text = appWindow.currentWallet.address
|
||||||
paymentIdLine.text = payment_id
|
integratedAddressLine.text = appWindow.currentWallet.integratedAddress(payment_id)
|
||||||
|
if (integratedAddressLine.text === "")
|
||||||
|
integratedAddressLine.text = qsTr("Invalid payment ID")
|
||||||
}
|
}
|
||||||
|
|
||||||
Clipboard { id: clipboard }
|
Clipboard { id: clipboard }
|
||||||
|
@ -148,6 +151,7 @@ Rectangle {
|
||||||
fontSize: mainLayout.lineEditFontSize
|
fontSize: mainLayout.lineEditFontSize
|
||||||
placeholderText: qsTr("Payment ID here") + translationManager.emptyString;
|
placeholderText: qsTr("Payment ID here") + translationManager.emptyString;
|
||||||
readOnly: false
|
readOnly: false
|
||||||
|
onTextChanged: updatePaymentId(paymentIdLine.text)
|
||||||
|
|
||||||
width: mainLayout.editWidth
|
width: mainLayout.editWidth
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
Loading…
Reference in a new issue