Bitcoin Core  22.99.0
P2P Digital Currency
transactionview.cpp
Go to the documentation of this file.
1 // Copyright (c) 2011-2021 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #include <qt/transactionview.h>
6 
7 #include <qt/addresstablemodel.h>
8 #include <qt/bitcoinunits.h>
9 #include <qt/csvmodelwriter.h>
10 #include <qt/editaddressdialog.h>
11 #include <qt/guiutil.h>
12 #include <qt/optionsmodel.h>
13 #include <qt/platformstyle.h>
16 #include <qt/transactionrecord.h>
18 #include <qt/walletmodel.h>
19 
20 #include <node/ui_interface.h>
21 
22 #include <chrono>
23 #include <optional>
24 
25 #include <QApplication>
26 #include <QComboBox>
27 #include <QDateTimeEdit>
28 #include <QDesktopServices>
29 #include <QDoubleValidator>
30 #include <QHBoxLayout>
31 #include <QHeaderView>
32 #include <QLabel>
33 #include <QLineEdit>
34 #include <QMenu>
35 #include <QPoint>
36 #include <QScrollBar>
37 #include <QSettings>
38 #include <QTableView>
39 #include <QTimer>
40 #include <QUrl>
41 #include <QVBoxLayout>
42 
43 TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *parent)
44  : QWidget(parent), m_platform_style{platformStyle}
45 {
46  // Build filter row
47  setContentsMargins(0,0,0,0);
48 
49  QHBoxLayout *hlayout = new QHBoxLayout();
50  hlayout->setContentsMargins(0,0,0,0);
51 
52  if (platformStyle->getUseExtraSpacing()) {
53  hlayout->setSpacing(5);
54  hlayout->addSpacing(26);
55  } else {
56  hlayout->setSpacing(0);
57  hlayout->addSpacing(23);
58  }
59 
60  watchOnlyWidget = new QComboBox(this);
61  watchOnlyWidget->setFixedWidth(24);
62  watchOnlyWidget->addItem("", TransactionFilterProxy::WatchOnlyFilter_All);
63  watchOnlyWidget->addItem(platformStyle->SingleColorIcon(":/icons/eye_plus"), "", TransactionFilterProxy::WatchOnlyFilter_Yes);
64  watchOnlyWidget->addItem(platformStyle->SingleColorIcon(":/icons/eye_minus"), "", TransactionFilterProxy::WatchOnlyFilter_No);
65  hlayout->addWidget(watchOnlyWidget);
66 
67  dateWidget = new QComboBox(this);
68  if (platformStyle->getUseExtraSpacing()) {
69  dateWidget->setFixedWidth(121);
70  } else {
71  dateWidget->setFixedWidth(120);
72  }
73  dateWidget->addItem(tr("All"), All);
74  dateWidget->addItem(tr("Today"), Today);
75  dateWidget->addItem(tr("This week"), ThisWeek);
76  dateWidget->addItem(tr("This month"), ThisMonth);
77  dateWidget->addItem(tr("Last month"), LastMonth);
78  dateWidget->addItem(tr("This year"), ThisYear);
79  dateWidget->addItem(tr("Range…"), Range);
80  hlayout->addWidget(dateWidget);
81 
82  typeWidget = new QComboBox(this);
83  if (platformStyle->getUseExtraSpacing()) {
84  typeWidget->setFixedWidth(121);
85  } else {
86  typeWidget->setFixedWidth(120);
87  }
88 
89  typeWidget->addItem(tr("All"), TransactionFilterProxy::ALL_TYPES);
90  typeWidget->addItem(tr("Received with"), TransactionFilterProxy::TYPE(TransactionRecord::RecvWithAddress) |
92  typeWidget->addItem(tr("Sent to"), TransactionFilterProxy::TYPE(TransactionRecord::SendToAddress) |
94  typeWidget->addItem(tr("To yourself"), TransactionFilterProxy::TYPE(TransactionRecord::SendToSelf));
95  typeWidget->addItem(tr("Mined"), TransactionFilterProxy::TYPE(TransactionRecord::Generated));
96  typeWidget->addItem(tr("Other"), TransactionFilterProxy::TYPE(TransactionRecord::Other));
97 
98  hlayout->addWidget(typeWidget);
99 
100  search_widget = new QLineEdit(this);
101  search_widget->setPlaceholderText(tr("Enter address, transaction id, or label to search"));
102  hlayout->addWidget(search_widget);
103 
104  amountWidget = new QLineEdit(this);
105  amountWidget->setPlaceholderText(tr("Min amount"));
106  if (platformStyle->getUseExtraSpacing()) {
107  amountWidget->setFixedWidth(97);
108  } else {
109  amountWidget->setFixedWidth(100);
110  }
111  QDoubleValidator *amountValidator = new QDoubleValidator(0, 1e20, 8, this);
112  QLocale amountLocale(QLocale::C);
113  amountLocale.setNumberOptions(QLocale::RejectGroupSeparator);
114  amountValidator->setLocale(amountLocale);
115  amountWidget->setValidator(amountValidator);
116  hlayout->addWidget(amountWidget);
117 
118  // Delay before filtering transactions
119  static constexpr auto input_filter_delay{200ms};
120 
121  QTimer* amount_typing_delay = new QTimer(this);
122  amount_typing_delay->setSingleShot(true);
123  amount_typing_delay->setInterval(input_filter_delay);
124 
125  QTimer* prefix_typing_delay = new QTimer(this);
126  prefix_typing_delay->setSingleShot(true);
127  prefix_typing_delay->setInterval(input_filter_delay);
128 
129  QVBoxLayout *vlayout = new QVBoxLayout(this);
130  vlayout->setContentsMargins(0,0,0,0);
131  vlayout->setSpacing(0);
132 
133  transactionView = new QTableView(this);
134  transactionView->setObjectName("transactionView");
135  vlayout->addLayout(hlayout);
136  vlayout->addWidget(createDateRangeWidget());
137  vlayout->addWidget(transactionView);
138  vlayout->setSpacing(0);
139  int width = transactionView->verticalScrollBar()->sizeHint().width();
140  // Cover scroll bar width with spacing
141  if (platformStyle->getUseExtraSpacing()) {
142  hlayout->addSpacing(width+2);
143  } else {
144  hlayout->addSpacing(width);
145  }
146  transactionView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
147  transactionView->setTabKeyNavigation(false);
148  transactionView->setContextMenuPolicy(Qt::CustomContextMenu);
149  transactionView->installEventFilter(this);
150  transactionView->setAlternatingRowColors(true);
151  transactionView->setSelectionBehavior(QAbstractItemView::SelectRows);
152  transactionView->setSelectionMode(QAbstractItemView::ExtendedSelection);
153  transactionView->setSortingEnabled(true);
154  transactionView->verticalHeader()->hide();
155 
156  QSettings settings;
157  if (!transactionView->horizontalHeader()->restoreState(settings.value("TransactionViewHeaderState").toByteArray())) {
158  transactionView->setColumnWidth(TransactionTableModel::Status, STATUS_COLUMN_WIDTH);
159  transactionView->setColumnWidth(TransactionTableModel::Watchonly, WATCHONLY_COLUMN_WIDTH);
160  transactionView->setColumnWidth(TransactionTableModel::Date, DATE_COLUMN_WIDTH);
161  transactionView->setColumnWidth(TransactionTableModel::Type, TYPE_COLUMN_WIDTH);
162  transactionView->setColumnWidth(TransactionTableModel::Amount, AMOUNT_MINIMUM_COLUMN_WIDTH);
163  transactionView->horizontalHeader()->setMinimumSectionSize(MINIMUM_COLUMN_WIDTH);
164  transactionView->horizontalHeader()->setStretchLastSection(true);
165  }
166 
167  contextMenu = new QMenu(this);
168  contextMenu->setObjectName("contextMenu");
169  copyAddressAction = contextMenu->addAction(tr("&Copy address"), this, &TransactionView::copyAddress);
170  copyLabelAction = contextMenu->addAction(tr("Copy &label"), this, &TransactionView::copyLabel);
171  contextMenu->addAction(tr("Copy &amount"), this, &TransactionView::copyAmount);
172  contextMenu->addAction(tr("Copy transaction &ID"), this, &TransactionView::copyTxID);
173  contextMenu->addAction(tr("Copy &raw transaction"), this, &TransactionView::copyTxHex);
174  contextMenu->addAction(tr("Copy full transaction &details"), this, &TransactionView::copyTxPlainText);
175  contextMenu->addAction(tr("&Show transaction details"), this, &TransactionView::showDetails);
176  contextMenu->addSeparator();
177  bumpFeeAction = contextMenu->addAction(tr("Increase transaction &fee"));
178  GUIUtil::ExceptionSafeConnect(bumpFeeAction, &QAction::triggered, this, &TransactionView::bumpFee);
179  bumpFeeAction->setObjectName("bumpFeeAction");
180  abandonAction = contextMenu->addAction(tr("A&bandon transaction"), this, &TransactionView::abandonTx);
181  contextMenu->addAction(tr("&Edit address label"), this, &TransactionView::editLabel);
182 
183  connect(dateWidget, qOverload<int>(&QComboBox::activated), this, &TransactionView::chooseDate);
184  connect(typeWidget, qOverload<int>(&QComboBox::activated), this, &TransactionView::chooseType);
185  connect(watchOnlyWidget, qOverload<int>(&QComboBox::activated), this, &TransactionView::chooseWatchonly);
186  connect(amountWidget, &QLineEdit::textChanged, amount_typing_delay, qOverload<>(&QTimer::start));
187  connect(amount_typing_delay, &QTimer::timeout, this, &TransactionView::changedAmount);
188  connect(search_widget, &QLineEdit::textChanged, prefix_typing_delay, qOverload<>(&QTimer::start));
189  connect(prefix_typing_delay, &QTimer::timeout, this, &TransactionView::changedSearch);
190 
191  connect(transactionView, &QTableView::doubleClicked, this, &TransactionView::doubleClicked);
192  connect(transactionView, &QTableView::customContextMenuRequested, this, &TransactionView::contextualMenu);
193 
194  // Double-clicking on a transaction on the transaction history page shows details
196  // Highlight transaction after fee bump
197  connect(this, &TransactionView::bumpedFee, [this](const uint256& txid) {
198  focusTransaction(txid);
199  });
200 }
201 
203 {
204  QSettings settings;
205  settings.setValue("TransactionViewHeaderState", transactionView->horizontalHeader()->saveState());
206 }
207 
209 {
210  this->model = _model;
211  if(_model)
212  {
214  transactionProxyModel->setSourceModel(_model->getTransactionTableModel());
215  transactionProxyModel->setDynamicSortFilter(true);
216  transactionProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
217  transactionProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
218  transactionProxyModel->setSortRole(Qt::EditRole);
220  transactionView->sortByColumn(TransactionTableModel::Date, Qt::DescendingOrder);
221 
222  if (_model->getOptionsModel())
223  {
224  // Add third party transaction URLs to context menu
225  QStringList listUrls = GUIUtil::SplitSkipEmptyParts(_model->getOptionsModel()->getThirdPartyTxUrls(), "|");
226  bool actions_created = false;
227  for (int i = 0; i < listUrls.size(); ++i)
228  {
229  QString url = listUrls[i].trimmed();
230  QString host = QUrl(url, QUrl::StrictMode).host();
231  if (!host.isEmpty())
232  {
233  if (!actions_created) {
234  contextMenu->addSeparator();
235  actions_created = true;
236  }
237  /*: Transactions table context menu action to show the
238  selected transaction in a third-party block explorer.
239  %1 is a stand-in argument for the URL of the explorer. */
240  contextMenu->addAction(tr("Show in %1").arg(host), [this, url] { openThirdPartyTxUrl(url); });
241  }
242  }
243  }
244 
245  // show/hide column Watch-only
247 
248  // Watch-only signal
250  }
251 }
252 
254 {
255  if (e->type() == QEvent::PaletteChange) {
256  watchOnlyWidget->setItemIcon(
258  m_platform_style->SingleColorIcon(QStringLiteral(":/icons/eye_plus")));
259  watchOnlyWidget->setItemIcon(
261  m_platform_style->SingleColorIcon(QStringLiteral(":/icons/eye_minus")));
262  }
263 
264  QWidget::changeEvent(e);
265 }
266 
268 {
269  if (!transactionProxyModel) return;
270  QDate current = QDate::currentDate();
271  dateRangeWidget->setVisible(false);
272  switch(dateWidget->itemData(idx).toInt())
273  {
274  case All:
276  std::nullopt,
277  std::nullopt);
278  break;
279  case Today:
281  GUIUtil::StartOfDay(current),
282  std::nullopt);
283  break;
284  case ThisWeek: {
285  // Find last Monday
286  QDate startOfWeek = current.addDays(-(current.dayOfWeek()-1));
288  GUIUtil::StartOfDay(startOfWeek),
289  std::nullopt);
290 
291  } break;
292  case ThisMonth:
294  GUIUtil::StartOfDay(QDate(current.year(), current.month(), 1)),
295  std::nullopt);
296  break;
297  case LastMonth:
299  GUIUtil::StartOfDay(QDate(current.year(), current.month(), 1).addMonths(-1)),
300  GUIUtil::StartOfDay(QDate(current.year(), current.month(), 1)));
301  break;
302  case ThisYear:
304  GUIUtil::StartOfDay(QDate(current.year(), 1, 1)),
305  std::nullopt);
306  break;
307  case Range:
308  dateRangeWidget->setVisible(true);
310  break;
311  }
312 }
313 
315 {
317  return;
319  typeWidget->itemData(idx).toInt());
320 }
321 
323 {
325  return;
327  static_cast<TransactionFilterProxy::WatchOnlyFilter>(watchOnlyWidget->itemData(idx).toInt()));
328 }
329 
331 {
333  return;
335 }
336 
338 {
340  return;
341  CAmount amount_parsed = 0;
342  if (BitcoinUnits::parse(model->getOptionsModel()->getDisplayUnit(), amountWidget->text(), &amount_parsed)) {
343  transactionProxyModel->setMinAmount(amount_parsed);
344  }
345  else
346  {
348  }
349 }
350 
352 {
353  if (!model || !model->getOptionsModel()) {
354  return;
355  }
356 
357  // CSV is currently the only supported format
358  QString filename = GUIUtil::getSaveFileName(this,
359  tr("Export Transaction History"), QString(),
360  /*: Expanded name of the CSV file format.
361  See: https://en.wikipedia.org/wiki/Comma-separated_values. */
362  tr("Comma separated file") + QLatin1String(" (*.csv)"), nullptr);
363 
364  if (filename.isNull())
365  return;
366 
367  CSVModelWriter writer(filename);
368 
369  // name, column, role
371  writer.addColumn(tr("Confirmed"), 0, TransactionTableModel::ConfirmedRole);
372  if (model->wallet().haveWatchOnly())
373  writer.addColumn(tr("Watch-only"), TransactionTableModel::Watchonly);
374  writer.addColumn(tr("Date"), 0, TransactionTableModel::DateRole);
375  writer.addColumn(tr("Type"), TransactionTableModel::Type, Qt::EditRole);
376  writer.addColumn(tr("Label"), 0, TransactionTableModel::LabelRole);
377  writer.addColumn(tr("Address"), 0, TransactionTableModel::AddressRole);
379  writer.addColumn(tr("ID"), 0, TransactionTableModel::TxHashRole);
380 
381  if(!writer.write()) {
382  Q_EMIT message(tr("Exporting Failed"), tr("There was an error trying to save the transaction history to %1.").arg(filename),
384  }
385  else {
386  Q_EMIT message(tr("Exporting Successful"), tr("The transaction history was successfully saved to %1.").arg(filename),
388  }
389 }
390 
391 void TransactionView::contextualMenu(const QPoint &point)
392 {
393  QModelIndex index = transactionView->indexAt(point);
394  QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);
395  if (selection.empty())
396  return;
397 
398  // check if transaction can be abandoned, disable context menu action in case it doesn't
399  uint256 hash;
400  hash.SetHex(selection.at(0).data(TransactionTableModel::TxHashRole).toString().toStdString());
401  abandonAction->setEnabled(model->wallet().transactionCanBeAbandoned(hash));
402  bumpFeeAction->setEnabled(model->wallet().transactionCanBeBumped(hash));
405 
406  if (index.isValid()) {
407  GUIUtil::PopupMenu(contextMenu, transactionView->viewport()->mapToGlobal(point));
408  }
409 }
410 
412 {
413  if(!transactionView || !transactionView->selectionModel())
414  return;
415  QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);
416 
417  // get the hash from the TxHashRole (QVariant / QString)
418  uint256 hash;
419  QString hashQStr = selection.at(0).data(TransactionTableModel::TxHashRole).toString();
420  hash.SetHex(hashQStr.toStdString());
421 
422  // Abandon the wallet transaction over the walletModel
424 
425  // Update the table
427 }
428 
429 void TransactionView::bumpFee([[maybe_unused]] bool checked)
430 {
431  if(!transactionView || !transactionView->selectionModel())
432  return;
433  QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);
434 
435  // get the hash from the TxHashRole (QVariant / QString)
436  uint256 hash;
437  QString hashQStr = selection.at(0).data(TransactionTableModel::TxHashRole).toString();
438  hash.SetHex(hashQStr.toStdString());
439 
440  // Bump tx fee over the walletModel
441  uint256 newHash;
442  if (model->bumpFee(hash, newHash)) {
443  // Update the table
444  transactionView->selectionModel()->clearSelection();
446 
447  qApp->processEvents();
448  Q_EMIT bumpedFee(newHash);
449  }
450 }
451 
453 {
455 }
456 
458 {
460 }
461 
463 {
465 }
466 
468 {
470 }
471 
473 {
475 }
476 
478 {
480 }
481 
483 {
484  if(!transactionView->selectionModel() ||!model)
485  return;
486  QModelIndexList selection = transactionView->selectionModel()->selectedRows();
487  if(!selection.isEmpty())
488  {
489  AddressTableModel *addressBook = model->getAddressTableModel();
490  if(!addressBook)
491  return;
492  QString address = selection.at(0).data(TransactionTableModel::AddressRole).toString();
493  if(address.isEmpty())
494  {
495  // If this transaction has no associated address, exit
496  return;
497  }
498  // Is address in address book? Address book can miss address when a transaction is
499  // sent from outside the UI.
500  int idx = addressBook->lookupAddress(address);
501  if(idx != -1)
502  {
503  // Edit sending / receiving address
504  QModelIndex modelIdx = addressBook->index(idx, 0, QModelIndex());
505  // Determine type of address, launch appropriate editor dialog type
506  QString type = modelIdx.data(AddressTableModel::TypeRole).toString();
507 
508  auto dlg = new EditAddressDialog(
512  dlg->setModel(addressBook);
513  dlg->loadRow(idx);
515  }
516  else
517  {
518  // Add sending address
520  this);
521  dlg->setModel(addressBook);
522  dlg->setAddress(address);
524  }
525  }
526 }
527 
529 {
530  if(!transactionView->selectionModel())
531  return;
532  QModelIndexList selection = transactionView->selectionModel()->selectedRows();
533  if(!selection.isEmpty())
534  {
535  TransactionDescDialog *dlg = new TransactionDescDialog(selection.at(0));
536  dlg->setAttribute(Qt::WA_DeleteOnClose);
537  dlg->show();
538  }
539 }
540 
542 {
543  if(!transactionView || !transactionView->selectionModel())
544  return;
545  QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);
546  if(!selection.isEmpty())
547  QDesktopServices::openUrl(QUrl::fromUserInput(url.replace("%s", selection.at(0).data(TransactionTableModel::TxHashRole).toString())));
548 }
549 
551 {
552  dateRangeWidget = new QFrame();
553  dateRangeWidget->setFrameStyle(QFrame::Panel | QFrame::Raised);
554  dateRangeWidget->setContentsMargins(1,1,1,1);
555  QHBoxLayout *layout = new QHBoxLayout(dateRangeWidget);
556  layout->setContentsMargins(0,0,0,0);
557  layout->addSpacing(23);
558  layout->addWidget(new QLabel(tr("Range:")));
559 
560  dateFrom = new QDateTimeEdit(this);
561  dateFrom->setDisplayFormat("dd/MM/yy");
562  dateFrom->setCalendarPopup(true);
563  dateFrom->setMinimumWidth(100);
564  dateFrom->setDate(QDate::currentDate().addDays(-7));
565  layout->addWidget(dateFrom);
566  layout->addWidget(new QLabel(tr("to")));
567 
568  dateTo = new QDateTimeEdit(this);
569  dateTo->setDisplayFormat("dd/MM/yy");
570  dateTo->setCalendarPopup(true);
571  dateTo->setMinimumWidth(100);
572  dateTo->setDate(QDate::currentDate());
573  layout->addWidget(dateTo);
574  layout->addStretch();
575 
576  // Hide by default
577  dateRangeWidget->setVisible(false);
578 
579  // Notify on change
580  connect(dateFrom, &QDateTimeEdit::dateChanged, this, &TransactionView::dateRangeChanged);
581  connect(dateTo, &QDateTimeEdit::dateChanged, this, &TransactionView::dateRangeChanged);
582 
583  return dateRangeWidget;
584 }
585 
587 {
589  return;
591  GUIUtil::StartOfDay(dateFrom->date()),
592  GUIUtil::StartOfDay(dateTo->date()).addDays(1));
593 }
594 
595 void TransactionView::focusTransaction(const QModelIndex &idx)
596 {
598  return;
599  QModelIndex targetIdx = transactionProxyModel->mapFromSource(idx);
600  transactionView->scrollTo(targetIdx);
601  transactionView->setCurrentIndex(targetIdx);
602  transactionView->setFocus();
603 }
604 
606 {
608  return;
609 
610  const QModelIndexList results = this->model->getTransactionTableModel()->match(
611  this->model->getTransactionTableModel()->index(0,0),
613  QString::fromStdString(txid.ToString()), -1);
614 
615  transactionView->setFocus();
616  transactionView->selectionModel()->clearSelection();
617  for (const QModelIndex& index : results) {
618  const QModelIndex targetIndex = transactionProxyModel->mapFromSource(index);
619  transactionView->selectionModel()->select(
620  targetIndex,
621  QItemSelectionModel::Rows | QItemSelectionModel::Select);
622  // Called once per destination to ensure all results are in view, unless
623  // transactions are not ordered by (ascending or descending) date.
624  transactionView->scrollTo(targetIndex);
625  // scrollTo() does not scroll far enough the first time when transactions
626  // are ordered by ascending date.
627  if (index == results[0]) transactionView->scrollTo(targetIndex);
628  }
629 }
630 
631 // Need to override default Ctrl+C action for amount as default behaviour is just to copy DisplayRole text
632 bool TransactionView::eventFilter(QObject *obj, QEvent *event)
633 {
634  if (event->type() == QEvent::KeyPress)
635  {
636  QKeyEvent *ke = static_cast<QKeyEvent *>(event);
637  if (ke->key() == Qt::Key_C && ke->modifiers().testFlag(Qt::ControlModifier))
638  {
640  return true;
641  }
642  }
643  return QWidget::eventFilter(obj, event);
644 }
645 
646 // show/hide column Watch-only
647 void TransactionView::updateWatchOnlyColumn(bool fHaveWatchOnly)
648 {
649  watchOnlyWidget->setVisible(fHaveWatchOnly);
650  transactionView->setColumnHidden(TransactionTableModel::Watchonly, !fHaveWatchOnly);
651 }
WalletModel::getOptionsModel
OptionsModel * getOptionsModel()
Definition: walletmodel.cpp:287
TransactionView::createDateRangeWidget
QWidget * createDateRangeWidget()
Definition: transactionview.cpp:550
transactiontablemodel.h
WalletModel::bumpFee
bool bumpFee(uint256 hash, uint256 &new_hash)
Definition: walletmodel.cpp:472
TransactionTableModel::TxHexRole
@ TxHexRole
Transaction data, hex-encoded.
Definition: transactiontablemodel.h:66
TransactionView::search_widget
QLineEdit * search_widget
Definition: transactionview.h:74
GUIUtil::PopupMenu
void PopupMenu(QMenu *menu, const QPoint &point, QAction *at_action)
Call QMenu::popup() only on supported QT_QPA_PLATFORM.
Definition: guiutil.cpp:931
TransactionView::editLabel
void editLabel()
Definition: transactionview.cpp:482
csvmodelwriter.h
TransactionView::m_platform_style
const PlatformStyle * m_platform_style
Definition: transactionview.h:91
TransactionTablePriv::index
TransactionRecord * index(interfaces::Wallet &wallet, const uint256 &cur_block_hash, const int idx)
Definition: transactiontablemodel.cpp:216
TransactionTableModel::Date
@ Date
Definition: transactiontablemodel.h:37
WalletModel
Interface to Bitcoin wallet from Qt view code.
Definition: walletmodel.h:52
TransactionFilterProxy::setDateRange
void setDateRange(const std::optional< QDateTime > &from, const std::optional< QDateTime > &to)
Filter transactions between date range.
Definition: transactionfilterproxy.cpp:63
TransactionTableModel::AddressRole
@ AddressRole
Address of transaction.
Definition: transactiontablemodel.h:58
TransactionView::openThirdPartyTxUrl
void openThirdPartyTxUrl(QString url)
Definition: transactionview.cpp:541
TransactionView::~TransactionView
~TransactionView()
Definition: transactionview.cpp:202
TransactionView::abandonAction
QAction * abandonAction
Definition: transactionview.h:82
PlatformStyle::SingleColorIcon
QIcon SingleColorIcon(const QString &filename) const
Colorize an icon (given filename) with the icon color.
Definition: platformstyle.cpp:105
TransactionView::bumpFee
void bumpFee(bool checked)
Definition: transactionview.cpp:429
CSVModelWriter::write
bool write()
Perform export of the model to CSV.
Definition: csvmodelwriter.cpp:49
TransactionDescDialog
Dialog showing transaction details.
Definition: transactiondescdialog.h:19
TransactionView::ThisYear
@ ThisYear
Definition: transactionview.h:50
TransactionRecord::RecvWithAddress
@ RecvWithAddress
Definition: transactionrecord.h:79
TransactionTableModel::TxPlainTextRole
@ TxPlainTextRole
Whole transaction as plain text.
Definition: transactiontablemodel.h:68
EditAddressDialog::EditReceivingAddress
@ EditReceivingAddress
Definition: editaddressdialog.h:29
TransactionFilterProxy::setSearchString
void setSearchString(const QString &)
Definition: transactionfilterproxy.cpp:70
TransactionView::focusTransaction
void focusTransaction(const QModelIndex &)
Definition: transactionview.cpp:595
walletmodel.h
CSVModelWriter::addColumn
void addColumn(const QString &title, int column, int role=Qt::EditRole)
Definition: csvmodelwriter.cpp:22
base_blob::data
const unsigned char * data() const
Definition: uint256.h:57
AddressTableModel
Qt model of the address book in the core.
Definition: addresstablemodel.h:23
WalletModel::getAddressTableModel
AddressTableModel * getAddressTableModel()
Definition: walletmodel.cpp:292
CClientUIInterface::MSG_ERROR
@ MSG_ERROR
Definition: ui_interface.h:67
TransactionFilterProxy::WatchOnlyFilter_All
@ WatchOnlyFilter_All
Definition: transactionfilterproxy.h:30
AddressTableModel::Receive
static const QString Receive
Specifies receive address.
Definition: addresstablemodel.h:51
AddressTableModel::data
QVariant data(const QModelIndex &index, int role) const override
Definition: addresstablemodel.cpp:194
GUIUtil::hasEntryData
bool hasEntryData(const QAbstractItemView *view, int column, int role)
Returns true if the specified field of the currently selected view entry is not empty.
Definition: guiutil.cpp:274
TransactionView::ThisMonth
@ ThisMonth
Definition: transactionview.h:48
TransactionView::LastMonth
@ LastMonth
Definition: transactionview.h:49
CT_UPDATED
@ CT_UPDATED
Definition: ui_change_type.h:11
WalletModel::getTransactionTableModel
TransactionTableModel * getTransactionTableModel()
Definition: walletmodel.cpp:297
TransactionFilterProxy::WatchOnlyFilter_No
@ WatchOnlyFilter_No
Definition: transactionfilterproxy.h:32
GUIUtil::ExceptionSafeConnect
auto ExceptionSafeConnect(Sender sender, Signal signal, Receiver receiver, Slot method, Qt::ConnectionType type=Qt::AutoConnection)
A drop-in replacement of QObject::connect function (see: https://doc.qt.io/qt-5/qobject....
Definition: guiutil.h:392
TransactionTablePriv::parent
TransactionTableModel * parent
Definition: transactiontablemodel.cpp:93
EditAddressDialog::EditSendingAddress
@ EditSendingAddress
Definition: editaddressdialog.h:30
TransactionView::chooseWatchonly
void chooseWatchonly(int idx)
Definition: transactionview.cpp:322
TransactionRecord::RecvFromOther
@ RecvFromOther
Definition: transactionrecord.h:80
TransactionView::transactionView
QTableView * transactionView
Definition: transactionview.h:69
TransactionView::copyTxID
void copyTxID()
Definition: transactionview.cpp:467
BitcoinUnits::parse
static bool parse(int unit, const QString &value, CAmount *val_out)
Parse string to coin amount.
Definition: bitcoinunits.cpp:174
TransactionView::dateTo
QDateTimeEdit * dateTo
Definition: transactionview.h:81
TransactionTableModel::updateTransaction
void updateTransaction(const QString &hash, int status, bool showTransaction)
Definition: transactiontablemodel.cpp:279
TransactionTableModel::index
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
Definition: transactiontablemodel.cpp:693
url
const char * url
Definition: rpcconsole.cpp:65
CSVModelWriter
Export a Qt table model to a CSV file.
Definition: csvmodelwriter.h:18
WalletModel::wallet
interfaces::Wallet & wallet() const
Definition: walletmodel.h:145
GUIUtil::ShowModalDialogAsynchronously
void ShowModalDialogAsynchronously(QDialog *dialog)
Shows a QDialog instance asynchronously, and deletes it on close.
Definition: guiutil.cpp:987
EditAddressDialog
Dialog for editing an address and associated information.
Definition: editaddressdialog.h:22
GUIUtil::StartOfDay
QDateTime StartOfDay(const QDate &date)
Returns the start-moment of the day in local time.
Definition: guiutil.cpp:938
TransactionRecord::SendToOther
@ SendToOther
Definition: transactionrecord.h:78
TransactionView::showDetails
void showDetails()
Definition: transactionview.cpp:528
CSVModelWriter::setModel
void setModel(const QAbstractItemModel *model)
Definition: csvmodelwriter.cpp:17
interfaces::Wallet::transactionCanBeBumped
virtual bool transactionCanBeBumped(const uint256 &txid)=0
Return whether transaction can be bumped.
TransactionView::changedSearch
void changedSearch()
Definition: transactionview.cpp:330
TransactionFilterProxy::setMinAmount
void setMinAmount(const CAmount &minimum)
Definition: transactionfilterproxy.cpp:83
transactionfilterproxy.h
TransactionView::changedAmount
void changedAmount()
Definition: transactionview.cpp:337
CAmount
int64_t CAmount
Amount in satoshis (Can be negative)
Definition: amount.h:12
TransactionFilterProxy::TYPE
static quint32 TYPE(int type)
Definition: transactionfilterproxy.h:26
AddressTableModel::index
QModelIndex index(int row, int column, const QModelIndex &parent) const override
Definition: addresstablemodel.cpp:322
guiutil.h
TransactionView::eventFilter
bool eventFilter(QObject *obj, QEvent *event) override
Definition: transactionview.cpp:632
TransactionView::copyAmount
void copyAmount()
Definition: transactionview.cpp:462
TransactionView::message
void message(const QString &title, const QString &message, unsigned int style)
Fired when a message should be reported to the user.
TransactionRecord::Generated
@ Generated
Definition: transactionrecord.h:76
TransactionFilterProxy::setTypeFilter
void setTypeFilter(quint32 modes)
Definition: transactionfilterproxy.cpp:77
TransactionTableModel::Amount
@ Amount
Definition: transactiontablemodel.h:40
TransactionFilterProxy::setWatchOnlyFilter
void setWatchOnlyFilter(WatchOnlyFilter filter)
Definition: transactionfilterproxy.cpp:89
TransactionView::All
@ All
Definition: transactionview.h:45
base_blob::ToString
std::string ToString() const
Definition: uint256.cpp:64
uint256
256-bit opaque blob.
Definition: uint256.h:126
TransactionView::transactionProxyModel
TransactionFilterProxy * transactionProxyModel
Definition: transactionview.h:68
TransactionRecord::SendToSelf
@ SendToSelf
Definition: transactionrecord.h:81
EditAddressDialog::NewSendingAddress
@ NewSendingAddress
Definition: editaddressdialog.h:28
AddressTableModel::lookupAddress
int lookupAddress(const QString &address) const
Definition: addresstablemodel.cpp:437
TransactionView::dateRangeChanged
void dateRangeChanged()
Definition: transactionview.cpp:586
TransactionView::copyLabel
void copyLabel()
Definition: transactionview.cpp:457
NetPermissionFlags::All
@ All
editaddressdialog.h
TransactionView::watchOnlyWidget
QComboBox * watchOnlyWidget
Definition: transactionview.h:73
transactiondescdialog.h
TransactionTableModel::FormattedAmountRole
@ FormattedAmountRole
Formatted amount, without brackets when unconfirmed.
Definition: transactiontablemodel.h:72
TransactionView::updateWatchOnlyColumn
void updateWatchOnlyColumn(bool fHaveWatchOnly)
Definition: transactionview.cpp:647
ui_interface.h
GUIUtil::getSaveFileName
QString getSaveFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedSuffixOut)
Get save filename, mimics QFileDialog::getSaveFileName, except that it appends a default suffix when ...
Definition: guiutil.cpp:292
transactionrecord.h
TransactionFilterProxy::WatchOnlyFilter_Yes
@ WatchOnlyFilter_Yes
Definition: transactionfilterproxy.h:31
platformstyle.h
TransactionView::bumpedFee
void bumpedFee(const uint256 &txid)
TransactionView::ThisWeek
@ ThisWeek
Definition: transactionview.h:47
interfaces::Wallet::haveWatchOnly
virtual bool haveWatchOnly()=0
Return whether wallet has watch only keys.
AddressTableModel::TypeRole
@ TypeRole
Type of address (Send or Receive)
Definition: addresstablemodel.h:37
TransactionView::contextMenu
QMenu * contextMenu
Definition: transactionview.h:77
GUIUtil::copyEntryData
void copyEntryData(const QAbstractItemView *view, int column, int role)
Copy a field of the currently selected entry of a view to the clipboard.
Definition: guiutil.cpp:254
TransactionView::copyLabelAction
QAction * copyLabelAction
Definition: transactionview.h:85
CClientUIInterface::MSG_INFORMATION
@ MSG_INFORMATION
Predefined combinations for certain default usage cases.
Definition: ui_interface.h:65
OptionsModel::getDisplayUnit
int getDisplayUnit() const
Definition: optionsmodel.h:89
TransactionView::copyTxHex
void copyTxHex()
Definition: transactionview.cpp:472
TransactionView::chooseDate
void chooseDate(int idx)
Definition: transactionview.cpp:267
TransactionFilterProxy::WatchOnlyFilter
WatchOnlyFilter
Definition: transactionfilterproxy.h:28
BitcoinUnits::getAmountColumnTitle
static QString getAmountColumnTitle(int unit)
Gets title for amount column including current display unit if optionsModel reference available *‍/.
Definition: bitcoinunits.cpp:213
TransactionTableModel::Type
@ Type
Definition: transactiontablemodel.h:38
TransactionView::setModel
void setModel(WalletModel *model)
Definition: transactionview.cpp:208
TransactionView::copyAddress
void copyAddress()
Definition: transactionview.cpp:452
TransactionView::amountWidget
QLineEdit * amountWidget
Definition: transactionview.h:75
GUIUtil::SplitSkipEmptyParts
QStringList SplitSkipEmptyParts(const QString &string, const SeparatorType &separator)
Splits the string into substrings wherever separator occurs, and returns the list of those strings.
Definition: guiutil.h:352
TransactionView::typeWidget
QComboBox * typeWidget
Definition: transactionview.h:72
TransactionView::abandonTx
void abandonTx()
Definition: transactionview.cpp:411
TransactionView::copyAddressAction
QAction * copyAddressAction
Definition: transactionview.h:84
TransactionRecord::SendToAddress
@ SendToAddress
Definition: transactionrecord.h:77
TransactionTableModel::TxHashRole
@ TxHashRole
Transaction hash.
Definition: transactiontablemodel.h:64
interfaces::Wallet::transactionCanBeAbandoned
virtual bool transactionCanBeAbandoned(const uint256 &txid)=0
Return whether transaction can be abandoned.
bitcoinunits.h
TransactionView::contextualMenu
void contextualMenu(const QPoint &)
Definition: transactionview.cpp:391
TransactionTableModel::Status
@ Status
Definition: transactiontablemodel.h:35
OptionsModel::getThirdPartyTxUrls
QString getThirdPartyTxUrls() const
Definition: optionsmodel.h:90
TransactionView::changeEvent
void changeEvent(QEvent *e) override
Definition: transactionview.cpp:253
transactionview.h
TransactionView::dateRangeWidget
QFrame * dateRangeWidget
Definition: transactionview.h:79
TransactionTableModel::DateRole
@ DateRole
Date and time this transaction was created.
Definition: transactiontablemodel.h:50
TransactionView::chooseType
void chooseType(int idx)
Definition: transactionview.cpp:314
TransactionView::bumpFeeAction
QAction * bumpFeeAction
Definition: transactionview.h:83
optionsmodel.h
interfaces::Wallet::abandonTransaction
virtual bool abandonTransaction(const uint256 &txid)=0
Abandon transaction.
TransactionView::TransactionView
TransactionView(const PlatformStyle *platformStyle, QWidget *parent=nullptr)
Definition: transactionview.cpp:43
TransactionView::doubleClicked
void doubleClicked(const QModelIndex &)
PlatformStyle
Definition: platformstyle.h:13
TransactionView::copyTxPlainText
void copyTxPlainText()
Definition: transactionview.cpp:477
TransactionView::model
WalletModel * model
Definition: transactionview.h:67
TransactionView::exportClicked
void exportClicked()
Definition: transactionview.cpp:351
TransactionTableModel::LabelRole
@ LabelRole
Label of address related to transaction.
Definition: transactiontablemodel.h:60
addresstablemodel.h
WalletModel::notifyWatchonlyChanged
void notifyWatchonlyChanged(bool fHaveWatchonly)
TransactionTableModel::Watchonly
@ Watchonly
Definition: transactiontablemodel.h:36
TransactionView::dateWidget
QComboBox * dateWidget
Definition: transactionview.h:71
base_blob::SetHex
void SetHex(const char *psz)
Definition: uint256.cpp:30
TransactionFilterProxy::ALL_TYPES
static const quint32 ALL_TYPES
Type filter bit field (all types)
Definition: transactionfilterproxy.h:24
TransactionView::dateFrom
QDateTimeEdit * dateFrom
Definition: transactionview.h:80
TransactionView::Today
@ Today
Definition: transactionview.h:46
TransactionView::Range
@ Range
Definition: transactionview.h:51
TransactionTableModel::ConfirmedRole
@ ConfirmedRole
Is transaction confirmed?
Definition: transactiontablemodel.h:70
TransactionRecord::Other
@ Other
Definition: transactionrecord.h:75
TransactionFilterProxy
Filter the transaction list according to pre-specified rules.
Definition: transactionfilterproxy.h:16