Bitcoin Core  0.19.99
P2P Digital Currency
transactionview.cpp
Go to the documentation of this file.
1 // Copyright (c) 2011-2019 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/optionsmodel.h>
12 #include <qt/platformstyle.h>
15 #include <qt/transactionrecord.h>
17 #include <qt/walletmodel.h>
18 
19 #include <ui_interface.h>
20 
21 #include <QApplication>
22 #include <QComboBox>
23 #include <QDateTimeEdit>
24 #include <QDesktopServices>
25 #include <QDoubleValidator>
26 #include <QHBoxLayout>
27 #include <QHeaderView>
28 #include <QLabel>
29 #include <QLineEdit>
30 #include <QMenu>
31 #include <QPoint>
32 #include <QScrollBar>
33 #include <QTableView>
34 #include <QTimer>
35 #include <QUrl>
36 #include <QVBoxLayout>
37 
38 TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *parent) :
39  QWidget(parent), model(nullptr), transactionProxyModel(nullptr),
40  transactionView(nullptr), abandonAction(nullptr), bumpFeeAction(nullptr), columnResizingFixer(nullptr)
41 {
42  // Build filter row
43  setContentsMargins(0,0,0,0);
44 
45  QHBoxLayout *hlayout = new QHBoxLayout();
46  hlayout->setContentsMargins(0,0,0,0);
47 
48  if (platformStyle->getUseExtraSpacing()) {
49  hlayout->setSpacing(5);
50  hlayout->addSpacing(26);
51  } else {
52  hlayout->setSpacing(0);
53  hlayout->addSpacing(23);
54  }
55 
56  watchOnlyWidget = new QComboBox(this);
57  watchOnlyWidget->setFixedWidth(24);
59  watchOnlyWidget->addItem(platformStyle->SingleColorIcon(":/icons/eye_plus"), "", TransactionFilterProxy::WatchOnlyFilter_Yes);
60  watchOnlyWidget->addItem(platformStyle->SingleColorIcon(":/icons/eye_minus"), "", TransactionFilterProxy::WatchOnlyFilter_No);
61  hlayout->addWidget(watchOnlyWidget);
62 
63  dateWidget = new QComboBox(this);
64  if (platformStyle->getUseExtraSpacing()) {
65  dateWidget->setFixedWidth(121);
66  } else {
67  dateWidget->setFixedWidth(120);
68  }
69  dateWidget->addItem(tr("All"), All);
70  dateWidget->addItem(tr("Today"), Today);
71  dateWidget->addItem(tr("This week"), ThisWeek);
72  dateWidget->addItem(tr("This month"), ThisMonth);
73  dateWidget->addItem(tr("Last month"), LastMonth);
74  dateWidget->addItem(tr("This year"), ThisYear);
75  dateWidget->addItem(tr("Range..."), Range);
76  hlayout->addWidget(dateWidget);
77 
78  typeWidget = new QComboBox(this);
79  if (platformStyle->getUseExtraSpacing()) {
80  typeWidget->setFixedWidth(121);
81  } else {
82  typeWidget->setFixedWidth(120);
83  }
84 
85  typeWidget->addItem(tr("All"), TransactionFilterProxy::ALL_TYPES);
93 
94  hlayout->addWidget(typeWidget);
95 
96  search_widget = new QLineEdit(this);
97  search_widget->setPlaceholderText(tr("Enter address, transaction id, or label to search"));
98  hlayout->addWidget(search_widget);
99 
100  amountWidget = new QLineEdit(this);
101  amountWidget->setPlaceholderText(tr("Min amount"));
102  if (platformStyle->getUseExtraSpacing()) {
103  amountWidget->setFixedWidth(97);
104  } else {
105  amountWidget->setFixedWidth(100);
106  }
107  QDoubleValidator *amountValidator = new QDoubleValidator(0, 1e20, 8, this);
108  QLocale amountLocale(QLocale::C);
109  amountLocale.setNumberOptions(QLocale::RejectGroupSeparator);
110  amountValidator->setLocale(amountLocale);
111  amountWidget->setValidator(amountValidator);
112  hlayout->addWidget(amountWidget);
113 
114  // Delay before filtering transactions in ms
115  static const int input_filter_delay = 200;
116 
117  QTimer* amount_typing_delay = new QTimer(this);
118  amount_typing_delay->setSingleShot(true);
119  amount_typing_delay->setInterval(input_filter_delay);
120 
121  QTimer* prefix_typing_delay = new QTimer(this);
122  prefix_typing_delay->setSingleShot(true);
123  prefix_typing_delay->setInterval(input_filter_delay);
124 
125  QVBoxLayout *vlayout = new QVBoxLayout(this);
126  vlayout->setContentsMargins(0,0,0,0);
127  vlayout->setSpacing(0);
128 
129  QTableView *view = new QTableView(this);
130  vlayout->addLayout(hlayout);
131  vlayout->addWidget(createDateRangeWidget());
132  vlayout->addWidget(view);
133  vlayout->setSpacing(0);
134  int width = view->verticalScrollBar()->sizeHint().width();
135  // Cover scroll bar width with spacing
136  if (platformStyle->getUseExtraSpacing()) {
137  hlayout->addSpacing(width+2);
138  } else {
139  hlayout->addSpacing(width);
140  }
141  // Always show scroll bar
142  view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
143  view->setTabKeyNavigation(false);
144  view->setContextMenuPolicy(Qt::CustomContextMenu);
145 
146  view->installEventFilter(this);
147 
148  transactionView = view;
149  transactionView->setObjectName("transactionView");
150 
151  // Actions
152  abandonAction = new QAction(tr("Abandon transaction"), this);
153  bumpFeeAction = new QAction(tr("Increase transaction fee"), this);
154  bumpFeeAction->setObjectName("bumpFeeAction");
155  QAction *copyAddressAction = new QAction(tr("Copy address"), this);
156  QAction *copyLabelAction = new QAction(tr("Copy label"), this);
157  QAction *copyAmountAction = new QAction(tr("Copy amount"), this);
158  QAction *copyTxIDAction = new QAction(tr("Copy transaction ID"), this);
159  QAction *copyTxHexAction = new QAction(tr("Copy raw transaction"), this);
160  QAction *copyTxPlainText = new QAction(tr("Copy full transaction details"), this);
161  QAction *editLabelAction = new QAction(tr("Edit label"), this);
162  QAction *showDetailsAction = new QAction(tr("Show transaction details"), this);
163 
164  contextMenu = new QMenu(this);
165  contextMenu->setObjectName("contextMenu");
166  contextMenu->addAction(copyAddressAction);
167  contextMenu->addAction(copyLabelAction);
168  contextMenu->addAction(copyAmountAction);
169  contextMenu->addAction(copyTxIDAction);
170  contextMenu->addAction(copyTxHexAction);
171  contextMenu->addAction(copyTxPlainText);
172  contextMenu->addAction(showDetailsAction);
173  contextMenu->addSeparator();
174  contextMenu->addAction(bumpFeeAction);
175  contextMenu->addAction(abandonAction);
176  contextMenu->addAction(editLabelAction);
177 
178  connect(dateWidget, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &TransactionView::chooseDate);
179  connect(typeWidget, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &TransactionView::chooseType);
180  connect(watchOnlyWidget, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &TransactionView::chooseWatchonly);
181  connect(amountWidget, &QLineEdit::textChanged, amount_typing_delay, static_cast<void (QTimer::*)()>(&QTimer::start));
182  connect(amount_typing_delay, &QTimer::timeout, this, &TransactionView::changedAmount);
183  connect(search_widget, &QLineEdit::textChanged, prefix_typing_delay, static_cast<void (QTimer::*)()>(&QTimer::start));
184  connect(prefix_typing_delay, &QTimer::timeout, this, &TransactionView::changedSearch);
185 
186  connect(view, &QTableView::doubleClicked, this, &TransactionView::doubleClicked);
187  connect(view, &QTableView::customContextMenuRequested, this, &TransactionView::contextualMenu);
188 
189  connect(bumpFeeAction, &QAction::triggered, this, &TransactionView::bumpFee);
190  connect(abandonAction, &QAction::triggered, this, &TransactionView::abandonTx);
191  connect(copyAddressAction, &QAction::triggered, this, &TransactionView::copyAddress);
192  connect(copyLabelAction, &QAction::triggered, this, &TransactionView::copyLabel);
193  connect(copyAmountAction, &QAction::triggered, this, &TransactionView::copyAmount);
194  connect(copyTxIDAction, &QAction::triggered, this, &TransactionView::copyTxID);
195  connect(copyTxHexAction, &QAction::triggered, this, &TransactionView::copyTxHex);
196  connect(copyTxPlainText, &QAction::triggered, this, &TransactionView::copyTxPlainText);
197  connect(editLabelAction, &QAction::triggered, this, &TransactionView::editLabel);
198  connect(showDetailsAction, &QAction::triggered, this, &TransactionView::showDetails);
199  // Double-clicking on a transaction on the transaction history page shows details
201  // Highlight transaction after fee bump
202  connect(this, &TransactionView::bumpedFee, [this](const uint256& txid) {
203  focusTransaction(txid);
204  });
205 }
206 
208 {
209  this->model = _model;
210  if(_model)
211  {
213  transactionProxyModel->setSourceModel(_model->getTransactionTableModel());
214  transactionProxyModel->setDynamicSortFilter(true);
215  transactionProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
216  transactionProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
217 
218  transactionProxyModel->setSortRole(Qt::EditRole);
219 
220  transactionView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
222  transactionView->setAlternatingRowColors(true);
223  transactionView->setSelectionBehavior(QAbstractItemView::SelectRows);
224  transactionView->setSelectionMode(QAbstractItemView::ExtendedSelection);
225  transactionView->horizontalHeader()->setSortIndicator(TransactionTableModel::Date, Qt::DescendingOrder);
226  transactionView->setSortingEnabled(true);
227  transactionView->verticalHeader()->hide();
228 
234 
236 
237  if (_model->getOptionsModel())
238  {
239  // Add third party transaction URLs to context menu
240  QStringList listUrls = _model->getOptionsModel()->getThirdPartyTxUrls().split("|", QString::SkipEmptyParts);
241  for (int i = 0; i < listUrls.size(); ++i)
242  {
243  QString url = listUrls[i].trimmed();
244  QString host = QUrl(url, QUrl::StrictMode).host();
245  if (!host.isEmpty())
246  {
247  QAction *thirdPartyTxUrlAction = new QAction(host, this); // use host as menu item label
248  if (i == 0)
249  contextMenu->addSeparator();
250  contextMenu->addAction(thirdPartyTxUrlAction);
251  connect(thirdPartyTxUrlAction, &QAction::triggered, [this, url] { openThirdPartyTxUrl(url); });
252  }
253  }
254  }
255 
256  // show/hide column Watch-only
258 
259  // Watch-only signal
261  }
262 }
263 
265 {
266  if (!transactionProxyModel) return;
267  QDate current = QDate::currentDate();
268  dateRangeWidget->setVisible(false);
269  switch(dateWidget->itemData(idx).toInt())
270  {
271  case All:
275  break;
276  case Today:
278  QDateTime(current),
280  break;
281  case ThisWeek: {
282  // Find last Monday
283  QDate startOfWeek = current.addDays(-(current.dayOfWeek()-1));
285  QDateTime(startOfWeek),
287 
288  } break;
289  case ThisMonth:
291  QDateTime(QDate(current.year(), current.month(), 1)),
293  break;
294  case LastMonth:
296  QDateTime(QDate(current.year(), current.month(), 1).addMonths(-1)),
297  QDateTime(QDate(current.year(), current.month(), 1)));
298  break;
299  case ThisYear:
301  QDateTime(QDate(current.year(), 1, 1)),
303  break;
304  case Range:
305  dateRangeWidget->setVisible(true);
307  break;
308  }
309 }
310 
312 {
314  return;
316  typeWidget->itemData(idx).toInt());
317 }
318 
320 {
322  return;
324  static_cast<TransactionFilterProxy::WatchOnlyFilter>(watchOnlyWidget->itemData(idx).toInt()));
325 }
326 
328 {
330  return;
332 }
333 
335 {
337  return;
338  CAmount amount_parsed = 0;
339  if (BitcoinUnits::parse(model->getOptionsModel()->getDisplayUnit(), amountWidget->text(), &amount_parsed)) {
340  transactionProxyModel->setMinAmount(amount_parsed);
341  }
342  else
343  {
345  }
346 }
347 
349 {
350  if (!model || !model->getOptionsModel()) {
351  return;
352  }
353 
354  // CSV is currently the only supported format
355  QString filename = GUIUtil::getSaveFileName(this,
356  tr("Export Transaction History"), QString(),
357  tr("Comma separated file (*.csv)"), nullptr);
358 
359  if (filename.isNull())
360  return;
361 
362  CSVModelWriter writer(filename);
363 
364  // name, column, role
366  writer.addColumn(tr("Confirmed"), 0, TransactionTableModel::ConfirmedRole);
367  if (model->wallet().haveWatchOnly())
368  writer.addColumn(tr("Watch-only"), TransactionTableModel::Watchonly);
369  writer.addColumn(tr("Date"), 0, TransactionTableModel::DateRole);
370  writer.addColumn(tr("Type"), TransactionTableModel::Type, Qt::EditRole);
371  writer.addColumn(tr("Label"), 0, TransactionTableModel::LabelRole);
372  writer.addColumn(tr("Address"), 0, TransactionTableModel::AddressRole);
374  writer.addColumn(tr("ID"), 0, TransactionTableModel::TxHashRole);
375 
376  if(!writer.write()) {
377  Q_EMIT message(tr("Exporting Failed"), tr("There was an error trying to save the transaction history to %1.").arg(filename),
379  }
380  else {
381  Q_EMIT message(tr("Exporting Successful"), tr("The transaction history was successfully saved to %1.").arg(filename),
383  }
384 }
385 
386 void TransactionView::contextualMenu(const QPoint &point)
387 {
388  QModelIndex index = transactionView->indexAt(point);
389  QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);
390  if (selection.empty())
391  return;
392 
393  // check if transaction can be abandoned, disable context menu action in case it doesn't
394  uint256 hash;
395  hash.SetHex(selection.at(0).data(TransactionTableModel::TxHashRole).toString().toStdString());
396  abandonAction->setEnabled(model->wallet().transactionCanBeAbandoned(hash));
397  bumpFeeAction->setEnabled(model->wallet().transactionCanBeBumped(hash));
398 
399  if(index.isValid())
400  {
401  contextMenu->popup(transactionView->viewport()->mapToGlobal(point));
402  }
403 }
404 
406 {
407  if(!transactionView || !transactionView->selectionModel())
408  return;
409  QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);
410 
411  // get the hash from the TxHashRole (QVariant / QString)
412  uint256 hash;
413  QString hashQStr = selection.at(0).data(TransactionTableModel::TxHashRole).toString();
414  hash.SetHex(hashQStr.toStdString());
415 
416  // Abandon the wallet transaction over the walletModel
418 
419  // Update the table
421 }
422 
424 {
425  if(!transactionView || !transactionView->selectionModel())
426  return;
427  QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);
428 
429  // get the hash from the TxHashRole (QVariant / QString)
430  uint256 hash;
431  QString hashQStr = selection.at(0).data(TransactionTableModel::TxHashRole).toString();
432  hash.SetHex(hashQStr.toStdString());
433 
434  // Bump tx fee over the walletModel
435  uint256 newHash;
436  if (model->bumpFee(hash, newHash)) {
437  // Update the table
438  transactionView->selectionModel()->clearSelection();
440 
441  qApp->processEvents();
442  Q_EMIT bumpedFee(newHash);
443  }
444 }
445 
447 {
449 }
450 
452 {
454 }
455 
457 {
459 }
460 
462 {
464 }
465 
467 {
469 }
470 
472 {
474 }
475 
477 {
478  if(!transactionView->selectionModel() ||!model)
479  return;
480  QModelIndexList selection = transactionView->selectionModel()->selectedRows();
481  if(!selection.isEmpty())
482  {
483  AddressTableModel *addressBook = model->getAddressTableModel();
484  if(!addressBook)
485  return;
486  QString address = selection.at(0).data(TransactionTableModel::AddressRole).toString();
487  if(address.isEmpty())
488  {
489  // If this transaction has no associated address, exit
490  return;
491  }
492  // Is address in address book? Address book can miss address when a transaction is
493  // sent from outside the UI.
494  int idx = addressBook->lookupAddress(address);
495  if(idx != -1)
496  {
497  // Edit sending / receiving address
498  QModelIndex modelIdx = addressBook->index(idx, 0, QModelIndex());
499  // Determine type of address, launch appropriate editor dialog type
500  QString type = modelIdx.data(AddressTableModel::TypeRole).toString();
501 
502  EditAddressDialog dlg(
506  dlg.setModel(addressBook);
507  dlg.loadRow(idx);
508  dlg.exec();
509  }
510  else
511  {
512  // Add sending address
514  this);
515  dlg.setModel(addressBook);
516  dlg.setAddress(address);
517  dlg.exec();
518  }
519  }
520 }
521 
523 {
524  if(!transactionView->selectionModel())
525  return;
526  QModelIndexList selection = transactionView->selectionModel()->selectedRows();
527  if(!selection.isEmpty())
528  {
529  TransactionDescDialog *dlg = new TransactionDescDialog(selection.at(0));
530  dlg->setAttribute(Qt::WA_DeleteOnClose);
531  dlg->show();
532  }
533 }
534 
536 {
537  if(!transactionView || !transactionView->selectionModel())
538  return;
539  QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);
540  if(!selection.isEmpty())
541  QDesktopServices::openUrl(QUrl::fromUserInput(url.replace("%s", selection.at(0).data(TransactionTableModel::TxHashRole).toString())));
542 }
543 
545 {
546  dateRangeWidget = new QFrame();
547  dateRangeWidget->setFrameStyle(QFrame::Panel | QFrame::Raised);
548  dateRangeWidget->setContentsMargins(1,1,1,1);
549  QHBoxLayout *layout = new QHBoxLayout(dateRangeWidget);
550  layout->setContentsMargins(0,0,0,0);
551  layout->addSpacing(23);
552  layout->addWidget(new QLabel(tr("Range:")));
553 
554  dateFrom = new QDateTimeEdit(this);
555  dateFrom->setDisplayFormat("dd/MM/yy");
556  dateFrom->setCalendarPopup(true);
557  dateFrom->setMinimumWidth(100);
558  dateFrom->setDate(QDate::currentDate().addDays(-7));
559  layout->addWidget(dateFrom);
560  layout->addWidget(new QLabel(tr("to")));
561 
562  dateTo = new QDateTimeEdit(this);
563  dateTo->setDisplayFormat("dd/MM/yy");
564  dateTo->setCalendarPopup(true);
565  dateTo->setMinimumWidth(100);
566  dateTo->setDate(QDate::currentDate());
567  layout->addWidget(dateTo);
568  layout->addStretch();
569 
570  // Hide by default
571  dateRangeWidget->setVisible(false);
572 
573  // Notify on change
574  connect(dateFrom, &QDateTimeEdit::dateChanged, this, &TransactionView::dateRangeChanged);
575  connect(dateTo, &QDateTimeEdit::dateChanged, this, &TransactionView::dateRangeChanged);
576 
577  return dateRangeWidget;
578 }
579 
581 {
583  return;
585  QDateTime(dateFrom->date()),
586  QDateTime(dateTo->date()).addDays(1));
587 }
588 
589 void TransactionView::focusTransaction(const QModelIndex &idx)
590 {
592  return;
593  QModelIndex targetIdx = transactionProxyModel->mapFromSource(idx);
594  transactionView->scrollTo(targetIdx);
595  transactionView->setCurrentIndex(targetIdx);
596  transactionView->setFocus();
597 }
598 
600 {
602  return;
603 
604  const QModelIndexList results = this->model->getTransactionTableModel()->match(
605  this->model->getTransactionTableModel()->index(0,0),
607  QString::fromStdString(txid.ToString()), -1);
608 
609  transactionView->setFocus();
610  transactionView->selectionModel()->clearSelection();
611  for (const QModelIndex& index : results) {
612  const QModelIndex targetIndex = transactionProxyModel->mapFromSource(index);
613  transactionView->selectionModel()->select(
614  targetIndex,
615  QItemSelectionModel::Rows | QItemSelectionModel::Select);
616  // Called once per destination to ensure all results are in view, unless
617  // transactions are not ordered by (ascending or descending) date.
618  transactionView->scrollTo(targetIndex);
619  // scrollTo() does not scroll far enough the first time when transactions
620  // are ordered by ascending date.
621  if (index == results[0]) transactionView->scrollTo(targetIndex);
622  }
623 }
624 
625 // We override the virtual resizeEvent of the QWidget to adjust tables column
626 // sizes as the tables width is proportional to the dialogs width.
627 void TransactionView::resizeEvent(QResizeEvent* event)
628 {
629  QWidget::resizeEvent(event);
631 }
632 
633 // Need to override default Ctrl+C action for amount as default behaviour is just to copy DisplayRole text
634 bool TransactionView::eventFilter(QObject *obj, QEvent *event)
635 {
636  if (event->type() == QEvent::KeyPress)
637  {
638  QKeyEvent *ke = static_cast<QKeyEvent *>(event);
639  if (ke->key() == Qt::Key_C && ke->modifiers().testFlag(Qt::ControlModifier))
640  {
642  return true;
643  }
644  }
645  return QWidget::eventFilter(obj, event);
646 }
647 
648 // show/hide column Watch-only
649 void TransactionView::updateWatchOnlyColumn(bool fHaveWatchOnly)
650 {
651  watchOnlyWidget->setVisible(fHaveWatchOnly);
652  transactionView->setColumnHidden(TransactionTableModel::Watchonly, !fHaveWatchOnly);
653 }
uint8_t data[WIDTH]
Definition: uint256.h:21
bool eventFilter(QObject *obj, QEvent *event)
void addColumn(const QString &title, int column, int role=Qt::EditRole)
void openThirdPartyTxUrl(QString url)
interfaces::Wallet & wallet() const
Definition: walletmodel.h:147
QWidget * createDateRangeWidget()
QModelIndex index(int row, int column, const QModelIndex &parent) const
int lookupAddress(const QString &address) const
Dialog showing transaction details.
bool getUseExtraSpacing() const
Definition: platformstyle.h:22
QAction * abandonAction
void updateTransaction(const QString &hash, int status, bool showTransaction)
void focusTransaction(const QModelIndex &)
void setTypeFilter(quint32 modes)
QIcon SingleColorIcon(const QString &filename) const
Colorize an icon (given filename) with the icon color.
QTableView * transactionView
AddressTableModel * getAddressTableModel()
Export a Qt table model to a CSV file.
Transaction data, hex-encoded.
TransactionTableModel * parent
static bool parse(int unit, const QString &value, CAmount *val_out)
Parse string to coin amount.
void chooseWatchonly(int idx)
int getDisplayUnit() const
Definition: optionsmodel.h:81
static QString getAmountColumnTitle(int unit)
Gets title for amount column including current display unit if optionsModel reference available */...
bool bumpFee(uint256 hash, uint256 &new_hash)
static quint32 TYPE(int type)
int64_t CAmount
Amount in satoshis (Can be negative)
Definition: amount.h:12
QDateTimeEdit * dateTo
const char * url
Definition: rpcconsole.cpp:51
void setModel(AddressTableModel *model)
static const QDateTime MIN_DATE
Earliest date that can be represented (far in the past)
virtual void resizeEvent(QResizeEvent *event)
static const QDateTime MAX_DATE
Last date that can be represented (far in the future)
Whole transaction as plain text.
void setDateRange(const QDateTime &from, const QDateTime &to)
void message(const QString &title, const QString &message, unsigned int style)
Fired when a message should be reported to the user.
virtual bool transactionCanBeAbandoned(const uint256 &txid)=0
Return whether transaction can be abandoned.
Makes a QTableView last column feel as if it was being resized from its left border.
Definition: guiutil.h:161
Date and time this transaction was created.
std::string ToString() const
Definition: uint256.cpp:60
void updateWatchOnlyColumn(bool fHaveWatchOnly)
TransactionTableModel * getTransactionTableModel()
virtual bool transactionCanBeBumped(const uint256 &txid)=0
Return whether transaction can be bumped.
void setWatchOnlyFilter(WatchOnlyFilter filter)
Qt model of the address book in the core.
void setMinAmount(const CAmount &minimum)
void bumpedFee(const uint256 &txid)
TransactionFilterProxy * transactionProxyModel
QString getThirdPartyTxUrls() const
Definition: optionsmodel.h:82
QComboBox * watchOnlyWidget
256-bit opaque blob.
Definition: uint256.h:120
void chooseDate(int idx)
void setModel(const QAbstractItemModel *model)
void setModel(WalletModel *model)
QLineEdit * amountWidget
QComboBox * typeWidget
Filter the transaction list according to pre-specified rules.
void setAddress(const QString &address)
Interface to Bitcoin wallet from Qt view code.
Definition: walletmodel.h:50
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:258
static const QString Receive
Specifies receive address.
Dialog for editing an address and associated information.
QVariant data(const QModelIndex &index, int role) const
virtual bool haveWatchOnly()=0
Return whether wallet has watch only keys.
QFrame * dateRangeWidget
void notifyWatchonlyChanged(bool fHaveWatchonly)
Label of address related to transaction.
static const quint32 ALL_TYPES
Type filter bit field (all types)
void setSearchString(const QString &)
TransactionView(const PlatformStyle *platformStyle, QWidget *parent=nullptr)
void contextualMenu(const QPoint &)
Formatted amount, without brackets when unconfirmed.
void copyEntryData(QAbstractItemView *view, int column, int role)
Copy a field of the currently selected entry of a view to the clipboard.
Definition: guiutil.cpp:233
void chooseType(int idx)
QAction * bumpFeeAction
GUIUtil::TableViewLastColumnResizingFixer * columnResizingFixer
QDateTimeEdit * dateFrom
void SetHex(const char *psz)
Definition: uint256.cpp:26
TransactionRecord * index(interfaces::Wallet &wallet, int idx)
bool write()
Perform export of the model to CSV.
void doubleClicked(const QModelIndex &)
Type of address (Send or Receive)
WalletModel * model
OptionsModel * getOptionsModel()
virtual bool abandonTransaction(const uint256 &txid)=0
Abandon transaction.
Predefined combinations for certain default usage cases.
Definition: ui_interface.h:74
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
QComboBox * dateWidget
QLineEdit * search_widget