mirror of
https://github.com/monero-project/monero-gui
synced 2024-11-24 11:17:15 +01:00
AddressBook: fix adding new entry
This commit is contained in:
parent
ea92f3f272
commit
62748b6121
@ -468,21 +468,25 @@ Rectangle {
|
|||||||
text: (root.editEntry ? qsTr("Save") : qsTr("Add")) + translationManager.emptyString
|
text: (root.editEntry ? qsTr("Save") : qsTr("Add")) + translationManager.emptyString
|
||||||
enabled: root.checkInformation(addressLine.text, appWindow.persistentSettings.nettype)
|
enabled: root.checkInformation(addressLine.text, appWindow.persistentSettings.nettype)
|
||||||
onClicked: {
|
onClicked: {
|
||||||
console.log("Add")
|
if (!root.editEntry) {
|
||||||
if (!root.editEntry && !currentWallet.addressBook.addRow(addressLine.text.trim(),"", descriptionLine.text)) {
|
if (currentWallet.addressBook.addRow(addressLine.text.trim(),"", descriptionLine.text)) {
|
||||||
informationPopup.title = qsTr("Error") + translationManager.emptyString;
|
console.log("Entry added")
|
||||||
// TODO: check currentWallet.addressBook.errorString() instead.
|
} else {
|
||||||
if(currentWallet.addressBook.errorCode() === AddressBook.Invalid_Address)
|
informationPopup.title = qsTr("Error") + translationManager.emptyString;
|
||||||
informationPopup.text = qsTr("Invalid address") + translationManager.emptyString
|
// TODO: check currentWallet.addressBook.errorString() instead.
|
||||||
else if(currentWallet.addressBook.errorCode() === AddressBook.Invalid_Payment_Id)
|
if (currentWallet.addressBook.errorCode() === AddressBook.Invalid_Address)
|
||||||
informationPopup.text = currentWallet.addressBook.errorString()
|
informationPopup.text = qsTr("Invalid address") + translationManager.emptyString
|
||||||
else
|
else if (currentWallet.addressBook.errorCode() === AddressBook.Invalid_Payment_Id)
|
||||||
informationPopup.text = qsTr("Can't create entry") + translationManager.emptyString
|
informationPopup.text = currentWallet.addressBook.errorString()
|
||||||
|
else
|
||||||
|
informationPopup.text = qsTr("Can't create entry") + translationManager.emptyString
|
||||||
|
|
||||||
informationPopup.onCloseCallback = null
|
informationPopup.onCloseCallback = null
|
||||||
informationPopup.open();
|
informationPopup.open();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
currentWallet.addressBook.setDescription(addressBookListView.currentIndex, descriptionLine.text);
|
currentWallet.addressBook.setDescription(addressBookListView.currentIndex, descriptionLine.text);
|
||||||
|
console.log("Description edited")
|
||||||
}
|
}
|
||||||
root.showAddressBook()
|
root.showAddressBook()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user