aboutsummaryrefslogtreecommitdiff
path: root/src/qt/transactionview.cpp
diff options
context:
space:
mode:
authorJarol Rodriguez <jarolrod@tutanota.com>2021-02-17 19:57:49 -0500
committerJarol Rodriguez <jarolrod@tutanota.com>2021-02-17 19:57:49 -0500
commit8f9644890a167a093d95ecef1f12a20dce1bc581 (patch)
treec3b68ea187021022952e4e53817ebae4827d6512 /src/qt/transactionview.cpp
parentf5cdc290d5a41895d2bbaf474c3a951e5141b8a9 (diff)
downloadbitcoin-8f9644890a167a093d95ecef1f12a20dce1bc581.tar.xz
qt: Remove Transactionview Edit Label Action
Among the context menu actions for each transaction in the transactionview is the 'Edit Label' action. While all other actions apply directly to the selected transaction, the 'Edit Label' action applies to the address of the selected transaction. This creates a confusing UX scenario where the outcome of the action is ambiguous. The action of Editing a Label should instead be reserved for the Send and Receive tabs. This PR removes the 'Edit Label' action from the transactionview context menu. Since the 'Edit Label' action will no longer be utilized in the transactionview, the 'Edit Label' function logic is also removed.
Diffstat (limited to 'src/qt/transactionview.cpp')
-rw-r--r--src/qt/transactionview.cpp49
1 files changed, 0 insertions, 49 deletions
diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp
index 54ecfc38ec..b8912b1906 100644
--- a/src/qt/transactionview.cpp
+++ b/src/qt/transactionview.cpp
@@ -158,7 +158,6 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa
QAction *copyTxIDAction = new QAction(tr("Copy transaction ID"), this);
QAction *copyTxHexAction = new QAction(tr("Copy raw transaction"), this);
QAction *copyTxPlainText = new QAction(tr("Copy full transaction details"), this);
- QAction *editLabelAction = new QAction(tr("Edit label"), this);
QAction *showDetailsAction = new QAction(tr("Show transaction details"), this);
contextMenu = new QMenu(this);
@@ -173,7 +172,6 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa
contextMenu->addSeparator();
contextMenu->addAction(bumpFeeAction);
contextMenu->addAction(abandonAction);
- contextMenu->addAction(editLabelAction);
connect(dateWidget, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &TransactionView::chooseDate);
connect(typeWidget, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &TransactionView::chooseType);
@@ -194,7 +192,6 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa
connect(copyTxIDAction, &QAction::triggered, this, &TransactionView::copyTxID);
connect(copyTxHexAction, &QAction::triggered, this, &TransactionView::copyTxHex);
connect(copyTxPlainText, &QAction::triggered, this, &TransactionView::copyTxPlainText);
- connect(editLabelAction, &QAction::triggered, this, &TransactionView::editLabel);
connect(showDetailsAction, &QAction::triggered, this, &TransactionView::showDetails);
// Double-clicking on a transaction on the transaction history page shows details
connect(this, &TransactionView::doubleClicked, this, &TransactionView::showDetails);
@@ -474,52 +471,6 @@ void TransactionView::copyTxPlainText()
GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::TxPlainTextRole);
}
-void TransactionView::editLabel()
-{
- if(!transactionView->selectionModel() ||!model)
- return;
- QModelIndexList selection = transactionView->selectionModel()->selectedRows();
- if(!selection.isEmpty())
- {
- AddressTableModel *addressBook = model->getAddressTableModel();
- if(!addressBook)
- return;
- QString address = selection.at(0).data(TransactionTableModel::AddressRole).toString();
- if(address.isEmpty())
- {
- // If this transaction has no associated address, exit
- return;
- }
- // Is address in address book? Address book can miss address when a transaction is
- // sent from outside the UI.
- int idx = addressBook->lookupAddress(address);
- if(idx != -1)
- {
- // Edit sending / receiving address
- QModelIndex modelIdx = addressBook->index(idx, 0, QModelIndex());
- // Determine type of address, launch appropriate editor dialog type
- QString type = modelIdx.data(AddressTableModel::TypeRole).toString();
-
- EditAddressDialog dlg(
- type == AddressTableModel::Receive
- ? EditAddressDialog::EditReceivingAddress
- : EditAddressDialog::EditSendingAddress, this);
- dlg.setModel(addressBook);
- dlg.loadRow(idx);
- dlg.exec();
- }
- else
- {
- // Add sending address
- EditAddressDialog dlg(EditAddressDialog::NewSendingAddress,
- this);
- dlg.setModel(addressBook);
- dlg.setAddress(address);
- dlg.exec();
- }
- }
-}
-
void TransactionView::showDetails()
{
if(!transactionView->selectionModel())