Raven Core  3.0.0
P2P Digital Currency
transactionview.cpp
Go to the documentation of this file.
1 // Copyright (c) 2011-2016 The Bitcoin Core developers
2 // Copyright (c) 2017-2019 The Raven Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #include "transactionview.h"
7 
8 #include "addresstablemodel.h"
9 #include "ravenunits.h"
10 #include "csvmodelwriter.h"
11 #include "editaddressdialog.h"
12 #include "guiutil.h"
13 #include "optionsmodel.h"
14 #include "platformstyle.h"
15 #include "sendcoinsdialog.h"
16 #include "transactiondescdialog.h"
17 #include "transactionfilterproxy.h"
18 #include "transactionrecord.h"
19 #include "transactiontablemodel.h"
20 #include "validation.h"
21 #include "walletmodel.h"
22 #include "guiconstants.h"
23 
24 #include "ui_interface.h"
25 
26 #include <QComboBox>
27 #include <QDateTimeEdit>
28 #include <QDesktopServices>
29 #include <QDoubleValidator>
30 #include <QHBoxLayout>
31 #include <QHeaderView>
32 #include <QLabel>
33 #include <QLineEdit>
34 #include <QMenu>
35 #include <QPoint>
36 #include <QScrollBar>
37 #include <QSignalMapper>
38 #include <QTableView>
39 #include <QTimer>
40 #include <QUrl>
41 #include <QVBoxLayout>
42 #include <QGraphicsDropShadowEffect>
43 
44 TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *parent) :
45  QWidget(parent), model(0), transactionProxyModel(0),
46  transactionView(0), abandonAction(0), bumpFeeAction(0), columnResizingFixer(0)
47 {
48  // Build filter row
49  setContentsMargins(0,0,0,0);
50 
51  QHBoxLayout *hlayout = new QHBoxLayout();
52  hlayout->setContentsMargins(0,0,0,0);
53 
54  if (platformStyle->getUseExtraSpacing()) {
55  hlayout->setSpacing(5);
56  hlayout->addSpacing(26);
57  } else {
58  hlayout->setSpacing(0);
59  hlayout->addSpacing(23);
60  }
61 
62  watchOnlyWidget = new QComboBox(this);
63  watchOnlyWidget->setFixedWidth(24);
65  watchOnlyWidget->addItem(platformStyle->SingleColorIcon(":/icons/eye_plus"), "", TransactionFilterProxy::WatchOnlyFilter_Yes);
66  watchOnlyWidget->addItem(platformStyle->SingleColorIcon(":/icons/eye_minus"), "", TransactionFilterProxy::WatchOnlyFilter_No);
67  hlayout->addWidget(watchOnlyWidget);
68 
69  dateWidget = new QComboBox(this);
70  if (platformStyle->getUseExtraSpacing()) {
71  dateWidget->setFixedWidth(121);
72  } else {
73  dateWidget->setFixedWidth(120);
74  }
75  dateWidget->addItem(tr("All"), All);
76  dateWidget->addItem(tr("Today"), Today);
77  dateWidget->addItem(tr("This week"), ThisWeek);
78  dateWidget->addItem(tr("This month"), ThisMonth);
79  dateWidget->addItem(tr("Last month"), LastMonth);
80  dateWidget->addItem(tr("This year"), ThisYear);
81  dateWidget->addItem(tr("Range..."), Range);
82  hlayout->addWidget(dateWidget);
83 
84  typeWidget = new QComboBox(this);
85  if (platformStyle->getUseExtraSpacing()) {
86  typeWidget->setFixedWidth(121);
87  } else {
88  typeWidget->setFixedWidth(120);
89  }
90 
91  typeWidget->addItem(tr("All"), TransactionFilterProxy::ALL_TYPES);
99 
100  hlayout->addWidget(typeWidget);
101 
102  addressWidget = new QLineEdit(this);
103 #if QT_VERSION >= 0x040700
104  addressWidget->setPlaceholderText(tr("Enter address or label to search"));
105 #endif
106  hlayout->addWidget(addressWidget);
107 
108  amountWidget = new QLineEdit(this);
109 #if QT_VERSION >= 0x040700
110  amountWidget->setPlaceholderText(tr("Min amount"));
111 #endif
112  if (platformStyle->getUseExtraSpacing()) {
113  amountWidget->setFixedWidth(97);
114  } else {
115  amountWidget->setFixedWidth(100);
116  }
117  amountWidget->setValidator(new QDoubleValidator(0, 1e20, 8, this));
118  hlayout->addWidget(amountWidget);
119 
120  assetNameWidget = new QLineEdit(this);
121 #if QT_VERSION >= 0x040700
122  assetNameWidget->setPlaceholderText(tr("Asset name"));
123 #endif
124  assetNameWidget->setFixedWidth(200);
125  hlayout->addWidget(assetNameWidget);
126  assetNameWidget->hide();
127 
128  // Delay before filtering transactions in ms
129  static const int input_filter_delay = 200;
130 
131  QTimer* amount_typing_delay = new QTimer(this);
132  amount_typing_delay->setSingleShot(true);
133  amount_typing_delay->setInterval(input_filter_delay);
134 
135  QTimer* prefix_typing_delay = new QTimer(this);
136  prefix_typing_delay->setSingleShot(true);
137  prefix_typing_delay->setInterval(input_filter_delay);
138 
139  QTimer *asset_typing_delay;
140  asset_typing_delay = new QTimer(this);
141  asset_typing_delay->setSingleShot(true);
142  asset_typing_delay->setInterval(input_filter_delay);
143 
144  QVBoxLayout *vlayout = new QVBoxLayout(this);
145  vlayout->setContentsMargins(0,0,0,0);
146  vlayout->setSpacing(0);
147 
148  QTableView *view = new QTableView(this);
149  vlayout->addLayout(hlayout);
150  vlayout->addWidget(createDateRangeWidget());
151  vlayout->addWidget(view);
152  vlayout->setSpacing(0);
153  int width = view->verticalScrollBar()->sizeHint().width();
154  // Cover scroll bar width with spacing
155  if (platformStyle->getUseExtraSpacing()) {
156  hlayout->addSpacing(width+2);
157  } else {
158  hlayout->addSpacing(width);
159  }
160  // Always show scroll bar
161  view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
162  view->setTabKeyNavigation(false);
163  view->setContextMenuPolicy(Qt::CustomContextMenu);
164 
165  view->installEventFilter(this);
166  view->setStyleSheet(".QTableView { border: none;}");
167 
168  transactionView = view;
169  transactionView->setObjectName("transactionView");
170 
171 
172  // Actions
173  abandonAction = new QAction(tr("Abandon transaction"), this);
174 // bumpFeeAction = new QAction(tr("Increase transaction fee"), this);
175 // bumpFeeAction->setObjectName("bumpFeeAction");
176  QAction *copyAddressAction = new QAction(tr("Copy address"), this);
177  QAction *copyLabelAction = new QAction(tr("Copy label"), this);
178  QAction *copyAmountAction = new QAction(tr("Copy amount"), this);
179  QAction *copyTxIDAction = new QAction(tr("Copy transaction ID"), this);
180  QAction *copyTxHexAction = new QAction(tr("Copy raw transaction"), this);
181  QAction *copyTxPlainText = new QAction(tr("Copy full transaction details"), this);
182  QAction *editLabelAction = new QAction(tr("Edit label"), this);
183  QAction *showDetailsAction = new QAction(tr("Show transaction details"), this);
184 
185  contextMenu = new QMenu(this);
186  contextMenu->setObjectName("contextMenu");
187  contextMenu->addAction(copyAddressAction);
188  contextMenu->addAction(copyLabelAction);
189  contextMenu->addAction(copyAmountAction);
190  contextMenu->addAction(copyTxIDAction);
191  contextMenu->addAction(copyTxHexAction);
192  contextMenu->addAction(copyTxPlainText);
193  contextMenu->addAction(showDetailsAction);
194  contextMenu->addSeparator();
195 // contextMenu->addAction(bumpFeeAction);
196  contextMenu->addAction(abandonAction);
197  contextMenu->addAction(editLabelAction);
198 
199  mapperThirdPartyTxUrls = new QSignalMapper(this);
200 
201  // Connect actions
202  connect(mapperThirdPartyTxUrls, SIGNAL(mapped(QString)), this, SLOT(openThirdPartyTxUrl(QString)));
203 
204  connect(dateWidget, SIGNAL(activated(int)), this, SLOT(chooseDate(int)));
205  connect(typeWidget, SIGNAL(activated(int)), this, SLOT(chooseType(int)));
206  connect(watchOnlyWidget, SIGNAL(activated(int)), this, SLOT(chooseWatchonly(int)));
207  connect(amountWidget, SIGNAL(textChanged(QString)), amount_typing_delay, SLOT(start()));
208  connect(amount_typing_delay, SIGNAL(timeout()), this, SLOT(changedAmount()));
209  connect(assetNameWidget, SIGNAL(textChanged(QString)), asset_typing_delay, SLOT(start()));
210  connect(asset_typing_delay, SIGNAL(timeout()), this, SLOT(changedAssetName()));
211  connect(addressWidget, SIGNAL(textChanged(QString)), prefix_typing_delay, SLOT(start()));
212  connect(prefix_typing_delay, SIGNAL(timeout()), this, SLOT(changedPrefix()));
213 
214  connect(view, SIGNAL(doubleClicked(QModelIndex)), this, SIGNAL(doubleClicked(QModelIndex)));
215  connect(view, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint)));
216 
217 // connect(bumpFeeAction, SIGNAL(triggered()), this, SLOT(bumpFee()));
218  connect(abandonAction, SIGNAL(triggered()), this, SLOT(abandonTx()));
219  connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(copyAddress()));
220  connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(copyLabel()));
221  connect(copyAmountAction, SIGNAL(triggered()), this, SLOT(copyAmount()));
222  connect(copyTxIDAction, SIGNAL(triggered()), this, SLOT(copyTxID()));
223  connect(copyTxHexAction, SIGNAL(triggered()), this, SLOT(copyTxHex()));
224  connect(copyTxPlainText, SIGNAL(triggered()), this, SLOT(copyTxPlainText()));
225  connect(editLabelAction, SIGNAL(triggered()), this, SLOT(editLabel()));
226  connect(showDetailsAction, SIGNAL(triggered()), this, SLOT(showDetails()));
227 
228  // Trigger the call to show the assets table if assets are active
229  showingAssets = false;
230  showAssets();
231 
239 
240 }
241 
243 {
244  this->model = _model;
245  if(_model)
246  {
248  transactionProxyModel->setSourceModel(_model->getTransactionTableModel());
249  transactionProxyModel->setDynamicSortFilter(true);
250  transactionProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
251  transactionProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
252 
253  transactionProxyModel->setSortRole(Qt::EditRole);
254 
255  transactionView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
257  transactionView->setAlternatingRowColors(true);
258  transactionView->setSelectionBehavior(QAbstractItemView::SelectRows);
259  transactionView->setSelectionMode(QAbstractItemView::ExtendedSelection);
260  transactionView->setSortingEnabled(true);
261  transactionView->sortByColumn(TransactionTableModel::Date, Qt::DescendingOrder);
262  transactionView->verticalHeader()->hide();
263 
270 
272 
273  if (_model->getOptionsModel())
274  {
275  // Add third party transaction URLs to context menu
276  QStringList listUrls = _model->getOptionsModel()->getThirdPartyTxUrls().split("|", QString::SkipEmptyParts);
277  for (int i = 0; i < listUrls.size(); ++i)
278  {
279  QString host = QUrl(listUrls[i].trimmed(), QUrl::StrictMode).host();
280  if (!host.isEmpty())
281  {
282  QAction *thirdPartyTxUrlAction = new QAction(host, this); // use host as menu item label
283  if (i == 0)
284  contextMenu->addSeparator();
285  contextMenu->addAction(thirdPartyTxUrlAction);
286  connect(thirdPartyTxUrlAction, SIGNAL(triggered()), mapperThirdPartyTxUrls, SLOT(map()));
287  mapperThirdPartyTxUrls->setMapping(thirdPartyTxUrlAction, listUrls[i].trimmed());
288  }
289  }
290  }
291 
292  // show/hide column Watch-only
294 
295  // Watch-only signal
296  connect(_model, SIGNAL(notifyWatchonlyChanged(bool)), this, SLOT(updateWatchOnlyColumn(bool)));
297  }
298 }
299 
301 {
303  return;
304  QDate current = QDate::currentDate();
305  dateRangeWidget->setVisible(false);
306  switch(dateWidget->itemData(idx).toInt())
307  {
308  case All:
312  break;
313  case Today:
315  QDateTime(current),
317  break;
318  case ThisWeek: {
319  // Find last Monday
320  QDate startOfWeek = current.addDays(-(current.dayOfWeek()-1));
322  QDateTime(startOfWeek),
324 
325  } break;
326  case ThisMonth:
328  QDateTime(QDate(current.year(), current.month(), 1)),
330  break;
331  case LastMonth:
333  QDateTime(QDate(current.year(), current.month(), 1).addMonths(-1)),
334  QDateTime(QDate(current.year(), current.month(), 1)));
335  break;
336  case ThisYear:
338  QDateTime(QDate(current.year(), 1, 1)),
340  break;
341  case Range:
342  dateRangeWidget->setVisible(true);
344  break;
345  }
346 }
347 
349 {
351  return;
353  typeWidget->itemData(idx).toInt());
354 }
355 
357 {
359  return;
362 }
363 
365 {
367  return;
369 }
370 
372 {
374  return;
375  CAmount amount_parsed = 0;
376  if (RavenUnits::parse(model->getOptionsModel()->getDisplayUnit(), amountWidget->text(), &amount_parsed)) {
377  transactionProxyModel->setMinAmount(amount_parsed);
378  }
379  else
380  {
382  }
383 }
384 
386 {
388  return;
390 }
391 
393 {
394  if (!model || !model->getOptionsModel()) {
395  return;
396  }
397 
398  // CSV is currently the only supported format
399  QString filename = GUIUtil::getSaveFileName(this,
400  tr("Export Transaction History"), QString(),
401  tr("Comma separated file (*.csv)"), nullptr);
402 
403  if (filename.isNull())
404  return;
405 
406  CSVModelWriter writer(filename);
407 
408  // name, column, role
410  writer.addColumn(tr("Confirmed"), 0, TransactionTableModel::ConfirmedRole);
411  if (model && model->haveWatchOnly())
412  writer.addColumn(tr("Watch-only"), TransactionTableModel::Watchonly);
413  writer.addColumn(tr("Date"), 0, TransactionTableModel::DateRole);
414  writer.addColumn(tr("Type"), TransactionTableModel::Type, Qt::EditRole);
415  writer.addColumn(tr("Label"), 0, TransactionTableModel::LabelRole);
416  writer.addColumn(tr("Address"), 0, TransactionTableModel::AddressRole);
418  if (AreAssetsDeployed()) {
419  writer.addColumn(tr("Asset"), 0, TransactionTableModel::AssetNameRole);
420  }
421  writer.addColumn(tr("ID"), 0, TransactionTableModel::TxIDRole);
422 
423  if(!writer.write()) {
424  Q_EMIT message(tr("Exporting Failed"), tr("There was an error trying to save the transaction history to %1.").arg(filename),
426  }
427  else {
428  Q_EMIT message(tr("Exporting Successful"), tr("The transaction history was successfully saved to %1.").arg(filename),
430  }
431 }
432 
434 {
435  if (AreAssetsDeployed() && !showingAssets) {
437  typeWidget->addItem(tr("Asset Reissued"), TransactionFilterProxy::TYPE(TransactionRecord::Reissue));
440 
441  assetNameWidget->show();
442 
443  QAction *copyAssetNameAction = new QAction(tr("Copy asset name"), this);
444  contextMenu->addAction(copyAssetNameAction);
445  connect(copyAssetNameAction, SIGNAL(triggered()), this, SLOT(copyAssetName()));
446 
447  showingAssets = true;
448  }
449 
450  if (!AreAssetsDeployed())
451  {
452  assetNameWidget->hide();
453  }
454 }
455 
456 void TransactionView::contextualMenu(const QPoint &point)
457 {
458  QModelIndex index = transactionView->indexAt(point);
459  QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);
460  if (selection.empty())
461  return;
462 
463  // check if transaction can be abandoned, disable context menu action in case it doesn't
464  uint256 hash;
465  hash.SetHex(selection.at(0).data(TransactionTableModel::TxHashRole).toString().toStdString());
466  abandonAction->setEnabled(model->transactionCanBeAbandoned(hash));
467 // bumpFeeAction->setEnabled(model->transactionCanBeBumped(hash));
468 
469  if(index.isValid())
470  {
471  contextMenu->popup(transactionView->viewport()->mapToGlobal(point));
472  }
473 }
474 
476 {
477  if(!transactionView || !transactionView->selectionModel())
478  return;
479  QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);
480 
481  // get the hash from the TxHashRole (QVariant / QString)
482  uint256 hash;
483  QString hashQStr = selection.at(0).data(TransactionTableModel::TxHashRole).toString();
484  hash.SetHex(hashQStr.toStdString());
485 
486  // Abandon the wallet transaction over the walletModel
487  model->abandonTransaction(hash);
488 
489  // Update the table
491 }
492 
494 {
495  if(!transactionView || !transactionView->selectionModel())
496  return;
497  QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);
498 
499  // get the hash from the TxHashRole (QVariant / QString)
500  uint256 hash;
501  QString hashQStr = selection.at(0).data(TransactionTableModel::TxHashRole).toString();
502  hash.SetHex(hashQStr.toStdString());
503 
504  // Bump tx fee over the walletModel
505  if (model->bumpFee(hash)) {
506  // Update the table
508  }
509 }
510 
512 {
514 }
515 
517 {
519 }
520 
522 {
524 }
525 
527 {
529 }
530 
532 {
534 }
535 
537 {
539 }
540 
542 {
544 }
545 
547 {
548  if(!transactionView->selectionModel() ||!model)
549  return;
550  QModelIndexList selection = transactionView->selectionModel()->selectedRows();
551  if(!selection.isEmpty())
552  {
553  AddressTableModel *addressBook = model->getAddressTableModel();
554  if(!addressBook)
555  return;
556  QString address = selection.at(0).data(TransactionTableModel::AddressRole).toString();
557  if(address.isEmpty())
558  {
559  // If this transaction has no associated address, exit
560  return;
561  }
562  // Is address in address book? Address book can miss address when a transaction is
563  // sent from outside the UI.
564  int idx = addressBook->lookupAddress(address);
565  if(idx != -1)
566  {
567  // Edit sending / receiving address
568  QModelIndex modelIdx = addressBook->index(idx, 0, QModelIndex());
569  // Determine type of address, launch appropriate editor dialog type
570  QString type = modelIdx.data(AddressTableModel::TypeRole).toString();
571 
572  EditAddressDialog dlg(
576  dlg.setModel(addressBook);
577  dlg.loadRow(idx);
578  dlg.exec();
579  }
580  else
581  {
582  // Add sending address
584  this);
585  dlg.setModel(addressBook);
586  dlg.setAddress(address);
587  dlg.exec();
588  }
589  }
590 }
591 
593 {
594  if(!transactionView->selectionModel())
595  return;
596  QModelIndexList selection = transactionView->selectionModel()->selectedRows();
597  if(!selection.isEmpty())
598  {
599  TransactionDescDialog *dlg = new TransactionDescDialog(selection.at(0));
600  dlg->setAttribute(Qt::WA_DeleteOnClose);
601  dlg->show();
602  }
603 }
604 
606 {
607  if(!transactionView || !transactionView->selectionModel())
608  return;
609  QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);
610  if(!selection.isEmpty())
611  QDesktopServices::openUrl(QUrl::fromUserInput(url.replace("%s", selection.at(0).data(TransactionTableModel::TxHashRole).toString())));
612 }
613 
615 {
616  dateRangeWidget = new QFrame();
617  dateRangeWidget->setFrameStyle(QFrame::Panel | QFrame::Raised);
618  dateRangeWidget->setContentsMargins(1,1,1,1);
619  QHBoxLayout *layout = new QHBoxLayout(dateRangeWidget);
620  layout->setContentsMargins(0,0,0,0);
621  layout->addSpacing(23);
622  layout->addWidget(new QLabel(tr("Range:")));
623 
624  dateFrom = new QDateTimeEdit(this);
625  dateFrom->setDisplayFormat("dd/MM/yy");
626  dateFrom->setCalendarPopup(true);
627  dateFrom->setMinimumWidth(100);
628  dateFrom->setDate(QDate::currentDate().addDays(-7));
629  layout->addWidget(dateFrom);
630  layout->addWidget(new QLabel(tr("to")));
631 
632  dateTo = new QDateTimeEdit(this);
633  dateTo->setDisplayFormat("dd/MM/yy");
634  dateTo->setCalendarPopup(true);
635  dateTo->setMinimumWidth(100);
636  dateTo->setDate(QDate::currentDate());
637  layout->addWidget(dateTo);
638  layout->addStretch();
639 
640  // Hide by default
641  dateRangeWidget->setVisible(false);
642 
643  // Notify on change
644  connect(dateFrom, SIGNAL(dateChanged(QDate)), this, SLOT(dateRangeChanged()));
645  connect(dateTo, SIGNAL(dateChanged(QDate)), this, SLOT(dateRangeChanged()));
646 
647  return dateRangeWidget;
648 }
649 
651 {
653  return;
655  QDateTime(dateFrom->date()),
656  QDateTime(dateTo->date()).addDays(1));
657 }
658 
659 void TransactionView::focusTransaction(const QModelIndex &idx)
660 {
662  return;
663  QModelIndex targetIdx = transactionProxyModel->mapFromSource(idx);
664  transactionView->scrollTo(targetIdx);
665  transactionView->setCurrentIndex(targetIdx);
666  transactionView->setFocus();
667 }
668 
669 // We override the virtual resizeEvent of the QWidget to adjust tables column
670 // sizes as the tables width is proportional to the dialogs width.
671 void TransactionView::resizeEvent(QResizeEvent* event)
672 {
673  QWidget::resizeEvent(event);
675 }
676 
677 // Need to override default Ctrl+C action for amount as default behaviour is just to copy DisplayRole text
678 bool TransactionView::eventFilter(QObject *obj, QEvent *event)
679 {
680  if (event->type() == QEvent::KeyPress)
681  {
682  QKeyEvent *ke = static_cast<QKeyEvent *>(event);
683  if (ke->key() == Qt::Key_C && ke->modifiers().testFlag(Qt::ControlModifier))
684  {
686  return true;
687  }
688  }
689  return QWidget::eventFilter(obj, event);
690 }
691 
692 // show/hide column Watch-only
693 void TransactionView::updateWatchOnlyColumn(bool fHaveWatchOnly)
694 {
695  watchOnlyWidget->setVisible(fHaveWatchOnly);
696  transactionView->setColumnHidden(TransactionTableModel::Watchonly, !fHaveWatchOnly);
697 }
bool abandonTransaction(uint256 hash) const
uint8_t data[WIDTH]
Definition: uint256.h:24
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)
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:25
QAction * abandonAction
bool bumpFee(uint256 hash)
void updateTransaction(const QString &hash, int status, bool showTransaction)
void focusTransaction(const QModelIndex &)
QLineEdit * assetNameWidget
TransactionRecord * index(int idx)
void setTypeFilter(quint32 modes)
bool transactionCanBeAbandoned(uint256 hash) const
QIcon SingleColorIcon(const QString &filename) const
Colorize an icon (given filename) with the icon color.
QTableView * transactionView
static QString getAmountColumnTitle(int unit)
Gets title for amount column including current display unit if optionsModel reference available */...
Definition: ravenunits.cpp:242
AddressTableModel * getAddressTableModel()
Export a Qt table model to a CSV file.
Transaction data, hex-encoded.
TransactionTableModel * parent
bool haveWatchOnly() const
Definition: walletmodel.cpp:92
static bool parse(int unit, const QString &value, CAmount *val_out)
Parse string to coin amount.
Definition: ravenunits.cpp:164
void chooseWatchonly(int idx)
int getDisplayUnit() const
Definition: optionsmodel.h:68
void setAddressPrefix(const QString &addrPrefix)
static quint32 TYPE(int type)
int64_t CAmount
Amount in corbies (Can be negative)
Definition: amount.h:13
QDateTimeEdit * dateTo
const char * url
Definition: rpcconsole.cpp:65
QFont getSubLabelFont()
Definition: guiutil.cpp:86
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)
bool AreAssetsDeployed()
RVN START.
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.
Makes a QTableView last column feel as if it was being resized from its left border.
Definition: guiutil.h:167
Date and time this transaction was created.
void updateWatchOnlyColumn(bool fHaveWatchOnly)
TransactionTableModel * getTransactionTableModel()
void setWatchOnlyFilter(WatchOnlyFilter filter)
Qt model of the address book in the core.
void setMinAmount(const CAmount &minimum)
TransactionFilterProxy * transactionProxyModel
QString getThirdPartyTxUrls() const
Definition: optionsmodel.h:69
QComboBox * watchOnlyWidget
256-bit opaque blob.
Definition: uint256.h:123
void chooseDate(int idx)
void setModel(const QAbstractItemModel *model)
void setModel(WalletModel *model)
QLineEdit * amountWidget
void setAssetNamePrefix(const QString &assetNamePrefix)
QComboBox * typeWidget
Filter the transaction list according to pre-specified rules.
void setAddress(const QString &address)
Interface to Raven wallet from Qt view code.
Definition: walletmodel.h:165
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:375
static const QString Receive
Specifies receive address.
Dialog for editing an address and associated information.
QVariant data(const QModelIndex &index, int role) const
QFrame * dateRangeWidget
Label of address related to transaction.
static const quint32 ALL_TYPES
Type filter bit field (all types)
QLineEdit * addressWidget
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:355
void chooseType(int idx)
GUIUtil::TableViewLastColumnResizingFixer * columnResizingFixer
QDateTimeEdit * dateFrom
void SetHex(const char *psz)
Definition: uint256.cpp:28
bool write()
Perform export of the model to CSV.
void doubleClicked(const QModelIndex &)
Type of address (Send or Receive)
WalletModel * model
OptionsModel * getOptionsModel()
Predefined combinations for certain default usage cases.
Definition: ui_interface.h:70
QComboBox * dateWidget