Bitcoin Core  22.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), m_platform_style{platformStyle}
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);
59  watchOnlyWidget->addItem("", TransactionFilterProxy::WatchOnlyFilter_All);
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);
87  typeWidget->addItem(tr("Received with"), TransactionFilterProxy::TYPE(TransactionRecord::RecvWithAddress) |
89  typeWidget->addItem(tr("Sent to"), TransactionFilterProxy::TYPE(TransactionRecord::SendToAddress) |
91  typeWidget->addItem(tr("To yourself"), TransactionFilterProxy::TYPE(TransactionRecord::SendToSelf));
92  typeWidget->addItem(tr("Mined"), TransactionFilterProxy::TYPE(TransactionRecord::Generated));
93  typeWidget->addItem(tr("Other"), TransactionFilterProxy::TYPE(TransactionRecord::Other));
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())) {
155  transactionView->setColumnWidth(TransactionTableModel::Status, STATUS_COLUMN_WIDTH);
156  transactionView->setColumnWidth(TransactionTableModel::Watchonly, WATCHONLY_COLUMN_WIDTH);
157  transactionView->setColumnWidth(TransactionTableModel::Date, DATE_COLUMN_WIDTH);
158  transactionView->setColumnWidth(TransactionTableModel::Type, TYPE_COLUMN_WIDTH);
159  transactionView->setColumnWidth(TransactionTableModel::Amount, AMOUNT_MINIMUM_COLUMN_WIDTH);
160  transactionView->horizontalHeader()->setMinimumSectionSize(MINIMUM_COLUMN_WIDTH);
161  transactionView->horizontalHeader()->setStretchLastSection(true);
162  }
163 
164  contextMenu = new QMenu(this);
165  contextMenu->setObjectName("contextMenu");
166  copyAddressAction = contextMenu->addAction(tr("&Copy address"), this, &TransactionView::copyAddress);
167  copyLabelAction = contextMenu->addAction(tr("Copy &label"), this, &TransactionView::copyLabel);
168  contextMenu->addAction(tr("Copy &amount"), this, &TransactionView::copyAmount);
169  contextMenu->addAction(tr("Copy transaction &ID"), this, &TransactionView::copyTxID);
170  contextMenu->addAction(tr("Copy &raw transaction"), this, &TransactionView::copyTxHex);
171  contextMenu->addAction(tr("Copy full transaction &details"), this, &TransactionView::copyTxPlainText);
172  contextMenu->addAction(tr("&Show transaction details"), this, &TransactionView::showDetails);
173  contextMenu->addSeparator();
174  bumpFeeAction = contextMenu->addAction(tr("Increase transaction &fee"));
175  GUIUtil::ExceptionSafeConnect(bumpFeeAction, &QAction::triggered, this, &TransactionView::bumpFee);
176  bumpFeeAction->setObjectName("bumpFeeAction");
177  abandonAction = contextMenu->addAction(tr("A&bandon transaction"), this, &TransactionView::abandonTx);
178  contextMenu->addAction(tr("&Edit address label"), this, &TransactionView::editLabel);
179 
180  connect(dateWidget, qOverload<int>(&QComboBox::activated), this, &TransactionView::chooseDate);
181  connect(typeWidget, qOverload<int>(&QComboBox::activated), this, &TransactionView::chooseType);
182  connect(watchOnlyWidget, qOverload<int>(&QComboBox::activated), this, &TransactionView::chooseWatchonly);
183  connect(amountWidget, &QLineEdit::textChanged, amount_typing_delay, qOverload<>(&QTimer::start));
184  connect(amount_typing_delay, &QTimer::timeout, this, &TransactionView::changedAmount);
185  connect(search_widget, &QLineEdit::textChanged, prefix_typing_delay, qOverload<>(&QTimer::start));
186  connect(prefix_typing_delay, &QTimer::timeout, this, &TransactionView::changedSearch);
187 
188  connect(transactionView, &QTableView::doubleClicked, this, &TransactionView::doubleClicked);
189  connect(transactionView, &QTableView::customContextMenuRequested, this, &TransactionView::contextualMenu);
190 
191  // Double-clicking on a transaction on the transaction history page shows details
193  // Highlight transaction after fee bump
194  connect(this, &TransactionView::bumpedFee, [this](const uint256& txid) {
195  focusTransaction(txid);
196  });
197 }
198 
200 {
201  QSettings settings;
202  settings.setValue("TransactionViewHeaderState", transactionView->horizontalHeader()->saveState());
203 }
204 
206 {
207  this->model = _model;
208  if(_model)
209  {
211  transactionProxyModel->setSourceModel(_model->getTransactionTableModel());
212  transactionProxyModel->setDynamicSortFilter(true);
213  transactionProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
214  transactionProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
215  transactionProxyModel->setSortRole(Qt::EditRole);
217  transactionView->sortByColumn(TransactionTableModel::Date, Qt::DescendingOrder);
218 
219  if (_model->getOptionsModel())
220  {
221  // Add third party transaction URLs to context menu
222  QStringList listUrls = GUIUtil::SplitSkipEmptyParts(_model->getOptionsModel()->getThirdPartyTxUrls(), "|");
223  for (int i = 0; i < listUrls.size(); ++i)
224  {
225  QString url = listUrls[i].trimmed();
226  QString host = QUrl(url, QUrl::StrictMode).host();
227  if (!host.isEmpty())
228  {
229  QAction *thirdPartyTxUrlAction = new QAction(host, this); // use host as menu item label
230  if (i == 0)
231  contextMenu->addSeparator();
232  contextMenu->addAction(thirdPartyTxUrlAction);
233  connect(thirdPartyTxUrlAction, &QAction::triggered, [this, url] { openThirdPartyTxUrl(url); });
234  }
235  }
236  }
237 
238  // show/hide column Watch-only
240 
241  // Watch-only signal
243  }
244 }
245 
247 {
248  if (e->type() == QEvent::PaletteChange) {
249  watchOnlyWidget->setItemIcon(
251  m_platform_style->SingleColorIcon(QStringLiteral(":/icons/eye_plus")));
252  watchOnlyWidget->setItemIcon(
254  m_platform_style->SingleColorIcon(QStringLiteral(":/icons/eye_minus")));
255  }
256 
257  QWidget::changeEvent(e);
258 }
259 
261 {
262  if (!transactionProxyModel) return;
263  QDate current = QDate::currentDate();
264  dateRangeWidget->setVisible(false);
265  switch(dateWidget->itemData(idx).toInt())
266  {
267  case All:
271  break;
272  case Today:
274  GUIUtil::StartOfDay(current),
276  break;
277  case ThisWeek: {
278  // Find last Monday
279  QDate startOfWeek = current.addDays(-(current.dayOfWeek()-1));
281  GUIUtil::StartOfDay(startOfWeek),
283 
284  } break;
285  case ThisMonth:
287  GUIUtil::StartOfDay(QDate(current.year(), current.month(), 1)),
289  break;
290  case LastMonth:
292  GUIUtil::StartOfDay(QDate(current.year(), current.month(), 1).addMonths(-1)),
293  GUIUtil::StartOfDay(QDate(current.year(), current.month(), 1)));
294  break;
295  case ThisYear:
297  GUIUtil::StartOfDay(QDate(current.year(), 1, 1)),
299  break;
300  case Range:
301  dateRangeWidget->setVisible(true);
303  break;
304  }
305 }
306 
308 {
310  return;
312  typeWidget->itemData(idx).toInt());
313 }
314 
316 {
318  return;
320  static_cast<TransactionFilterProxy::WatchOnlyFilter>(watchOnlyWidget->itemData(idx).toInt()));
321 }
322 
324 {
326  return;
328 }
329 
331 {
333  return;
334  CAmount amount_parsed = 0;
335  if (BitcoinUnits::parse(model->getOptionsModel()->getDisplayUnit(), amountWidget->text(), &amount_parsed)) {
336  transactionProxyModel->setMinAmount(amount_parsed);
337  }
338  else
339  {
341  }
342 }
343 
345 {
346  if (!model || !model->getOptionsModel()) {
347  return;
348  }
349 
350  // CSV is currently the only supported format
351  QString filename = GUIUtil::getSaveFileName(this,
352  tr("Export Transaction History"), QString(),
353  /*: Expanded name of the CSV file format.
354  See https://en.wikipedia.org/wiki/Comma-separated_values */
355  tr("Comma separated file") + QLatin1String(" (*.csv)"), nullptr);
356 
357  if (filename.isNull())
358  return;
359 
360  CSVModelWriter writer(filename);
361 
362  // name, column, role
364  writer.addColumn(tr("Confirmed"), 0, TransactionTableModel::ConfirmedRole);
365  if (model->wallet().haveWatchOnly())
366  writer.addColumn(tr("Watch-only"), TransactionTableModel::Watchonly);
367  writer.addColumn(tr("Date"), 0, TransactionTableModel::DateRole);
368  writer.addColumn(tr("Type"), TransactionTableModel::Type, Qt::EditRole);
369  writer.addColumn(tr("Label"), 0, TransactionTableModel::LabelRole);
370  writer.addColumn(tr("Address"), 0, TransactionTableModel::AddressRole);
372  writer.addColumn(tr("ID"), 0, TransactionTableModel::TxHashRole);
373 
374  if(!writer.write()) {
375  Q_EMIT message(tr("Exporting Failed"), tr("There was an error trying to save the transaction history to %1.").arg(filename),
377  }
378  else {
379  Q_EMIT message(tr("Exporting Successful"), tr("The transaction history was successfully saved to %1.").arg(filename),
381  }
382 }
383 
384 void TransactionView::contextualMenu(const QPoint &point)
385 {
386  QModelIndex index = transactionView->indexAt(point);
387  QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);
388  if (selection.empty())
389  return;
390 
391  // check if transaction can be abandoned, disable context menu action in case it doesn't
392  uint256 hash;
393  hash.SetHex(selection.at(0).data(TransactionTableModel::TxHashRole).toString().toStdString());
394  abandonAction->setEnabled(model->wallet().transactionCanBeAbandoned(hash));
395  bumpFeeAction->setEnabled(model->wallet().transactionCanBeBumped(hash));
398 
399  if (index.isValid()) {
400  GUIUtil::PopupMenu(contextMenu, transactionView->viewport()->mapToGlobal(point));
401  }
402 }
403 
405 {
406  if(!transactionView || !transactionView->selectionModel())
407  return;
408  QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);
409 
410  // get the hash from the TxHashRole (QVariant / QString)
411  uint256 hash;
412  QString hashQStr = selection.at(0).data(TransactionTableModel::TxHashRole).toString();
413  hash.SetHex(hashQStr.toStdString());
414 
415  // Abandon the wallet transaction over the walletModel
417 
418  // Update the table
420 }
421 
422 void TransactionView::bumpFee([[maybe_unused]] bool checked)
423 {
424  if(!transactionView || !transactionView->selectionModel())
425  return;
426  QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);
427 
428  // get the hash from the TxHashRole (QVariant / QString)
429  uint256 hash;
430  QString hashQStr = selection.at(0).data(TransactionTableModel::TxHashRole).toString();
431  hash.SetHex(hashQStr.toStdString());
432 
433  // Bump tx fee over the walletModel
434  uint256 newHash;
435  if (model->bumpFee(hash, newHash)) {
436  // Update the table
437  transactionView->selectionModel()->clearSelection();
439 
440  qApp->processEvents();
441  Q_EMIT bumpedFee(newHash);
442  }
443 }
444 
446 {
448 }
449 
451 {
453 }
454 
456 {
458 }
459 
461 {
463 }
464 
466 {
468 }
469 
471 {
473 }
474 
476 {
477  if(!transactionView->selectionModel() ||!model)
478  return;
479  QModelIndexList selection = transactionView->selectionModel()->selectedRows();
480  if(!selection.isEmpty())
481  {
482  AddressTableModel *addressBook = model->getAddressTableModel();
483  if(!addressBook)
484  return;
485  QString address = selection.at(0).data(TransactionTableModel::AddressRole).toString();
486  if(address.isEmpty())
487  {
488  // If this transaction has no associated address, exit
489  return;
490  }
491  // Is address in address book? Address book can miss address when a transaction is
492  // sent from outside the UI.
493  int idx = addressBook->lookupAddress(address);
494  if(idx != -1)
495  {
496  // Edit sending / receiving address
497  QModelIndex modelIdx = addressBook->index(idx, 0, QModelIndex());
498  // Determine type of address, launch appropriate editor dialog type
499  QString type = modelIdx.data(AddressTableModel::TypeRole).toString();
500 
501  EditAddressDialog dlg(
505  dlg.setModel(addressBook);
506  dlg.loadRow(idx);
507  dlg.exec();
508  }
509  else
510  {
511  // Add sending address
513  this);
514  dlg.setModel(addressBook);
515  dlg.setAddress(address);
516  dlg.exec();
517  }
518  }
519 }
520 
522 {
523  if(!transactionView->selectionModel())
524  return;
525  QModelIndexList selection = transactionView->selectionModel()->selectedRows();
526  if(!selection.isEmpty())
527  {
528  TransactionDescDialog *dlg = new TransactionDescDialog(selection.at(0));
529  dlg->setAttribute(Qt::WA_DeleteOnClose);
530  dlg->show();
531  }
532 }
533 
535 {
536  if(!transactionView || !transactionView->selectionModel())
537  return;
538  QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);
539  if(!selection.isEmpty())
540  QDesktopServices::openUrl(QUrl::fromUserInput(url.replace("%s", selection.at(0).data(TransactionTableModel::TxHashRole).toString())));
541 }
542 
544 {
545  dateRangeWidget = new QFrame();
546  dateRangeWidget->setFrameStyle(QFrame::Panel | QFrame::Raised);
547  dateRangeWidget->setContentsMargins(1,1,1,1);
548  QHBoxLayout *layout = new QHBoxLayout(dateRangeWidget);
549  layout->setContentsMargins(0,0,0,0);
550  layout->addSpacing(23);
551  layout->addWidget(new QLabel(tr("Range:")));
552 
553  dateFrom = new QDateTimeEdit(this);
554  dateFrom->setDisplayFormat("dd/MM/yy");
555  dateFrom->setCalendarPopup(true);
556  dateFrom->setMinimumWidth(100);
557  dateFrom->setDate(QDate::currentDate().addDays(-7));
558  layout->addWidget(dateFrom);
559  layout->addWidget(new QLabel(tr("to")));
560 
561  dateTo = new QDateTimeEdit(this);
562  dateTo->setDisplayFormat("dd/MM/yy");
563  dateTo->setCalendarPopup(true);
564  dateTo->setMinimumWidth(100);
565  dateTo->setDate(QDate::currentDate());
566  layout->addWidget(dateTo);
567  layout->addStretch();
568 
569  // Hide by default
570  dateRangeWidget->setVisible(false);
571 
572  // Notify on change
573  connect(dateFrom, &QDateTimeEdit::dateChanged, this, &TransactionView::dateRangeChanged);
574  connect(dateTo, &QDateTimeEdit::dateChanged, this, &TransactionView::dateRangeChanged);
575 
576  return dateRangeWidget;
577 }
578 
580 {
582  return;
584  GUIUtil::StartOfDay(dateFrom->date()),
585  GUIUtil::StartOfDay(dateTo->date()).addDays(1));
586 }
587 
588 void TransactionView::focusTransaction(const QModelIndex &idx)
589 {
591  return;
592  QModelIndex targetIdx = transactionProxyModel->mapFromSource(idx);
593  transactionView->scrollTo(targetIdx);
594  transactionView->setCurrentIndex(targetIdx);
595  transactionView->setFocus();
596 }
597 
599 {
601  return;
602 
603  const QModelIndexList results = this->model->getTransactionTableModel()->match(
604  this->model->getTransactionTableModel()->index(0,0),
606  QString::fromStdString(txid.ToString()), -1);
607 
608  transactionView->setFocus();
609  transactionView->selectionModel()->clearSelection();
610  for (const QModelIndex& index : results) {
611  const QModelIndex targetIndex = transactionProxyModel->mapFromSource(index);
612  transactionView->selectionModel()->select(
613  targetIndex,
614  QItemSelectionModel::Rows | QItemSelectionModel::Select);
615  // Called once per destination to ensure all results are in view, unless
616  // transactions are not ordered by (ascending or descending) date.
617  transactionView->scrollTo(targetIndex);
618  // scrollTo() does not scroll far enough the first time when transactions
619  // are ordered by ascending date.
620  if (index == results[0]) transactionView->scrollTo(targetIndex);
621  }
622 }
623 
624 // Need to override default Ctrl+C action for amount as default behaviour is just to copy DisplayRole text
625 bool TransactionView::eventFilter(QObject *obj, QEvent *event)
626 {
627  if (event->type() == QEvent::KeyPress)
628  {
629  QKeyEvent *ke = static_cast<QKeyEvent *>(event);
630  if (ke->key() == Qt::Key_C && ke->modifiers().testFlag(Qt::ControlModifier))
631  {
633  return true;
634  }
635  }
636  return QWidget::eventFilter(obj, event);
637 }
638 
639 // show/hide column Watch-only
640 void TransactionView::updateWatchOnlyColumn(bool fHaveWatchOnly)
641 {
642  watchOnlyWidget->setVisible(fHaveWatchOnly);
643  transactionView->setColumnHidden(TransactionTableModel::Watchonly, !fHaveWatchOnly);
644 }
CClientUIInterface::MSG_INFORMATION
@ MSG_INFORMATION
Predefined combinations for certain default usage cases.
Definition: ui_interface.h:66
WalletModel::getOptionsModel
OptionsModel * getOptionsModel()
Definition: walletmodel.cpp:284
TransactionView::createDateRangeWidget
QWidget * createDateRangeWidget()
Definition: transactionview.cpp:543
transactiontablemodel.h
WalletModel::bumpFee
bool bumpFee(uint256 hash, uint256 &new_hash)
Definition: walletmodel.cpp:469
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:905
TransactionView::editLabel
void editLabel()
Definition: transactionview.cpp:475
EditAddressDialog::loadRow
void loadRow(int row)
Definition: editaddressdialog.cpp:66
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:51
TransactionTableModel::AddressRole
@ AddressRole
Address of transaction.
Definition: transactiontablemodel.h:58
TransactionView::openThirdPartyTxUrl
void openThirdPartyTxUrl(QString url)
Definition: transactionview.cpp:534
TransactionView::~TransactionView
~TransactionView()
Definition: transactionview.cpp:199
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:422
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:588
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:267
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:386
TransactionTablePriv::parent
TransactionTableModel * parent
Definition: transactiontablemodel.cpp:93
EditAddressDialog::setModel
void setModel(AddressTableModel *model)
Definition: editaddressdialog.cpp: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:315
TransactionRecord::RecvFromOther
@ RecvFromOther
Definition: transactionrecord.h:82
TransactionView::transactionView
QTableView * transactionView
Definition: transactionview.h:69
TransactionView::copyTxID
void copyTxID()
Definition: transactionview.cpp:460
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: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:702
url
const char * url
Definition: rpcconsole.cpp:62
CSVModelWriter
Export a Qt table model to a CSV file.
Definition: csvmodelwriter.h:18
WalletModel::wallet
interfaces::Wallet & wallet() const
Definition: walletmodel.h:144
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:912
TransactionRecord::SendToOther
@ SendToOther
Definition: transactionrecord.h:80
TransactionView::showDetails
void showDetails()
Definition: transactionview.cpp:521
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:323
TransactionFilterProxy::setMinAmount
void setMinAmount(const CAmount &minimum)
Definition: transactionfilterproxy.cpp:88
transactionfilterproxy.h
TransactionView::changedAmount
void changedAmount()
Definition: transactionview.cpp:330
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::eventFilter
bool eventFilter(QObject *obj, QEvent *event) override
Definition: transactionview.cpp:625
TransactionView::copyAmount
void copyAmount()
Definition: transactionview.cpp:455
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:68
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:579
TransactionView::copyLabel
void copyLabel()
Definition: transactionview.cpp:450
NetPermissionFlags::All
@ All
editaddressdialog.h
TransactionView::watchOnlyWidget
QComboBox * watchOnlyWidget
Definition: transactionview.h:73
TransactionFilterProxy::setDateRange
void setDateRange(const QDateTime &from, const QDateTime &to)
Definition: transactionfilterproxy.cpp:68
transactiondescdialog.h
TransactionTableModel::FormattedAmountRole
@ FormattedAmountRole
Formatted amount, without brackets when unconfirmed.
Definition: transactiontablemodel.h:72
TransactionView::updateWatchOnlyColumn
void updateWatchOnlyColumn(bool fHaveWatchOnly)
Definition: transactionview.cpp:640
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:279
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::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:247
TransactionView::copyLabelAction
QAction * copyLabelAction
Definition: transactionview.h:85
OptionsModel::getDisplayUnit
int getDisplayUnit() const
Definition: optionsmodel.h:87
TransactionView::copyTxHex
void copyTxHex()
Definition: transactionview.cpp:465
TransactionView::chooseDate
void chooseDate(int idx)
Definition: transactionview.cpp:260
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:205
TransactionView::copyAddress
void copyAddress()
Definition: transactionview.cpp:445
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:346
TransactionView::typeWidget
QComboBox * typeWidget
Definition: transactionview.h:72
TransactionView::abandonTx
void abandonTx()
Definition: transactionview.cpp:404
TransactionView::copyAddressAction
QAction * copyAddressAction
Definition: transactionview.h:84
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:384
TransactionTableModel::Status
@ Status
Definition: transactiontablemodel.h:35
OptionsModel::getThirdPartyTxUrls
QString getThirdPartyTxUrls() const
Definition: optionsmodel.h:88
TransactionView::changeEvent
void changeEvent(QEvent *e) override
Definition: transactionview.cpp:246
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:307
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:40
TransactionView::doubleClicked
void doubleClicked(const QModelIndex &)
PlatformStyle
Definition: platformstyle.h:13
TransactionView::copyTxPlainText
void copyTxPlainText()
Definition: transactionview.cpp:470
TransactionView::model
WalletModel * model
Definition: transactionview.h:67
TransactionView::exportClicked
void exportClicked()
Definition: transactionview.cpp:344
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:26
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:77
TransactionFilterProxy
Filter the transaction list according to pre-specified rules.
Definition: transactionfilterproxy.h:14