Bitcoin Core  21.99.0
P2P Digital Currency
transactionview.cpp
Go to the documentation of this file.
1 // Copyright (c) 2011-2020 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 <QApplication>
23 #include <QComboBox>
24 #include <QDateTimeEdit>
25 #include <QDesktopServices>
26 #include <QDoubleValidator>
27 #include <QHBoxLayout>
28 #include <QHeaderView>
29 #include <QLabel>
30 #include <QLineEdit>
31 #include <QMenu>
32 #include <QPoint>
33 #include <QScrollBar>
34 #include <QSettings>
35 #include <QTableView>
36 #include <QTimer>
37 #include <QUrl>
38 #include <QVBoxLayout>
39 
40 TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *parent) :
41  QWidget(parent)
42 {
43  // Build filter row
44  setContentsMargins(0,0,0,0);
45 
46  QHBoxLayout *hlayout = new QHBoxLayout();
47  hlayout->setContentsMargins(0,0,0,0);
48 
49  if (platformStyle->getUseExtraSpacing()) {
50  hlayout->setSpacing(5);
51  hlayout->addSpacing(26);
52  } else {
53  hlayout->setSpacing(0);
54  hlayout->addSpacing(23);
55  }
56 
57  watchOnlyWidget = new QComboBox(this);
58  watchOnlyWidget->setFixedWidth(24);
60  watchOnlyWidget->addItem(platformStyle->SingleColorIcon(":/icons/eye_plus"), "", TransactionFilterProxy::WatchOnlyFilter_Yes);
61  watchOnlyWidget->addItem(platformStyle->SingleColorIcon(":/icons/eye_minus"), "", TransactionFilterProxy::WatchOnlyFilter_No);
62  hlayout->addWidget(watchOnlyWidget);
63 
64  dateWidget = new QComboBox(this);
65  if (platformStyle->getUseExtraSpacing()) {
66  dateWidget->setFixedWidth(121);
67  } else {
68  dateWidget->setFixedWidth(120);
69  }
70  dateWidget->addItem(tr("All"), All);
71  dateWidget->addItem(tr("Today"), Today);
72  dateWidget->addItem(tr("This week"), ThisWeek);
73  dateWidget->addItem(tr("This month"), ThisMonth);
74  dateWidget->addItem(tr("Last month"), LastMonth);
75  dateWidget->addItem(tr("This year"), ThisYear);
76  dateWidget->addItem(tr("Range..."), Range);
77  hlayout->addWidget(dateWidget);
78 
79  typeWidget = new QComboBox(this);
80  if (platformStyle->getUseExtraSpacing()) {
81  typeWidget->setFixedWidth(121);
82  } else {
83  typeWidget->setFixedWidth(120);
84  }
85 
86  typeWidget->addItem(tr("All"), TransactionFilterProxy::ALL_TYPES);
94 
95  hlayout->addWidget(typeWidget);
96 
97  search_widget = new QLineEdit(this);
98  search_widget->setPlaceholderText(tr("Enter address, transaction id, or label to search"));
99  hlayout->addWidget(search_widget);
100 
101  amountWidget = new QLineEdit(this);
102  amountWidget->setPlaceholderText(tr("Min amount"));
103  if (platformStyle->getUseExtraSpacing()) {
104  amountWidget->setFixedWidth(97);
105  } else {
106  amountWidget->setFixedWidth(100);
107  }
108  QDoubleValidator *amountValidator = new QDoubleValidator(0, 1e20, 8, this);
109  QLocale amountLocale(QLocale::C);
110  amountLocale.setNumberOptions(QLocale::RejectGroupSeparator);
111  amountValidator->setLocale(amountLocale);
112  amountWidget->setValidator(amountValidator);
113  hlayout->addWidget(amountWidget);
114 
115  // Delay before filtering transactions in ms
116  static const int input_filter_delay = 200;
117 
118  QTimer* amount_typing_delay = new QTimer(this);
119  amount_typing_delay->setSingleShot(true);
120  amount_typing_delay->setInterval(input_filter_delay);
121 
122  QTimer* prefix_typing_delay = new QTimer(this);
123  prefix_typing_delay->setSingleShot(true);
124  prefix_typing_delay->setInterval(input_filter_delay);
125 
126  QVBoxLayout *vlayout = new QVBoxLayout(this);
127  vlayout->setContentsMargins(0,0,0,0);
128  vlayout->setSpacing(0);
129 
130  transactionView = new QTableView(this);
131  transactionView->setObjectName("transactionView");
132  vlayout->addLayout(hlayout);
133  vlayout->addWidget(createDateRangeWidget());
134  vlayout->addWidget(transactionView);
135  vlayout->setSpacing(0);
136  int width = transactionView->verticalScrollBar()->sizeHint().width();
137  // Cover scroll bar width with spacing
138  if (platformStyle->getUseExtraSpacing()) {
139  hlayout->addSpacing(width+2);
140  } else {
141  hlayout->addSpacing(width);
142  }
143  transactionView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
144  transactionView->setTabKeyNavigation(false);
145  transactionView->setContextMenuPolicy(Qt::CustomContextMenu);
146  transactionView->installEventFilter(this);
147  transactionView->setAlternatingRowColors(true);
148  transactionView->setSelectionBehavior(QAbstractItemView::SelectRows);
149  transactionView->setSelectionMode(QAbstractItemView::ExtendedSelection);
150  transactionView->setSortingEnabled(true);
151  transactionView->verticalHeader()->hide();
152 
153  QSettings settings;
154  if (!transactionView->horizontalHeader()->restoreState(settings.value("TransactionViewHeaderState").toByteArray())) {
160  transactionView->horizontalHeader()->setMinimumSectionSize(MINIMUM_COLUMN_WIDTH);
161  transactionView->horizontalHeader()->setStretchLastSection(true);
162  }
163 
164  // Actions
165  abandonAction = new QAction(tr("Abandon transaction"), this);
166  bumpFeeAction = new QAction(tr("Increase transaction fee"), this);
167  bumpFeeAction->setObjectName("bumpFeeAction");
168  copyAddressAction = new QAction(tr("Copy address"), this);
169  copyLabelAction = new QAction(tr("Copy label"), this);
170  QAction *copyAmountAction = new QAction(tr("Copy amount"), this);
171  QAction *copyTxIDAction = new QAction(tr("Copy transaction ID"), this);
172  QAction *copyTxHexAction = new QAction(tr("Copy raw transaction"), this);
173  QAction *copyTxPlainText = new QAction(tr("Copy full transaction details"), this);
174  QAction *editLabelAction = new QAction(tr("Edit address label"), this);
175  QAction *showDetailsAction = new QAction(tr("Show transaction details"), this);
176 
177  contextMenu = new QMenu(this);
178  contextMenu->setObjectName("contextMenu");
179  contextMenu->addAction(copyAddressAction);
180  contextMenu->addAction(copyLabelAction);
181  contextMenu->addAction(copyAmountAction);
182  contextMenu->addAction(copyTxIDAction);
183  contextMenu->addAction(copyTxHexAction);
184  contextMenu->addAction(copyTxPlainText);
185  contextMenu->addAction(showDetailsAction);
186  contextMenu->addSeparator();
187  contextMenu->addAction(bumpFeeAction);
188  contextMenu->addAction(abandonAction);
189  contextMenu->addAction(editLabelAction);
190 
191  connect(dateWidget, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &TransactionView::chooseDate);
192  connect(typeWidget, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &TransactionView::chooseType);
193  connect(watchOnlyWidget, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &TransactionView::chooseWatchonly);
194  connect(amountWidget, &QLineEdit::textChanged, amount_typing_delay, static_cast<void (QTimer::*)()>(&QTimer::start));
195  connect(amount_typing_delay, &QTimer::timeout, this, &TransactionView::changedAmount);
196  connect(search_widget, &QLineEdit::textChanged, prefix_typing_delay, static_cast<void (QTimer::*)()>(&QTimer::start));
197  connect(prefix_typing_delay, &QTimer::timeout, this, &TransactionView::changedSearch);
198 
199  connect(transactionView, &QTableView::doubleClicked, this, &TransactionView::doubleClicked);
200  connect(transactionView, &QTableView::customContextMenuRequested, this, &TransactionView::contextualMenu);
201 
203  connect(abandonAction, &QAction::triggered, this, &TransactionView::abandonTx);
204  connect(copyAddressAction, &QAction::triggered, this, &TransactionView::copyAddress);
205  connect(copyLabelAction, &QAction::triggered, this, &TransactionView::copyLabel);
206  connect(copyAmountAction, &QAction::triggered, this, &TransactionView::copyAmount);
207  connect(copyTxIDAction, &QAction::triggered, this, &TransactionView::copyTxID);
208  connect(copyTxHexAction, &QAction::triggered, this, &TransactionView::copyTxHex);
209  connect(copyTxPlainText, &QAction::triggered, this, &TransactionView::copyTxPlainText);
210  connect(editLabelAction, &QAction::triggered, this, &TransactionView::editLabel);
211  connect(showDetailsAction, &QAction::triggered, this, &TransactionView::showDetails);
212  // Double-clicking on a transaction on the transaction history page shows details
214  // Highlight transaction after fee bump
215  connect(this, &TransactionView::bumpedFee, [this](const uint256& txid) {
216  focusTransaction(txid);
217  });
218 }
219 
221 {
222  QSettings settings;
223  settings.setValue("TransactionViewHeaderState", transactionView->horizontalHeader()->saveState());
224 }
225 
227 {
228  this->model = _model;
229  if(_model)
230  {
232  transactionProxyModel->setSourceModel(_model->getTransactionTableModel());
233  transactionProxyModel->setDynamicSortFilter(true);
234  transactionProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
235  transactionProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
236  transactionProxyModel->setSortRole(Qt::EditRole);
238  transactionView->sortByColumn(TransactionTableModel::Date, Qt::DescendingOrder);
239 
240  if (_model->getOptionsModel())
241  {
242  // Add third party transaction URLs to context menu
243  QStringList listUrls = GUIUtil::SplitSkipEmptyParts(_model->getOptionsModel()->getThirdPartyTxUrls(), "|");
244  for (int i = 0; i < listUrls.size(); ++i)
245  {
246  QString url = listUrls[i].trimmed();
247  QString host = QUrl(url, QUrl::StrictMode).host();
248  if (!host.isEmpty())
249  {
250  QAction *thirdPartyTxUrlAction = new QAction(host, this); // use host as menu item label
251  if (i == 0)
252  contextMenu->addSeparator();
253  contextMenu->addAction(thirdPartyTxUrlAction);
254  connect(thirdPartyTxUrlAction, &QAction::triggered, [this, url] { openThirdPartyTxUrl(url); });
255  }
256  }
257  }
258 
259  // show/hide column Watch-only
261 
262  // Watch-only signal
264  }
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:
278  break;
279  case Today:
281  GUIUtil::StartOfDay(current),
283  break;
284  case ThisWeek: {
285  // Find last Monday
286  QDate startOfWeek = current.addDays(-(current.dayOfWeek()-1));
288  GUIUtil::StartOfDay(startOfWeek),
290 
291  } break;
292  case ThisMonth:
294  GUIUtil::StartOfDay(QDate(current.year(), current.month(), 1)),
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)),
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  tr("Comma separated file", "Name of CSV file format") + QLatin1String(" (*.csv)"), nullptr);
361 
362  if (filename.isNull())
363  return;
364 
365  CSVModelWriter writer(filename);
366 
367  // name, column, role
369  writer.addColumn(tr("Confirmed"), 0, TransactionTableModel::ConfirmedRole);
370  if (model->wallet().haveWatchOnly())
371  writer.addColumn(tr("Watch-only"), TransactionTableModel::Watchonly);
372  writer.addColumn(tr("Date"), 0, TransactionTableModel::DateRole);
373  writer.addColumn(tr("Type"), TransactionTableModel::Type, Qt::EditRole);
374  writer.addColumn(tr("Label"), 0, TransactionTableModel::LabelRole);
375  writer.addColumn(tr("Address"), 0, TransactionTableModel::AddressRole);
377  writer.addColumn(tr("ID"), 0, TransactionTableModel::TxHashRole);
378 
379  if(!writer.write()) {
380  Q_EMIT message(tr("Exporting Failed"), tr("There was an error trying to save the transaction history to %1.").arg(filename),
382  }
383  else {
384  Q_EMIT message(tr("Exporting Successful"), tr("The transaction history was successfully saved to %1.").arg(filename),
386  }
387 }
388 
389 void TransactionView::contextualMenu(const QPoint &point)
390 {
391  QModelIndex index = transactionView->indexAt(point);
392  QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);
393  if (selection.empty())
394  return;
395 
396  // check if transaction can be abandoned, disable context menu action in case it doesn't
397  uint256 hash;
398  hash.SetHex(selection.at(0).data(TransactionTableModel::TxHashRole).toString().toStdString());
399  abandonAction->setEnabled(model->wallet().transactionCanBeAbandoned(hash));
400  bumpFeeAction->setEnabled(model->wallet().transactionCanBeBumped(hash));
403 
404  if (index.isValid()) {
405  GUIUtil::PopupMenu(contextMenu, transactionView->viewport()->mapToGlobal(point));
406  }
407 }
408 
410 {
411  if(!transactionView || !transactionView->selectionModel())
412  return;
413  QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);
414 
415  // get the hash from the TxHashRole (QVariant / QString)
416  uint256 hash;
417  QString hashQStr = selection.at(0).data(TransactionTableModel::TxHashRole).toString();
418  hash.SetHex(hashQStr.toStdString());
419 
420  // Abandon the wallet transaction over the walletModel
422 
423  // Update the table
425 }
426 
427 void TransactionView::bumpFee([[maybe_unused]] bool checked)
428 {
429  if(!transactionView || !transactionView->selectionModel())
430  return;
431  QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);
432 
433  // get the hash from the TxHashRole (QVariant / QString)
434  uint256 hash;
435  QString hashQStr = selection.at(0).data(TransactionTableModel::TxHashRole).toString();
436  hash.SetHex(hashQStr.toStdString());
437 
438  // Bump tx fee over the walletModel
439  uint256 newHash;
440  if (model->bumpFee(hash, newHash)) {
441  // Update the table
442  transactionView->selectionModel()->clearSelection();
444 
445  qApp->processEvents();
446  Q_EMIT bumpedFee(newHash);
447  }
448 }
449 
451 {
453 }
454 
456 {
458 }
459 
461 {
463 }
464 
466 {
468 }
469 
471 {
473 }
474 
476 {
478 }
479 
481 {
482  if(!transactionView->selectionModel() ||!model)
483  return;
484  QModelIndexList selection = transactionView->selectionModel()->selectedRows();
485  if(!selection.isEmpty())
486  {
487  AddressTableModel *addressBook = model->getAddressTableModel();
488  if(!addressBook)
489  return;
490  QString address = selection.at(0).data(TransactionTableModel::AddressRole).toString();
491  if(address.isEmpty())
492  {
493  // If this transaction has no associated address, exit
494  return;
495  }
496  // Is address in address book? Address book can miss address when a transaction is
497  // sent from outside the UI.
498  int idx = addressBook->lookupAddress(address);
499  if(idx != -1)
500  {
501  // Edit sending / receiving address
502  QModelIndex modelIdx = addressBook->index(idx, 0, QModelIndex());
503  // Determine type of address, launch appropriate editor dialog type
504  QString type = modelIdx.data(AddressTableModel::TypeRole).toString();
505 
506  EditAddressDialog dlg(
510  dlg.setModel(addressBook);
511  dlg.loadRow(idx);
512  dlg.exec();
513  }
514  else
515  {
516  // Add sending address
518  this);
519  dlg.setModel(addressBook);
520  dlg.setAddress(address);
521  dlg.exec();
522  }
523  }
524 }
525 
527 {
528  if(!transactionView->selectionModel())
529  return;
530  QModelIndexList selection = transactionView->selectionModel()->selectedRows();
531  if(!selection.isEmpty())
532  {
533  TransactionDescDialog *dlg = new TransactionDescDialog(selection.at(0));
534  dlg->setAttribute(Qt::WA_DeleteOnClose);
535  dlg->show();
536  }
537 }
538 
540 {
541  if(!transactionView || !transactionView->selectionModel())
542  return;
543  QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);
544  if(!selection.isEmpty())
545  QDesktopServices::openUrl(QUrl::fromUserInput(url.replace("%s", selection.at(0).data(TransactionTableModel::TxHashRole).toString())));
546 }
547 
549 {
550  dateRangeWidget = new QFrame();
551  dateRangeWidget->setFrameStyle(QFrame::Panel | QFrame::Raised);
552  dateRangeWidget->setContentsMargins(1,1,1,1);
553  QHBoxLayout *layout = new QHBoxLayout(dateRangeWidget);
554  layout->setContentsMargins(0,0,0,0);
555  layout->addSpacing(23);
556  layout->addWidget(new QLabel(tr("Range:")));
557 
558  dateFrom = new QDateTimeEdit(this);
559  dateFrom->setDisplayFormat("dd/MM/yy");
560  dateFrom->setCalendarPopup(true);
561  dateFrom->setMinimumWidth(100);
562  dateFrom->setDate(QDate::currentDate().addDays(-7));
563  layout->addWidget(dateFrom);
564  layout->addWidget(new QLabel(tr("to")));
565 
566  dateTo = new QDateTimeEdit(this);
567  dateTo->setDisplayFormat("dd/MM/yy");
568  dateTo->setCalendarPopup(true);
569  dateTo->setMinimumWidth(100);
570  dateTo->setDate(QDate::currentDate());
571  layout->addWidget(dateTo);
572  layout->addStretch();
573 
574  // Hide by default
575  dateRangeWidget->setVisible(false);
576 
577  // Notify on change
578  connect(dateFrom, &QDateTimeEdit::dateChanged, this, &TransactionView::dateRangeChanged);
579  connect(dateTo, &QDateTimeEdit::dateChanged, this, &TransactionView::dateRangeChanged);
580 
581  return dateRangeWidget;
582 }
583 
585 {
587  return;
589  GUIUtil::StartOfDay(dateFrom->date()),
590  GUIUtil::StartOfDay(dateTo->date()).addDays(1));
591 }
592 
593 void TransactionView::focusTransaction(const QModelIndex &idx)
594 {
596  return;
597  QModelIndex targetIdx = transactionProxyModel->mapFromSource(idx);
598  transactionView->scrollTo(targetIdx);
599  transactionView->setCurrentIndex(targetIdx);
600  transactionView->setFocus();
601 }
602 
604 {
606  return;
607 
608  const QModelIndexList results = this->model->getTransactionTableModel()->match(
609  this->model->getTransactionTableModel()->index(0,0),
611  QString::fromStdString(txid.ToString()), -1);
612 
613  transactionView->setFocus();
614  transactionView->selectionModel()->clearSelection();
615  for (const QModelIndex& index : results) {
616  const QModelIndex targetIndex = transactionProxyModel->mapFromSource(index);
617  transactionView->selectionModel()->select(
618  targetIndex,
619  QItemSelectionModel::Rows | QItemSelectionModel::Select);
620  // Called once per destination to ensure all results are in view, unless
621  // transactions are not ordered by (ascending or descending) date.
622  transactionView->scrollTo(targetIndex);
623  // scrollTo() does not scroll far enough the first time when transactions
624  // are ordered by ascending date.
625  if (index == results[0]) transactionView->scrollTo(targetIndex);
626  }
627 }
628 
629 // Need to override default Ctrl+C action for amount as default behaviour is just to copy DisplayRole text
630 bool TransactionView::eventFilter(QObject *obj, QEvent *event)
631 {
632  if (event->type() == QEvent::KeyPress)
633  {
634  QKeyEvent *ke = static_cast<QKeyEvent *>(event);
635  if (ke->key() == Qt::Key_C && ke->modifiers().testFlag(Qt::ControlModifier))
636  {
638  return true;
639  }
640  }
641  return QWidget::eventFilter(obj, event);
642 }
643 
644 // show/hide column Watch-only
645 void TransactionView::updateWatchOnlyColumn(bool fHaveWatchOnly)
646 {
647  watchOnlyWidget->setVisible(fHaveWatchOnly);
648  transactionView->setColumnHidden(TransactionTableModel::Watchonly, !fHaveWatchOnly);
649 }
CClientUIInterface::MSG_INFORMATION
@ MSG_INFORMATION
Predefined combinations for certain default usage cases.
Definition: ui_interface.h:66
TransactionView::TYPE_COLUMN_WIDTH
@ TYPE_COLUMN_WIDTH
Definition: transactionview.h:58
WalletModel::getOptionsModel
OptionsModel * getOptionsModel()
Definition: walletmodel.cpp:284
TransactionView::createDateRangeWidget
QWidget * createDateRangeWidget()
Definition: transactionview.cpp:548
transactiontablemodel.h
WalletModel::bumpFee
bool bumpFee(uint256 hash, uint256 &new_hash)
Definition: walletmodel.cpp:488
TransactionTableModel::TxHexRole
@ TxHexRole
Transaction data, hex-encoded.
Definition: transactiontablemodel.h:66
TransactionView::search_widget
QLineEdit * search_widget
Definition: transactionview.h:71
GUIUtil::PopupMenu
void PopupMenu(QMenu *menu, const QPoint &point, QAction *at_action)
Call QMenu::popup() only on supported QT_QPA_PLATFORM.
Definition: guiutil.cpp:863
TransactionView::editLabel
void editLabel()
Definition: transactionview.cpp:480
EditAddressDialog::loadRow
void loadRow(int row)
Definition: editaddressdialog.cpp:66
csvmodelwriter.h
TransactionTablePriv::index
TransactionRecord * index(interfaces::Wallet &wallet, const uint256 &cur_block_hash, const int idx)
Definition: transactiontablemodel.cpp:210
TransactionTableModel::Date
@ Date
Definition: transactiontablemodel.h:37
WalletModel
Interface to Bitcoin wallet from Qt view code.
Definition: walletmodel.h:51
TransactionTableModel::AddressRole
@ AddressRole
Address of transaction.
Definition: transactiontablemodel.h:58
TransactionView::openThirdPartyTxUrl
void openThirdPartyTxUrl(QString url)
Definition: transactionview.cpp:539
TransactionView::~TransactionView
~TransactionView()
Definition: transactionview.cpp:220
TransactionView::abandonAction
QAction * abandonAction
Definition: transactionview.h:79
PlatformStyle::SingleColorIcon
QIcon SingleColorIcon(const QString &filename) const
Colorize an icon (given filename) with the icon color.
Definition: platformstyle.cpp:102
TransactionView::bumpFee
void bumpFee(bool checked)
Definition: transactionview.cpp:427
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:81
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:75
TransactionView::focusTransaction
void focusTransaction(const QModelIndex &)
Definition: transactionview.cpp:593
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:55
AddressTableModel
Qt model of the address book in the core.
Definition: addresstablemodel.h:23
WalletModel::getAddressTableModel
AddressTableModel * getAddressTableModel()
Definition: walletmodel.cpp:289
TransactionFilterProxy::WatchOnlyFilter_All
@ WatchOnlyFilter_All
Definition: transactionfilterproxy.h:32
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:260
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:294
TransactionFilterProxy::WatchOnlyFilter_No
@ WatchOnlyFilter_No
Definition: transactionfilterproxy.h:34
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:353
TransactionTablePriv::parent
TransactionTableModel * parent
Definition: transactiontablemodel.cpp:91
EditAddressDialog::setModel
void setModel(AddressTableModel *model)
Definition: editaddressdialog.cpp:55
TransactionView::STATUS_COLUMN_WIDTH
@ STATUS_COLUMN_WIDTH
Definition: transactionview.h:55
TransactionFilterProxy::MIN_DATE
static const QDateTime MIN_DATE
Earliest date that can be represented (far in the past)
Definition: transactionfilterproxy.h:22
EditAddressDialog::EditSendingAddress
@ EditSendingAddress
Definition: editaddressdialog.h:30
TransactionView::chooseWatchonly
void chooseWatchonly(int idx)
Definition: transactionview.cpp:322
TransactionRecord::RecvFromOther
@ RecvFromOther
Definition: transactionrecord.h:82
TransactionView::transactionView
QTableView * transactionView
Definition: transactionview.h:66
TransactionView::copyTxID
void copyTxID()
Definition: transactionview.cpp:465
BitcoinUnits::parse
static bool parse(int unit, const QString &value, CAmount *val_out)
Parse string to coin amount.
Definition: bitcoinunits.cpp:172
TransactionView::dateTo
QDateTimeEdit * dateTo
Definition: transactionview.h:78
TransactionTableModel::updateTransaction
void updateTransaction(const QString &hash, int status, bool showTransaction)
Definition: transactiontablemodel.cpp:273
TransactionTableModel::index
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
Definition: transactiontablemodel.cpp:696
url
const char * url
Definition: rpcconsole.cpp:56
CSVModelWriter
Export a Qt table model to a CSV file.
Definition: csvmodelwriter.h:18
WalletModel::wallet
interfaces::Wallet & wallet() const
Definition: walletmodel.h:146
EditAddressDialog
Dialog for editing an address and associated information.
Definition: editaddressdialog.h:22
PlatformStyle::getUseExtraSpacing
bool getUseExtraSpacing() const
Definition: platformstyle.h:22
GUIUtil::StartOfDay
QDateTime StartOfDay(const QDate &date)
Returns the start-moment of the day in local time.
Definition: guiutil.cpp:870
TransactionRecord::SendToOther
@ SendToOther
Definition: transactionrecord.h:80
TransactionView::showDetails
void showDetails()
Definition: transactionview.cpp:526
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:88
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:28
AddressTableModel::index
QModelIndex index(int row, int column, const QModelIndex &parent) const override
Definition: addresstablemodel.cpp:322
guiutil.h
TransactionView::DATE_COLUMN_WIDTH
@ DATE_COLUMN_WIDTH
Definition: transactionview.h:57
TransactionView::eventFilter
bool eventFilter(QObject *obj, QEvent *event) override
Definition: transactionview.cpp:630
TransactionView::copyAmount
void copyAmount()
Definition: transactionview.cpp:460
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:78
TransactionFilterProxy::setTypeFilter
void setTypeFilter(quint32 modes)
Definition: transactionfilterproxy.cpp:82
TransactionTableModel::Amount
@ Amount
Definition: transactiontablemodel.h:40
TransactionFilterProxy::setWatchOnlyFilter
void setWatchOnlyFilter(WatchOnlyFilter filter)
Definition: transactionfilterproxy.cpp:94
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:124
TransactionFilterProxy::MAX_DATE
static const QDateTime MAX_DATE
Last date that can be represented (far in the future)
Definition: transactionfilterproxy.h:24
TransactionView::transactionProxyModel
TransactionFilterProxy * transactionProxyModel
Definition: transactionview.h:65
TransactionRecord::SendToSelf
@ SendToSelf
Definition: transactionrecord.h:83
EditAddressDialog::setAddress
void setAddress(const QString &address)
Definition: editaddressdialog.cpp:162
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:584
TransactionView::copyLabel
void copyLabel()
Definition: transactionview.cpp:455
editaddressdialog.h
TransactionView::watchOnlyWidget
QComboBox * watchOnlyWidget
Definition: transactionview.h:70
TransactionFilterProxy::setDateRange
void setDateRange(const QDateTime &from, const QDateTime &to)
Definition: transactionfilterproxy.cpp:68
transactiondescdialog.h
TransactionView::WATCHONLY_COLUMN_WIDTH
@ WATCHONLY_COLUMN_WIDTH
Definition: transactionview.h:56
TransactionTableModel::FormattedAmountRole
@ FormattedAmountRole
Formatted amount, without brackets when unconfirmed.
Definition: transactiontablemodel.h:72
TransactionView::updateWatchOnlyColumn
void updateWatchOnlyColumn(bool fHaveWatchOnly)
Definition: transactionview.cpp:645
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:272
transactionrecord.h
TransactionFilterProxy::WatchOnlyFilter_Yes
@ WatchOnlyFilter_Yes
Definition: transactionfilterproxy.h:33
platformstyle.h
CClientUIInterface::MSG_ERROR
@ MSG_ERROR
Definition: ui_interface.h:68
TransactionView::bumpedFee
void bumpedFee(const uint256 &txid)
TransactionView::MINIMUM_COLUMN_WIDTH
@ MINIMUM_COLUMN_WIDTH
Definition: transactionview.h:60
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:74
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:240
TransactionView::copyLabelAction
QAction * copyLabelAction
Definition: transactionview.h:82
OptionsModel::getDisplayUnit
int getDisplayUnit() const
Definition: optionsmodel.h:86
TransactionView::copyTxHex
void copyTxHex()
Definition: transactionview.cpp:470
TransactionView::chooseDate
void chooseDate(int idx)
Definition: transactionview.cpp:267
TransactionFilterProxy::WatchOnlyFilter
WatchOnlyFilter
Definition: transactionfilterproxy.h:30
BitcoinUnits::getAmountColumnTitle
static QString getAmountColumnTitle(int unit)
Gets title for amount column including current display unit if optionsModel reference available *‍/.
Definition: bitcoinunits.cpp:211
TransactionTableModel::Type
@ Type
Definition: transactiontablemodel.h:38
TransactionView::setModel
void setModel(WalletModel *model)
Definition: transactionview.cpp:226
TransactionView::copyAddress
void copyAddress()
Definition: transactionview.cpp:450
TransactionView::amountWidget
QLineEdit * amountWidget
Definition: transactionview.h:72
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:313
TransactionView::typeWidget
QComboBox * typeWidget
Definition: transactionview.h:69
TransactionView::abandonTx
void abandonTx()
Definition: transactionview.cpp:409
TransactionView::copyAddressAction
QAction * copyAddressAction
Definition: transactionview.h:81
TransactionRecord::SendToAddress
@ SendToAddress
Definition: transactionrecord.h:79
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:389
TransactionTableModel::Status
@ Status
Definition: transactiontablemodel.h:35
OptionsModel::getThirdPartyTxUrls
QString getThirdPartyTxUrls() const
Definition: optionsmodel.h:87
transactionview.h
TransactionView::dateRangeWidget
QFrame * dateRangeWidget
Definition: transactionview.h:76
TransactionTableModel::DateRole
@ DateRole
Date and time this transaction was created.
Definition: transactiontablemodel.h:50
TransactionView::AMOUNT_MINIMUM_COLUMN_WIDTH
@ AMOUNT_MINIMUM_COLUMN_WIDTH
Definition: transactionview.h:59
TransactionView::chooseType
void chooseType(int idx)
Definition: transactionview.cpp:314
TransactionView::bumpFeeAction
QAction * bumpFeeAction
Definition: transactionview.h:80
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:40
TransactionView::doubleClicked
void doubleClicked(const QModelIndex &)
PlatformStyle
Definition: platformstyle.h:13
TransactionView::copyTxPlainText
void copyTxPlainText()
Definition: transactionview.cpp:475
TransactionView::model
WalletModel * model
Definition: transactionview.h:64
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:68
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:26
TransactionView::dateFrom
QDateTimeEdit * dateFrom
Definition: transactionview.h:77
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:77
TransactionFilterProxy
Filter the transaction list according to pre-specified rules.
Definition: transactionfilterproxy.h:14