diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-06-07 18:31:51 +0300 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-09-07 09:37:34 +0300 |
commit | 6f6fde30e7601185a8f6052b3bf1770407fcc14b (patch) | |
tree | 258856160af090844bc811f191da99488eb355ee /src | |
parent | 59f7ba4fd7a9e4bc73d784ee74d5b777da9cc436 (diff) |
qt, refactor: Keep EditAddressDialog in the main event loop
Diffstat (limited to 'src')
-rw-r--r-- | src/qt/addressbookpage.cpp | 8 | ||||
-rw-r--r-- | src/qt/transactionview.cpp | 16 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/qt/addressbookpage.cpp b/src/qt/addressbookpage.cpp index c31f0aceea..40f9f972c0 100644 --- a/src/qt/addressbookpage.cpp +++ b/src/qt/addressbookpage.cpp @@ -182,14 +182,14 @@ void AddressBookPage::onEditAction() if(indexes.isEmpty()) return; - EditAddressDialog dlg( + auto dlg = new EditAddressDialog( tab == SendingTab ? EditAddressDialog::EditSendingAddress : EditAddressDialog::EditReceivingAddress, this); - dlg.setModel(model); + dlg->setModel(model); QModelIndex origIndex = proxyModel->mapToSource(indexes.at(0)); - dlg.loadRow(origIndex.row()); - dlg.exec(); + dlg->loadRow(origIndex.row()); + GUIUtil::ShowModalDialogAndDeleteOnClose(dlg); } void AddressBookPage::on_newAddress_clicked() diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index 908cb917f1..d04dd11ad1 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -500,22 +500,22 @@ void TransactionView::editLabel() // Determine type of address, launch appropriate editor dialog type QString type = modelIdx.data(AddressTableModel::TypeRole).toString(); - EditAddressDialog dlg( + auto dlg = new EditAddressDialog( type == AddressTableModel::Receive ? EditAddressDialog::EditReceivingAddress : EditAddressDialog::EditSendingAddress, this); - dlg.setModel(addressBook); - dlg.loadRow(idx); - dlg.exec(); + dlg->setModel(addressBook); + dlg->loadRow(idx); + GUIUtil::ShowModalDialogAndDeleteOnClose(dlg); } else { // Add sending address - EditAddressDialog dlg(EditAddressDialog::NewSendingAddress, + auto dlg = new EditAddressDialog(EditAddressDialog::NewSendingAddress, this); - dlg.setModel(addressBook); - dlg.setAddress(address); - dlg.exec(); + dlg->setModel(addressBook); + dlg->setAddress(address); + GUIUtil::ShowModalDialogAndDeleteOnClose(dlg); } } } |