22#include <QDateTimeEdit>
23#include <QDesktopServices>
24#include <QDoubleValidator>
44 hlayout->setContentsMargins(0, 0, 0, 0);
106 tr(
"Enter address, transaction id, or label to search"));
118 amountLocale.setNumberOptions(QLocale::RejectGroupSeparator);
135 vlayout->setContentsMargins(0, 0, 0, 0);
143 int width =
view->verticalScrollBar()->sizeHint().width();
151 view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
152 view->setTabKeyNavigation(
false);
153 view->setContextMenuPolicy(Qt::CustomContextMenu);
155 view->installEventFilter(
this);
167 new QAction(
tr(
"Copy full transaction details"),
this);
170 new QAction(
tr(
"Show transaction details"),
this);
185 static_cast<void (QComboBox::*)(
int)
>(&QComboBox::activated),
this,
188 static_cast<void (QComboBox::*)(
int)
>(&QComboBox::activated),
this,
191 static_cast<void (QComboBox::*)(
int)
>(&QComboBox::activated),
this,
194 static_cast<void (
QTimer::*)()
>(&QTimer::start));
198 static_cast<void (
QTimer::*)()
>(&QTimer::start));
204 connect(
view, &QTableView::customContextMenuRequested,
this,
236 _model->getTransactionTableModel());
247 transactionView->setSelectionMode(QAbstractItemView::ExtendedSelection);
268 if (
_model->getOptionsModel()) {
271 _model->getOptionsModel()->getThirdPartyTxUrls(),
"|");
272 for (
int i = 0; i <
listUrls.size(); ++i) {
275 if (!host.isEmpty()) {
304#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
401 this,
tr(
"Export Transaction History"),
QString(),
402 tr(
"Comma separated file (*.csv)"),
nullptr);
404 if (filename.isNull()) {
427 tr(
"There was an error trying to save the transaction "
433 tr(
"Exporting Successful"),
434 tr(
"The transaction history was successfully saved to %1.")
461 if (index.isValid()) {
534 if (address.isEmpty()) {
559 dlg.setAddress(address);
574 dlg->setAttribute(Qt::WA_DeleteOnClose);
587 QDesktopServices::openUrl(QUrl::fromUserInput(
599 layout->setContentsMargins(0, 0, 0, 0);
601 layout->addWidget(
new QLabel(
tr(
"Range:")));
604 dateFrom->setDisplayFormat(
"dd/MM/yy");
609 layout->addWidget(
new QLabel(
tr(
"to")));
612 dateTo->setDisplayFormat(
"dd/MM/yy");
613 dateTo->setCalendarPopup(
true);
614 dateTo->setMinimumWidth(100);
615 dateTo->setDate(QDate::currentDate());
636#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
667 QString::fromStdString(txid.
ToString()), -1);
676 QItemSelectionModel::Rows | QItemSelectionModel::Select);
691 QWidget::resizeEvent(event);
698 if (event->type() == QEvent::KeyPress) {
700 if (
ke->key() == Qt::Key_C &&
701 ke->modifiers().testFlag(Qt::ControlModifier)) {
707 return QWidget::eventFilter(
obj, event);
Qt model of the address book in the core.
@ TypeRole
Type of address (Send or Receive)
QVariant data(const QModelIndex &index, int role) const override
static const QString Receive
Specifies receive address.
static bool parse(int unit, const QString &value, Amount *val_out)
Parse string to coin amount.
static QString getAmountColumnTitle(int unit)
Gets title for amount column including current display unit if optionsModel reference available */.
@ MSG_INFORMATION
Predefined combinations for certain default usage cases.
Export a Qt table model to a CSV file.
Dialog for editing an address and associated information.
void setModel(AddressTableModel *model)
Makes a QTableView last column feel as if it was being resized from its left border.
void stretchColumnWidth(int column)
int getDisplayUnit() const
Dialog showing transaction details.
Filter the transaction list according to pre-specified rules.
static const QDateTime MAX_DATE
Last date that can be represented (far in the future).
void setWatchOnlyFilter(WatchOnlyFilter filter)
static const quint32 ALL_TYPES
Type filter bit field (all types).
static quint32 TYPE(int type)
static const QDateTime MIN_DATE
Earliest date that can be represented (far in the past).
void setSearchString(const QString &)
void setMinAmount(const Amount minimum)
void setDateRange(const QDateTime &from, const QDateTime &to)
void setTypeFilter(quint32 modes)
@ TxPlainTextRole
Whole transaction as plain text.
@ LabelRole
Label of address related to transaction.
@ DateRole
Date and time this transaction was created.
@ TxHashRole
Transaction hash.
@ TxHexRole
Transaction data, hex-encoded.
@ TxIDRole
Unique identifier.
@ AddressRole
Address of transaction.
@ ConfirmedRole
Is transaction confirmed?
@ FormattedAmountRole
Formatted amount, without brackets when unconfirmed.
void updateTransaction(const QString &hash, int status, bool showTransaction)
New transaction, or transaction changed status.
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
void chooseWatchonly(int idx)
TransactionView(const PlatformStyle *platformStyle, QWidget *parent=nullptr)
QLineEdit * search_widget
bool eventFilter(QObject *obj, QEvent *event) override
@ AMOUNT_MINIMUM_COLUMN_WIDTH
QWidget * createDateRangeWidget()
void setModel(WalletModel *model)
GUIUtil::TableViewLastColumnResizingFixer * columnResizingFixer
void updateWatchOnlyColumn(bool fHaveWatchOnly)
void message(const QString &title, const QString &message, unsigned int style)
Fired when a message should be reported to the user.
virtual void resizeEvent(QResizeEvent *event) override
QComboBox * watchOnlyWidget
TransactionFilterProxy * transactionProxyModel
QTableView * transactionView
void focusTransaction(const QModelIndex &)
void contextualMenu(const QPoint &)
QAction * copyAddressAction
void openThirdPartyTxUrl(QString url)
QAction * copyLabelAction
void doubleClicked(const QModelIndex &)
Interface to Bitcoin wallet from Qt view code.
void notifyWatchonlyChanged(bool fHaveWatchonly)
AddressTableModel * getAddressTableModel()
OptionsModel * getOptionsModel()
interfaces::Wallet & wallet() const
TransactionTableModel * getTransactionTableModel()
void SetHex(const char *psz)
std::string ToString() const
virtual bool transactionCanBeAbandoned(const TxId &txid)=0
Return whether transaction can be abandoned.
virtual bool abandonTransaction(const TxId &txid)=0
Abandon transaction.
virtual bool haveWatchOnly()=0
Return whether wallet has watch only keys.
void PopupMenu(QMenu *menu, const QPoint &point, QAction *at_action)
Call QMenu::popup() only on supported QT_QPA_PLATFORM.
void copyEntryData(const QAbstractItemView *view, int column, int role)
Copy a field of the currently selected entry of a view to the clipboard.
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 ...
QStringList splitSkipEmptyParts(const QString &s, const QString &separator)
bool hasEntryData(const QAbstractItemView *view, int column, int role)
Returns true if the specified field of the currently selected view entry is not empty.
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
static constexpr Amount zero() noexcept
A TxId is the identifier of a transaction.