mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-12-22 19:49:34 +00:00
Merge pull request #3865
62748b6
AddressBook: fix adding new entry (selsta)
This commit is contained in:
commit
002fe8eefa
1 changed files with 16 additions and 12 deletions
|
@ -468,8 +468,10 @@ 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)) {
|
||||||
|
console.log("Entry added")
|
||||||
|
} else {
|
||||||
informationPopup.title = qsTr("Error") + translationManager.emptyString;
|
informationPopup.title = qsTr("Error") + translationManager.emptyString;
|
||||||
// TODO: check currentWallet.addressBook.errorString() instead.
|
// TODO: check currentWallet.addressBook.errorString() instead.
|
||||||
if (currentWallet.addressBook.errorCode() === AddressBook.Invalid_Address)
|
if (currentWallet.addressBook.errorCode() === AddressBook.Invalid_Address)
|
||||||
|
@ -481,8 +483,10 @@ Rectangle {
|
||||||
|
|
||||||
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 a new issue