aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2022-03-18 16:22:57 -0500
committerluigi1111 <luigi1111w@gmail.com>2022-03-18 16:22:57 -0500
commit002fe8eefa5616ee7eb7c21a4dc827e357f3fcb0 (patch)
tree2f25e79379b7ce590160ad343498d87f83af1f9e
parent1dba06a7ff0c22bd41ec43be921b7fb208b07d74 (diff)
parent62748b61215da976bc4ab2212939930d56310aa5 (diff)
downloadmonzero-gui-002fe8eefa5616ee7eb7c21a4dc827e357f3fcb0.tar.gz
monzero-gui-002fe8eefa5616ee7eb7c21a4dc827e357f3fcb0.tar.xz
monzero-gui-002fe8eefa5616ee7eb7c21a4dc827e357f3fcb0.zip
Merge pull request #3865
62748b6 AddressBook: fix adding new entry (selsta)
-rw-r--r--pages/AddressBook.qml28
1 files changed, 16 insertions, 12 deletions
diff --git a/pages/AddressBook.qml b/pages/AddressBook.qml
index 56e9048d..27821e4c 100644
--- a/pages/AddressBook.qml
+++ b/pages/AddressBook.qml
@@ -468,21 +468,25 @@ Rectangle {
text: (root.editEntry ? qsTr("Save") : qsTr("Add")) + translationManager.emptyString
enabled: root.checkInformation(addressLine.text, appWindow.persistentSettings.nettype)
onClicked: {
- console.log("Add")
- if (!root.editEntry && !currentWallet.addressBook.addRow(addressLine.text.trim(),"", descriptionLine.text)) {
- informationPopup.title = qsTr("Error") + translationManager.emptyString;
- // TODO: check currentWallet.addressBook.errorString() instead.
- if(currentWallet.addressBook.errorCode() === AddressBook.Invalid_Address)
- informationPopup.text = qsTr("Invalid address") + translationManager.emptyString
- else if(currentWallet.addressBook.errorCode() === AddressBook.Invalid_Payment_Id)
- informationPopup.text = currentWallet.addressBook.errorString()
- else
- informationPopup.text = qsTr("Can't create entry") + translationManager.emptyString
+ if (!root.editEntry) {
+ if (currentWallet.addressBook.addRow(addressLine.text.trim(),"", descriptionLine.text)) {
+ console.log("Entry added")
+ } else {
+ informationPopup.title = qsTr("Error") + translationManager.emptyString;
+ // TODO: check currentWallet.addressBook.errorString() instead.
+ if (currentWallet.addressBook.errorCode() === AddressBook.Invalid_Address)
+ informationPopup.text = qsTr("Invalid address") + translationManager.emptyString
+ else if (currentWallet.addressBook.errorCode() === AddressBook.Invalid_Payment_Id)
+ informationPopup.text = currentWallet.addressBook.errorString()
+ else
+ informationPopup.text = qsTr("Can't create entry") + translationManager.emptyString
- informationPopup.onCloseCallback = null
- informationPopup.open();
+ informationPopup.onCloseCallback = null
+ informationPopup.open();
+ }
} else {
currentWallet.addressBook.setDescription(addressBookListView.currentIndex, descriptionLine.text);
+ console.log("Description edited")
}
root.showAddressBook()
}