BSHA3  0.17.99
P2P Blockchain, based on Bitcoin
transactionview.cpp
Go to the documentation of this file.
1 // Copyright (c) 2011-2018 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>
13 #include <qt/sendcoinsdialog.h>
16 #include <qt/transactionrecord.h>
18 #include <qt/walletmodel.h>
19 
20 #include <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 <QSignalMapper>
35 #include <QTableView>
36 #include <QTimer>
37 #include <QUrl>
38 #include <QVBoxLayout>
39 
40 TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *parent) :
41  QWidget(parent), model(0), transactionProxyModel(0),
42  transactionView(0), abandonAction(0), bumpFeeAction(0), columnResizingFixer(0)
43 {
44  // Build filter row
45  setContentsMargins(0,0,0,0);
46 
47  QHBoxLayout *hlayout = new QHBoxLayout();
48  hlayout->setContentsMargins(0,0,0,0);
49 
50  if (platformStyle->getUseExtraSpacing()) {
51  hlayout->setSpacing(5);
52  hlayout->addSpacing(26);
53  } else {
54  hlayout->setSpacing(0);
55  hlayout->addSpacing(23);
56  }
57 
58  watchOnlyWidget = new QComboBox(this);
59  watchOnlyWidget->setFixedWidth(24);
61  watchOnlyWidget->addItem(platformStyle->SingleColorIcon(":/icons/eye_plus"), "", TransactionFilterProxy::WatchOnlyFilter_Yes);
62  watchOnlyWidget->addItem(platformStyle->SingleColorIcon(":/icons/eye_minus"), "", TransactionFilterProxy::WatchOnlyFilter_No);
63  hlayout->addWidget(watchOnlyWidget);
64 
65  dateWidget = new QComboBox(this);
66  if (platformStyle->getUseExtraSpacing()) {
67  dateWidget->setFixedWidth(121);
68  } else {
69  dateWidget->setFixedWidth(120);
70  }
71  dateWidget->addItem(tr("All"), All);
72  dateWidget->addItem(tr("Today"), Today);
73  dateWidget->addItem(tr("This week"), ThisWeek);
74  dateWidget->addItem(tr("This month"), ThisMonth);
75  dateWidget->addItem(tr("Last month"), LastMonth);
76  dateWidget->addItem(tr("This year"), ThisYear);
77  dateWidget->addItem(tr("Range..."), Range);
78  hlayout->addWidget(dateWidget);
79 
80  typeWidget = new QComboBox(this);
81  if (platformStyle->getUseExtraSpacing()) {
82  typeWidget->setFixedWidth(121);
83  } else {
84  typeWidget->setFixedWidth(120);
85  }
86 
87  typeWidget->addItem(tr("All"), TransactionFilterProxy::ALL_TYPES);
95 
96  hlayout->addWidget(typeWidget);
97 
98  search_widget = new QLineEdit(this);
99  search_widget->setPlaceholderText(tr("Enter address, transaction id, or label to search"));
100  hlayout->addWidget(search_widget);
101 
102  amountWidget = new QLineEdit(this);
103  amountWidget->setPlaceholderText(tr("Min amount"));
104  if (platformStyle->getUseExtraSpacing()) {
105  amountWidget->setFixedWidth(97);
106  } else {
107  amountWidget->setFixedWidth(100);
108  }
109  QDoubleValidator *amountValidator = new QDoubleValidator(0, 1e20, 8, this);
110  QLocale amountLocale(QLocale::C);
111  amountLocale.setNumberOptions(QLocale::RejectGroupSeparator);
112  amountValidator->setLocale(amountLocale);
113  amountWidget->setValidator(amountValidator);
114  hlayout->addWidget(amountWidget);
115 
116  // Delay before filtering transactions in ms
117  static const int input_filter_delay = 200;
118 
119  QTimer* amount_typing_delay = new QTimer(this);
120  amount_typing_delay->setSingleShot(true);
121  amount_typing_delay->setInterval(input_filter_delay);
122 
123  QTimer* prefix_typing_delay = new QTimer(this);
124  prefix_typing_delay->setSingleShot(true);
125  prefix_typing_delay->setInterval(input_filter_delay);
126 
127  QVBoxLayout *vlayout = new QVBoxLayout(this);
128  vlayout->setContentsMargins(0,0,0,0);
129  vlayout->setSpacing(0);
130 
131  QTableView *view = new QTableView(this);
132  vlayout->addLayout(hlayout);
133  vlayout->addWidget(createDateRangeWidget());
134  vlayout->addWidget(view);
135  vlayout->setSpacing(0);
136  int width = view->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  // Always show scroll bar
144  view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
145  view->setTabKeyNavigation(false);
146  view->setContextMenuPolicy(Qt::CustomContextMenu);
147 
148  view->installEventFilter(this);
149 
150  transactionView = view;
151  transactionView->setObjectName("transactionView");
152 
153  // Actions
154  abandonAction = new QAction(tr("Abandon transaction"), this);
155  bumpFeeAction = new QAction(tr("Increase transaction fee"), this);
156  bumpFeeAction->setObjectName("bumpFeeAction");
157  QAction *copyAddressAction = new QAction(tr("Copy address"), this);
158  QAction *copyLabelAction = new QAction(tr("Copy label"), this);
159  QAction *copyAmountAction = new QAction(tr("Copy amount"), this);
160  QAction *copyTxIDAction = new QAction(tr("Copy transaction ID"), this);
161  QAction *copyTxHexAction = new QAction(tr("Copy raw transaction"), this);
162  QAction *copyTxPlainText = new QAction(tr("Copy full transaction details"), this);
163  QAction *editLabelAction = new QAction(tr("Edit label"), this);
164  QAction *showDetailsAction = new QAction(tr("Show transaction details"), this);
165 
166  contextMenu = new QMenu(this);
167  contextMenu->setObjectName("contextMenu");
168  contextMenu->addAction(copyAddressAction);
169  contextMenu->addAction(copyLabelAction);
170  contextMenu->addAction(copyAmountAction);
171  contextMenu->addAction(copyTxIDAction);
172  contextMenu->addAction(copyTxHexAction);
173  contextMenu->addAction(copyTxPlainText);
174  contextMenu->addAction(showDetailsAction);
175  contextMenu->addSeparator();
176  contextMenu->addAction(bumpFeeAction);
177  contextMenu->addAction(abandonAction);
178  contextMenu->addAction(editLabelAction);
179 
180  mapperThirdPartyTxUrls = new QSignalMapper(this);
181 
182  // Connect actions
183  connect(mapperThirdPartyTxUrls, static_cast<void (QSignalMapper::*)(const QString&)>(&QSignalMapper::mapped), this, &TransactionView::openThirdPartyTxUrl);
184 
185  connect(dateWidget, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &TransactionView::chooseDate);
186  connect(typeWidget, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &TransactionView::chooseType);
187  connect(watchOnlyWidget, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &TransactionView::chooseWatchonly);
188  connect(amountWidget, &QLineEdit::textChanged, amount_typing_delay, static_cast<void (QTimer::*)()>(&QTimer::start));
189  connect(amount_typing_delay, &QTimer::timeout, this, &TransactionView::changedAmount);
190  connect(search_widget, &QLineEdit::textChanged, prefix_typing_delay, static_cast<void (QTimer::*)()>(&QTimer::start));
191  connect(prefix_typing_delay, &QTimer::timeout, this, &TransactionView::changedSearch);
192 
193  connect(view, &QTableView::doubleClicked, this, &TransactionView::doubleClicked);
194  connect(view, &QTableView::customContextMenuRequested, this, &TransactionView::contextualMenu);
195 
196  connect(bumpFeeAction, &QAction::triggered, this, &TransactionView::bumpFee);
197  connect(abandonAction, &QAction::triggered, this, &TransactionView::abandonTx);
198  connect(copyAddressAction, &QAction::triggered, this, &TransactionView::copyAddress);
199  connect(copyLabelAction, &QAction::triggered, this, &TransactionView::copyLabel);
200  connect(copyAmountAction, &QAction::triggered, this, &TransactionView::copyAmount);
201  connect(copyTxIDAction, &QAction::triggered, this, &TransactionView::copyTxID);
202  connect(copyTxHexAction, &QAction::triggered, this, &TransactionView::copyTxHex);
203  connect(copyTxPlainText, &QAction::triggered, this, &TransactionView::copyTxPlainText);
204  connect(editLabelAction, &QAction::triggered, this, &TransactionView::editLabel);
205  connect(showDetailsAction, &QAction::triggered, this, &TransactionView::showDetails);
206  // Double-clicking on a transaction on the transaction history page shows details
208  // Highlight transaction after fee bump
209  connect(this, &TransactionView::bumpedFee, [this](const uint256& txid) {
210  focusTransaction(txid);
211  });
212 }
213 
215 {
216  this->model = _model;
217  if(_model)
218  {
220  transactionProxyModel->setSourceModel(_model->getTransactionTableModel());
221  transactionProxyModel->setDynamicSortFilter(true);
222  transactionProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
223  transactionProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
224 
225  transactionProxyModel->setSortRole(Qt::EditRole);
226 
227  transactionView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
229  transactionView->setAlternatingRowColors(true);
230  transactionView->setSelectionBehavior(QAbstractItemView::SelectRows);
231  transactionView->setSelectionMode(QAbstractItemView::ExtendedSelection);
232  transactionView->setSortingEnabled(true);
233  transactionView->sortByColumn(TransactionTableModel::Date, Qt::DescendingOrder);
234  transactionView->verticalHeader()->hide();
235 
241 
243 
244  if (_model->getOptionsModel())
245  {
246  // Add third party transaction URLs to context menu
247  QStringList listUrls = _model->getOptionsModel()->getThirdPartyTxUrls().split("|", QString::SkipEmptyParts);
248  for (int i = 0; i < listUrls.size(); ++i)
249  {
250  QString host = QUrl(listUrls[i].trimmed(), QUrl::StrictMode).host();
251  if (!host.isEmpty())
252  {
253  QAction *thirdPartyTxUrlAction = new QAction(host, this); // use host as menu item label
254  if (i == 0)
255  contextMenu->addSeparator();
256  contextMenu->addAction(thirdPartyTxUrlAction);
257  connect(thirdPartyTxUrlAction, &QAction::triggered, mapperThirdPartyTxUrls, static_cast<void (QSignalMapper::*)()>(&QSignalMapper::map));
258  mapperThirdPartyTxUrls->setMapping(thirdPartyTxUrlAction, listUrls[i].trimmed());
259  }
260  }
261  }
262 
263  // show/hide column Watch-only
265 
266  // Watch-only signal
268  }
269 }
270 
272 {
273  if (!transactionProxyModel) return;
274  QDate current = QDate::currentDate();
275  dateRangeWidget->setVisible(false);
276  switch(dateWidget->itemData(idx).toInt())
277  {
278  case All:
282  break;
283  case Today:
285  QDateTime(current),
287  break;
288  case ThisWeek: {
289  // Find last Monday
290  QDate startOfWeek = current.addDays(-(current.dayOfWeek()-1));
292  QDateTime(startOfWeek),
294 
295  } break;
296  case ThisMonth:
298  QDateTime(QDate(current.year(), current.month(), 1)),
300  break;
301  case LastMonth:
303  QDateTime(QDate(current.year(), current.month(), 1).addMonths(-1)),
304  QDateTime(QDate(current.year(), current.month(), 1)));
305  break;
306  case ThisYear:
308  QDateTime(QDate(current.year(), 1, 1)),
310  break;
311  case Range:
312  dateRangeWidget->setVisible(true);
314  break;
315  }
316 }
317 
319 {
321  return;
323  typeWidget->itemData(idx).toInt());
324 }
325 
327 {
329  return;
331  static_cast<TransactionFilterProxy::WatchOnlyFilter>(watchOnlyWidget->itemData(idx).toInt()));
332 }
333 
335 {
337  return;
339 }
340 
342 {
344  return;
345  CAmount amount_parsed = 0;
346  if (BitcoinUnits::parse(model->getOptionsModel()->getDisplayUnit(), amountWidget->text(), &amount_parsed)) {
347  transactionProxyModel->setMinAmount(amount_parsed);
348  }
349  else
350  {
352  }
353 }
354 
356 {
357  if (!model || !model->getOptionsModel()) {
358  return;
359  }
360 
361  // CSV is currently the only supported format
362  QString filename = GUIUtil::getSaveFileName(this,
363  tr("Export Transaction History"), QString(),
364  tr("Comma separated file (*.csv)"), nullptr);
365 
366  if (filename.isNull())
367  return;
368 
369  CSVModelWriter writer(filename);
370 
371  // name, column, role
373  writer.addColumn(tr("Confirmed"), 0, TransactionTableModel::ConfirmedRole);
374  if (model->wallet().haveWatchOnly())
375  writer.addColumn(tr("Watch-only"), TransactionTableModel::Watchonly);
376  writer.addColumn(tr("Date"), 0, TransactionTableModel::DateRole);
377  writer.addColumn(tr("Type"), TransactionTableModel::Type, Qt::EditRole);
378  writer.addColumn(tr("Label"), 0, TransactionTableModel::LabelRole);
379  writer.addColumn(tr("Address"), 0, TransactionTableModel::AddressRole);
381  writer.addColumn(tr("ID"), 0, TransactionTableModel::TxHashRole);
382 
383  if(!writer.write()) {
384  Q_EMIT message(tr("Exporting Failed"), tr("There was an error trying to save the transaction history to %1.").arg(filename),
386  }
387  else {
388  Q_EMIT message(tr("Exporting Successful"), tr("The transaction history was successfully saved to %1.").arg(filename),
390  }
391 }
392 
393 void TransactionView::contextualMenu(const QPoint &point)
394 {
395  QModelIndex index = transactionView->indexAt(point);
396  QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);
397  if (selection.empty())
398  return;
399 
400  // check if transaction can be abandoned, disable context menu action in case it doesn't
401  uint256 hash;
402  hash.SetHex(selection.at(0).data(TransactionTableModel::TxHashRole).toString().toStdString());
403  abandonAction->setEnabled(model->wallet().transactionCanBeAbandoned(hash));
404  bumpFeeAction->setEnabled(model->wallet().transactionCanBeBumped(hash));
405 
406  if(index.isValid())
407  {
408  contextMenu->popup(transactionView->viewport()->mapToGlobal(point));
409  }
410 }
411 
413 {
414  if(!transactionView || !transactionView->selectionModel())
415  return;
416  QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);
417 
418  // get the hash from the TxHashRole (QVariant / QString)
419  uint256 hash;
420  QString hashQStr = selection.at(0).data(TransactionTableModel::TxHashRole).toString();
421  hash.SetHex(hashQStr.toStdString());
422 
423  // Abandon the wallet transaction over the walletModel
425 
426  // Update the table
428 }
429 
431 {
432  if(!transactionView || !transactionView->selectionModel())
433  return;
434  QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);
435 
436  // get the hash from the TxHashRole (QVariant / QString)
437  uint256 hash;
438  QString hashQStr = selection.at(0).data(TransactionTableModel::TxHashRole).toString();
439  hash.SetHex(hashQStr.toStdString());
440 
441  // Bump tx fee over the walletModel
442  uint256 newHash;
443  if (model->bumpFee(hash, newHash)) {
444  // Update the table
445  transactionView->selectionModel()->clearSelection();
447 
448  qApp->processEvents();
449  Q_EMIT bumpedFee(newHash);
450  }
451 }
452 
454 {
456 }
457 
459 {
461 }
462 
464 {
466 }
467 
469 {
471 }
472 
474 {
476 }
477 
479 {
481 }
482 
484 {
485  if(!transactionView->selectionModel() ||!model)
486  return;
487  QModelIndexList selection = transactionView->selectionModel()->selectedRows();
488  if(!selection.isEmpty())
489  {
490  AddressTableModel *addressBook = model->getAddressTableModel();
491  if(!addressBook)
492  return;
493  QString address = selection.at(0).data(TransactionTableModel::AddressRole).toString();
494  if(address.isEmpty())
495  {
496  // If this transaction has no associated address, exit
497  return;
498  }
499  // Is address in address book? Address book can miss address when a transaction is
500  // sent from outside the UI.
501  int idx = addressBook->lookupAddress(address);
502  if(idx != -1)
503  {
504  // Edit sending / receiving address
505  QModelIndex modelIdx = addressBook->index(idx, 0, QModelIndex());
506  // Determine type of address, launch appropriate editor dialog type
507  QString type = modelIdx.data(AddressTableModel::TypeRole).toString();
508 
509  EditAddressDialog dlg(
513  dlg.setModel(addressBook);
514  dlg.loadRow(idx);
515  dlg.exec();
516  }
517  else
518  {
519  // Add sending address
521  this);
522  dlg.setModel(addressBook);
523  dlg.setAddress(address);
524  dlg.exec();
525  }
526  }
527 }
528 
530 {
531  if(!transactionView->selectionModel())
532  return;
533  QModelIndexList selection = transactionView->selectionModel()->selectedRows();
534  if(!selection.isEmpty())
535  {
536  TransactionDescDialog *dlg = new TransactionDescDialog(selection.at(0));
537  dlg->setAttribute(Qt::WA_DeleteOnClose);
538  dlg->show();
539  }
540 }
541 
543 {
544  if(!transactionView || !transactionView->selectionModel())
545  return;
546  QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);
547  if(!selection.isEmpty())
548  QDesktopServices::openUrl(QUrl::fromUserInput(url.replace("%s", selection.at(0).data(TransactionTableModel::TxHashRole).toString())));
549 }
550 
552 {
553  dateRangeWidget = new QFrame();
554  dateRangeWidget->setFrameStyle(QFrame::Panel | QFrame::Raised);
555  dateRangeWidget->setContentsMargins(1,1,1,1);
556  QHBoxLayout *layout = new QHBoxLayout(dateRangeWidget);
557  layout->setContentsMargins(0,0,0,0);
558  layout->addSpacing(23);
559  layout->addWidget(new QLabel(tr("Range:")));
560 
561  dateFrom = new QDateTimeEdit(this);
562  dateFrom->setDisplayFormat("dd/MM/yy");
563  dateFrom->setCalendarPopup(true);
564  dateFrom->setMinimumWidth(100);
565  dateFrom->setDate(QDate::currentDate().addDays(-7));
566  layout->addWidget(dateFrom);
567  layout->addWidget(new QLabel(tr("to")));
568 
569  dateTo = new QDateTimeEdit(this);
570  dateTo->setDisplayFormat("dd/MM/yy");
571  dateTo->setCalendarPopup(true);
572  dateTo->setMinimumWidth(100);
573  dateTo->setDate(QDate::currentDate());
574  layout->addWidget(dateTo);
575  layout->addStretch();
576 
577  // Hide by default
578  dateRangeWidget->setVisible(false);
579 
580  // Notify on change
581  connect(dateFrom, &QDateTimeEdit::dateChanged, this, &TransactionView::dateRangeChanged);
582  connect(dateTo, &QDateTimeEdit::dateChanged, this, &TransactionView::dateRangeChanged);
583 
584  return dateRangeWidget;
585 }
586 
588 {
590  return;
592  QDateTime(dateFrom->date()),
593  QDateTime(dateTo->date()).addDays(1));
594 }
595 
596 void TransactionView::focusTransaction(const QModelIndex &idx)
597 {
599  return;
600  QModelIndex targetIdx = transactionProxyModel->mapFromSource(idx);
601  transactionView->scrollTo(targetIdx);
602  transactionView->setCurrentIndex(targetIdx);
603  transactionView->setFocus();
604 }
605 
607 {
609  return;
610 
611  const QModelIndexList results = this->model->getTransactionTableModel()->match(
612  this->model->getTransactionTableModel()->index(0,0),
614  QString::fromStdString(txid.ToString()), -1);
615 
616  transactionView->setFocus();
617  transactionView->selectionModel()->clearSelection();
618  for (const QModelIndex& index : results) {
619  const QModelIndex targetIndex = transactionProxyModel->mapFromSource(index);
620  transactionView->selectionModel()->select(
621  targetIndex,
622  QItemSelectionModel::Rows | QItemSelectionModel::Select);
623  // Called once per destination to ensure all results are in view, unless
624  // transactions are not ordered by (ascending or descending) date.
625  transactionView->scrollTo(targetIndex);
626  // scrollTo() does not scroll far enough the first time when transactions
627  // are ordered by ascending date.
628  if (index == results[0]) transactionView->scrollTo(targetIndex);
629  }
630 }
631 
632 // We override the virtual resizeEvent of the QWidget to adjust tables column
633 // sizes as the tables width is proportional to the dialogs width.
634 void TransactionView::resizeEvent(QResizeEvent* event)
635 {
636  QWidget::resizeEvent(event);
638 }
639 
640 // Need to override default Ctrl+C action for amount as default behaviour is just to copy DisplayRole text
641 bool TransactionView::eventFilter(QObject *obj, QEvent *event)
642 {
643  if (event->type() == QEvent::KeyPress)
644  {
645  QKeyEvent *ke = static_cast<QKeyEvent *>(event);
646  if (ke->key() == Qt::Key_C && ke->modifiers().testFlag(Qt::ControlModifier))
647  {
649  return true;
650  }
651  }
652  return QWidget::eventFilter(obj, event);
653 }
654 
655 // show/hide column Watch-only
656 void TransactionView::updateWatchOnlyColumn(bool fHaveWatchOnly)
657 {
658  watchOnlyWidget->setVisible(fHaveWatchOnly);
659  transactionView->setColumnHidden(TransactionTableModel::Watchonly, !fHaveWatchOnly);
660 }
uint8_t data[WIDTH]
Definition: uint256.h:23
TransactionView(const PlatformStyle *platformStyle, QWidget *parent=0)
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:219
QWidget * createDateRangeWidget()
QModelIndex index(int row, int column, const QModelIndex &parent) const
int lookupAddress(const QString &address) const
Dialog showing transaction details.
auto start
Definition: rpcwallet.cpp:1067
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:74
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:53
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.
QSignalMapper * mapperThirdPartyTxUrls
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:152
Date and time this transaction was created.
std::string ToString() const
Definition: uint256.cpp:62
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:75
QComboBox * watchOnlyWidget
256-bit opaque blob.
Definition: uint256.h:122
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:125
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:251
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 &)
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:231
void chooseType(int idx)
QAction * bumpFeeAction
GUIUtil::TableViewLastColumnResizingFixer * columnResizingFixer
QDateTimeEdit * dateFrom
void SetHex(const char *psz)
Definition: uint256.cpp:27
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:73
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
QComboBox * dateWidget
QLineEdit * search_widget