history: add option to remove failed tx

This commit is contained in:
tobtoht
2024-03-13 14:10:20 +01:00
parent fcf5ab2bd1
commit 52a69a454e
5 changed files with 32 additions and 1 deletions
+14
View File
@@ -90,6 +90,10 @@ void HistoryWidget::showContextMenu(const QPoint &point) {
menu.addAction("Resend transaction", this, &HistoryWidget::onResendTransaction);
}
if (tx->isFailed()) {
menu.addAction("Remove from history", this, &HistoryWidget::onRemoveFromHistory);
}
menu.addMenu(m_copyMenu);
menu.addAction("Show details", this, &HistoryWidget::showTxDetails);
menu.addAction("View on block explorer", this, &HistoryWidget::onViewOnBlockExplorer);
@@ -106,6 +110,16 @@ void HistoryWidget::onResendTransaction() {
}
}
void HistoryWidget::onRemoveFromHistory() {
auto *tx = ui->history->currentEntry();
if (!tx) return;
auto result = QMessageBox::question(this, "Remove transaction from history", "Are you sure you want to remove this transaction from the history?");
if (result == QMessageBox::Yes) {
m_wallet->removeFailedTx(tx->hash());
}
}
void HistoryWidget::resetModel()
{
// Save view state