Skip to content

Commit 8f96448

Browse files
committed
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.
1 parent f5cdc29 commit 8f96448

File tree

2 files changed

+0
-50
lines changed

2 files changed

+0
-50
lines changed

src/qt/transactionview.cpp

-49
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa
158158
QAction *copyTxIDAction = new QAction(tr("Copy transaction ID"), this);
159159
QAction *copyTxHexAction = new QAction(tr("Copy raw transaction"), this);
160160
QAction *copyTxPlainText = new QAction(tr("Copy full transaction details"), this);
161-
QAction *editLabelAction = new QAction(tr("Edit label"), this);
162161
QAction *showDetailsAction = new QAction(tr("Show transaction details"), this);
163162

164163
contextMenu = new QMenu(this);
@@ -173,7 +172,6 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa
173172
contextMenu->addSeparator();
174173
contextMenu->addAction(bumpFeeAction);
175174
contextMenu->addAction(abandonAction);
176-
contextMenu->addAction(editLabelAction);
177175

178176
connect(dateWidget, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &TransactionView::chooseDate);
179177
connect(typeWidget, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &TransactionView::chooseType);
@@ -194,7 +192,6 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa
194192
connect(copyTxIDAction, &QAction::triggered, this, &TransactionView::copyTxID);
195193
connect(copyTxHexAction, &QAction::triggered, this, &TransactionView::copyTxHex);
196194
connect(copyTxPlainText, &QAction::triggered, this, &TransactionView::copyTxPlainText);
197-
connect(editLabelAction, &QAction::triggered, this, &TransactionView::editLabel);
198195
connect(showDetailsAction, &QAction::triggered, this, &TransactionView::showDetails);
199196
// Double-clicking on a transaction on the transaction history page shows details
200197
connect(this, &TransactionView::doubleClicked, this, &TransactionView::showDetails);
@@ -474,52 +471,6 @@ void TransactionView::copyTxPlainText()
474471
GUIUtil::copyEntryData(transactionView, 0, TransactionTableModel::TxPlainTextRole);
475472
}
476473

477-
void TransactionView::editLabel()
478-
{
479-
if(!transactionView->selectionModel() ||!model)
480-
return;
481-
QModelIndexList selection = transactionView->selectionModel()->selectedRows();
482-
if(!selection.isEmpty())
483-
{
484-
AddressTableModel *addressBook = model->getAddressTableModel();
485-
if(!addressBook)
486-
return;
487-
QString address = selection.at(0).data(TransactionTableModel::AddressRole).toString();
488-
if(address.isEmpty())
489-
{
490-
// If this transaction has no associated address, exit
491-
return;
492-
}
493-
// Is address in address book? Address book can miss address when a transaction is
494-
// sent from outside the UI.
495-
int idx = addressBook->lookupAddress(address);
496-
if(idx != -1)
497-
{
498-
// Edit sending / receiving address
499-
QModelIndex modelIdx = addressBook->index(idx, 0, QModelIndex());
500-
// Determine type of address, launch appropriate editor dialog type
501-
QString type = modelIdx.data(AddressTableModel::TypeRole).toString();
502-
503-
EditAddressDialog dlg(
504-
type == AddressTableModel::Receive
505-
? EditAddressDialog::EditReceivingAddress
506-
: EditAddressDialog::EditSendingAddress, this);
507-
dlg.setModel(addressBook);
508-
dlg.loadRow(idx);
509-
dlg.exec();
510-
}
511-
else
512-
{
513-
// Add sending address
514-
EditAddressDialog dlg(EditAddressDialog::NewSendingAddress,
515-
this);
516-
dlg.setModel(addressBook);
517-
dlg.setAddress(address);
518-
dlg.exec();
519-
}
520-
}
521-
}
522-
523474
void TransactionView::showDetails()
524475
{
525476
if(!transactionView->selectionModel())

src/qt/transactionview.h

-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ private Q_SLOTS:
9393
void dateRangeChanged();
9494
void showDetails();
9595
void copyAddress();
96-
void editLabel();
9796
void copyLabel();
9897
void copyAmount();
9998
void copyTxID();

0 commit comments

Comments
 (0)