2015-12-13 14:51:43 +01:00
|
|
|
// Copyright (c) 2011-2015 The Bitcoin Core developers
|
2014-12-13 05:09:33 +01:00
|
|
|
// Distributed under the MIT software license, see the accompanying
|
2013-11-04 16:20:43 +01:00
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
2014-11-03 16:16:40 +01:00
|
|
|
#ifndef BITCOIN_QT_TRANSACTIONVIEW_H
|
|
|
|
#define BITCOIN_QT_TRANSACTIONVIEW_H
|
2011-06-28 21:41:56 +02:00
|
|
|
|
2020-03-19 23:46:56 +01:00
|
|
|
#include <qt/guiutil.h>
|
2011-06-28 21:41:56 +02:00
|
|
|
|
2018-03-01 12:18:25 +01:00
|
|
|
#include <uint256.h>
|
|
|
|
|
2014-03-21 09:12:01 +01:00
|
|
|
#include <QWidget>
|
2014-05-10 00:50:09 +02:00
|
|
|
#include <QKeyEvent>
|
2014-03-21 09:12:01 +01:00
|
|
|
|
2011-06-28 21:41:56 +02:00
|
|
|
class TransactionFilterProxy;
|
2013-04-13 07:13:08 +02:00
|
|
|
class WalletModel;
|
2011-06-28 21:41:56 +02:00
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
class QComboBox;
|
2013-04-13 07:13:08 +02:00
|
|
|
class QDateTimeEdit;
|
|
|
|
class QFrame;
|
2015-05-14 08:31:40 +02:00
|
|
|
class QItemSelectionModel;
|
2011-06-28 21:41:56 +02:00
|
|
|
class QLineEdit;
|
2011-07-08 22:27:36 +02:00
|
|
|
class QMenu;
|
2013-04-13 07:13:08 +02:00
|
|
|
class QModelIndex;
|
2014-04-24 22:21:45 +02:00
|
|
|
class QSignalMapper;
|
2013-04-13 07:13:08 +02:00
|
|
|
class QTableView;
|
2011-06-28 21:41:56 +02:00
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
2011-11-13 13:19:52 +01:00
|
|
|
/** Widget showing the transaction list for a wallet, including a filter row.
|
|
|
|
Using the filter row, the user can view or export a subset of the transactions.
|
|
|
|
*/
|
2011-06-28 21:41:56 +02:00
|
|
|
class TransactionView : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2013-01-23 21:51:02 +01:00
|
|
|
|
2011-06-28 21:41:56 +02:00
|
|
|
public:
|
2020-07-26 13:20:19 +02:00
|
|
|
explicit TransactionView(QWidget* parent = 0);
|
2011-06-28 21:41:56 +02:00
|
|
|
|
2011-07-08 22:27:36 +02:00
|
|
|
void setModel(WalletModel *model);
|
2011-06-28 21:41:56 +02:00
|
|
|
|
2011-08-08 17:38:17 +02:00
|
|
|
// Date ranges for filter
|
2011-06-28 21:41:56 +02:00
|
|
|
enum DateEnum
|
|
|
|
{
|
|
|
|
All,
|
|
|
|
Today,
|
|
|
|
ThisWeek,
|
|
|
|
ThisMonth,
|
2011-07-01 20:28:11 +02:00
|
|
|
LastMonth,
|
2011-06-28 21:41:56 +02:00
|
|
|
ThisYear,
|
|
|
|
Range
|
|
|
|
};
|
|
|
|
|
2014-03-21 06:45:47 +01:00
|
|
|
enum ColumnWidths {
|
2015-01-09 11:46:30 +01:00
|
|
|
STATUS_COLUMN_WIDTH = 30,
|
2014-08-10 02:26:04 +02:00
|
|
|
WATCHONLY_COLUMN_WIDTH = 23,
|
2014-03-21 09:12:01 +01:00
|
|
|
DATE_COLUMN_WIDTH = 120,
|
2015-04-03 20:42:54 +02:00
|
|
|
TYPE_COLUMN_WIDTH = 240,
|
2014-03-21 09:12:01 +01:00
|
|
|
AMOUNT_MINIMUM_COLUMN_WIDTH = 120,
|
|
|
|
MINIMUM_COLUMN_WIDTH = 23
|
2014-03-21 06:45:47 +01:00
|
|
|
};
|
|
|
|
|
2011-06-28 21:41:56 +02:00
|
|
|
private:
|
2011-07-08 22:27:36 +02:00
|
|
|
WalletModel *model;
|
2011-06-28 21:41:56 +02:00
|
|
|
TransactionFilterProxy *transactionProxyModel;
|
|
|
|
QTableView *transactionView;
|
|
|
|
QComboBox *dateWidget;
|
|
|
|
QComboBox *typeWidget;
|
2014-08-10 02:26:04 +02:00
|
|
|
QComboBox *watchOnlyWidget;
|
2017-11-30 00:50:30 +01:00
|
|
|
QLineEdit *search_widget;
|
2011-06-28 21:41:56 +02:00
|
|
|
QLineEdit *amountWidget;
|
|
|
|
|
2011-07-08 22:27:36 +02:00
|
|
|
QMenu *contextMenu;
|
2014-04-24 22:21:45 +02:00
|
|
|
QSignalMapper *mapperThirdPartyTxUrls;
|
2011-07-08 22:27:36 +02:00
|
|
|
|
2011-07-22 18:30:25 +02:00
|
|
|
QFrame *dateRangeWidget;
|
|
|
|
QDateTimeEdit *dateFrom;
|
|
|
|
QDateTimeEdit *dateTo;
|
2017-09-09 09:04:02 +02:00
|
|
|
QAction *abandonAction;
|
2011-07-22 18:30:25 +02:00
|
|
|
|
|
|
|
QWidget *createDateRangeWidget();
|
2020-07-20 17:01:11 +02:00
|
|
|
void updateCalendarWidgets();
|
2011-07-22 18:30:25 +02:00
|
|
|
|
2014-03-21 06:45:47 +01:00
|
|
|
GUIUtil::TableViewLastColumnResizingFixer *columnResizingFixer;
|
|
|
|
|
2018-02-15 08:29:15 +01:00
|
|
|
virtual void resizeEvent(QResizeEvent* event) override;
|
2020-07-20 17:01:11 +02:00
|
|
|
void changeEvent(QEvent* e) override;
|
2014-03-21 06:45:47 +01:00
|
|
|
|
2018-02-21 17:32:08 +01:00
|
|
|
bool eventFilter(QObject *obj, QEvent *event) override;
|
2014-05-10 00:50:09 +02:00
|
|
|
|
2015-07-14 13:59:05 +02:00
|
|
|
private Q_SLOTS:
|
2011-07-08 22:27:36 +02:00
|
|
|
void contextualMenu(const QPoint &);
|
2011-07-22 18:30:25 +02:00
|
|
|
void dateRangeChanged();
|
2011-12-04 14:14:10 +01:00
|
|
|
void showDetails();
|
2019-03-06 20:45:22 +01:00
|
|
|
void showAddressQRCode();
|
2011-12-04 14:14:10 +01:00
|
|
|
void copyAddress();
|
|
|
|
void editLabel();
|
|
|
|
void copyLabel();
|
|
|
|
void copyAmount();
|
2013-03-21 10:33:36 +01:00
|
|
|
void copyTxID();
|
2015-11-17 11:17:09 +01:00
|
|
|
void copyTxHex();
|
2017-09-07 17:59:00 +02:00
|
|
|
void copyTxPlainText();
|
2014-04-24 22:21:45 +02:00
|
|
|
void openThirdPartyTxUrl(QString url);
|
2014-08-10 02:26:04 +02:00
|
|
|
void updateWatchOnlyColumn(bool fHaveWatchOnly);
|
2021-03-17 23:36:11 +01:00
|
|
|
void updateCoinJoinVisibility();
|
2017-09-09 09:04:02 +02:00
|
|
|
void abandonTx();
|
2011-07-08 22:27:36 +02:00
|
|
|
|
2015-07-14 13:59:05 +02:00
|
|
|
Q_SIGNALS:
|
2011-06-30 21:34:00 +02:00
|
|
|
void doubleClicked(const QModelIndex&);
|
2011-06-28 21:41:56 +02:00
|
|
|
|
2013-10-26 19:12:29 +02:00
|
|
|
/** Fired when a message should be reported to the user */
|
|
|
|
void message(const QString &title, const QString &message, unsigned int style);
|
|
|
|
|
2015-05-10 01:28:03 +02:00
|
|
|
/** Send computed sum back to wallet-view */
|
2015-05-10 01:30:45 +02:00
|
|
|
void trxAmount(QString amount);
|
2013-10-26 19:12:29 +02:00
|
|
|
|
2015-07-14 13:59:05 +02:00
|
|
|
public Q_SLOTS:
|
2011-06-28 21:41:56 +02:00
|
|
|
void chooseDate(int idx);
|
|
|
|
void chooseType(int idx);
|
2014-08-10 02:26:04 +02:00
|
|
|
void chooseWatchonly(int idx);
|
2017-09-26 23:59:01 +02:00
|
|
|
void changedAmount();
|
2017-11-30 00:50:30 +01:00
|
|
|
void changedSearch();
|
2011-07-07 14:27:16 +02:00
|
|
|
void exportClicked();
|
2012-05-12 13:19:44 +02:00
|
|
|
void focusTransaction(const QModelIndex&);
|
2018-03-01 12:18:25 +01:00
|
|
|
void focusTransaction(const uint256& txid);
|
2015-05-10 01:22:35 +02:00
|
|
|
void computeSum();
|
2011-06-28 21:41:56 +02:00
|
|
|
};
|
|
|
|
|
2014-11-03 16:16:40 +01:00
|
|
|
#endif // BITCOIN_QT_TRANSACTIONVIEW_H
|