Bitcoin Core  21.99.0
P2P Digital Currency
transactionview.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2020 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 #ifndef BITCOIN_QT_TRANSACTIONVIEW_H
6 #define BITCOIN_QT_TRANSACTIONVIEW_H
7 
8 #include <qt/guiutil.h>
9 
10 #include <uint256.h>
11 
12 #include <QWidget>
13 #include <QKeyEvent>
14 
15 class PlatformStyle;
17 class WalletModel;
18 
19 QT_BEGIN_NAMESPACE
20 class QComboBox;
21 class QDateTimeEdit;
22 class QFrame;
23 class QLineEdit;
24 class QMenu;
25 class QModelIndex;
26 class QTableView;
27 QT_END_NAMESPACE
28 
32 class TransactionView : public QWidget
33 {
34  Q_OBJECT
35 
36 public:
37  explicit TransactionView(const PlatformStyle *platformStyle, QWidget *parent = nullptr);
39 
40  void setModel(WalletModel *model);
41 
42  // Date ranges for filter
43  enum DateEnum
44  {
45  All,
52  };
53 
54  enum ColumnWidths {
61  };
62 
63 private:
64  WalletModel *model{nullptr};
66  QTableView *transactionView{nullptr};
67 
68  QComboBox *dateWidget;
69  QComboBox *typeWidget;
70  QComboBox *watchOnlyWidget;
71  QLineEdit *search_widget;
72  QLineEdit *amountWidget;
73 
74  QMenu *contextMenu;
75 
76  QFrame *dateRangeWidget;
77  QDateTimeEdit *dateFrom;
78  QDateTimeEdit *dateTo;
79  QAction *abandonAction{nullptr};
80  QAction *bumpFeeAction{nullptr};
81  QAction *copyAddressAction{nullptr};
82  QAction *copyLabelAction{nullptr};
83 
84  QWidget *createDateRangeWidget();
85 
86  bool eventFilter(QObject *obj, QEvent *event) override;
87 
88 private Q_SLOTS:
89  void contextualMenu(const QPoint &);
90  void dateRangeChanged();
91  void showDetails();
92  void copyAddress();
93  void editLabel();
94  void copyLabel();
95  void copyAmount();
96  void copyTxID();
97  void copyTxHex();
98  void copyTxPlainText();
99  void openThirdPartyTxUrl(QString url);
100  void updateWatchOnlyColumn(bool fHaveWatchOnly);
101  void abandonTx();
102  void bumpFee(bool checked);
103 
104 Q_SIGNALS:
105  void doubleClicked(const QModelIndex&);
106 
108  void message(const QString &title, const QString &message, unsigned int style);
109 
110  void bumpedFee(const uint256& txid);
111 
112 public Q_SLOTS:
113  void chooseDate(int idx);
114  void chooseType(int idx);
115  void chooseWatchonly(int idx);
116  void changedAmount();
117  void changedSearch();
118  void exportClicked();
119  void focusTransaction(const QModelIndex&);
120  void focusTransaction(const uint256& txid);
121 };
122 
123 #endif // BITCOIN_QT_TRANSACTIONVIEW_H
TransactionView
Widget showing the transaction list for a wallet, including a filter row.
Definition: transactionview.h:32
TransactionView::TYPE_COLUMN_WIDTH
@ TYPE_COLUMN_WIDTH
Definition: transactionview.h:58
TransactionView::createDateRangeWidget
QWidget * createDateRangeWidget()
Definition: transactionview.cpp:548
TransactionView::search_widget
QLineEdit * search_widget
Definition: transactionview.h:71
TransactionView::editLabel
void editLabel()
Definition: transactionview.cpp:480
WalletModel
Interface to Bitcoin wallet from Qt view code.
Definition: walletmodel.h:51
TransactionView::openThirdPartyTxUrl
void openThirdPartyTxUrl(QString url)
Definition: transactionview.cpp:539
TransactionView::~TransactionView
~TransactionView()
Definition: transactionview.cpp:220
TransactionView::abandonAction
QAction * abandonAction
Definition: transactionview.h:79
TransactionView::DateEnum
DateEnum
Definition: transactionview.h:43
TransactionView::bumpFee
void bumpFee(bool checked)
Definition: transactionview.cpp:427
TransactionView::ThisYear
@ ThisYear
Definition: transactionview.h:50
TransactionView::focusTransaction
void focusTransaction(const QModelIndex &)
Definition: transactionview.cpp:593
TransactionView::ColumnWidths
ColumnWidths
Definition: transactionview.h:54
uint256.h
TransactionView::ThisMonth
@ ThisMonth
Definition: transactionview.h:48
TransactionView::LastMonth
@ LastMonth
Definition: transactionview.h:49
TransactionView::STATUS_COLUMN_WIDTH
@ STATUS_COLUMN_WIDTH
Definition: transactionview.h:55
TransactionView::chooseWatchonly
void chooseWatchonly(int idx)
Definition: transactionview.cpp:322
TransactionView::transactionView
QTableView * transactionView
Definition: transactionview.h:66
TransactionView::copyTxID
void copyTxID()
Definition: transactionview.cpp:465
TransactionView::dateTo
QDateTimeEdit * dateTo
Definition: transactionview.h:78
url
const char * url
Definition: rpcconsole.cpp:56
TransactionView::showDetails
void showDetails()
Definition: transactionview.cpp:526
TransactionView::changedSearch
void changedSearch()
Definition: transactionview.cpp:330
TransactionView::changedAmount
void changedAmount()
Definition: transactionview.cpp:337
guiutil.h
TransactionView::DATE_COLUMN_WIDTH
@ DATE_COLUMN_WIDTH
Definition: transactionview.h:57
TransactionView::eventFilter
bool eventFilter(QObject *obj, QEvent *event) override
Definition: transactionview.cpp:630
TransactionView::copyAmount
void copyAmount()
Definition: transactionview.cpp:460
TransactionView::message
void message(const QString &title, const QString &message, unsigned int style)
Fired when a message should be reported to the user.
TransactionView::All
@ All
Definition: transactionview.h:45
uint256
256-bit opaque blob.
Definition: uint256.h:124
TransactionView::transactionProxyModel
TransactionFilterProxy * transactionProxyModel
Definition: transactionview.h:65
TransactionView::dateRangeChanged
void dateRangeChanged()
Definition: transactionview.cpp:584
TransactionView::copyLabel
void copyLabel()
Definition: transactionview.cpp:455
TransactionView::watchOnlyWidget
QComboBox * watchOnlyWidget
Definition: transactionview.h:70
TransactionView::WATCHONLY_COLUMN_WIDTH
@ WATCHONLY_COLUMN_WIDTH
Definition: transactionview.h:56
TransactionView::updateWatchOnlyColumn
void updateWatchOnlyColumn(bool fHaveWatchOnly)
Definition: transactionview.cpp:645
TransactionView::bumpedFee
void bumpedFee(const uint256 &txid)
TransactionView::MINIMUM_COLUMN_WIDTH
@ MINIMUM_COLUMN_WIDTH
Definition: transactionview.h:60
TransactionView::ThisWeek
@ ThisWeek
Definition: transactionview.h:47
TransactionView::contextMenu
QMenu * contextMenu
Definition: transactionview.h:74
TransactionView::copyLabelAction
QAction * copyLabelAction
Definition: transactionview.h:82
TransactionView::copyTxHex
void copyTxHex()
Definition: transactionview.cpp:470
TransactionView::chooseDate
void chooseDate(int idx)
Definition: transactionview.cpp:267
TransactionView::setModel
void setModel(WalletModel *model)
Definition: transactionview.cpp:226
TransactionView::copyAddress
void copyAddress()
Definition: transactionview.cpp:450
TransactionView::amountWidget
QLineEdit * amountWidget
Definition: transactionview.h:72
TransactionView::typeWidget
QComboBox * typeWidget
Definition: transactionview.h:69
TransactionView::abandonTx
void abandonTx()
Definition: transactionview.cpp:409
TransactionView::copyAddressAction
QAction * copyAddressAction
Definition: transactionview.h:81
TransactionView::contextualMenu
void contextualMenu(const QPoint &)
Definition: transactionview.cpp:389
TransactionView::dateRangeWidget
QFrame * dateRangeWidget
Definition: transactionview.h:76
TransactionView::AMOUNT_MINIMUM_COLUMN_WIDTH
@ AMOUNT_MINIMUM_COLUMN_WIDTH
Definition: transactionview.h:59
TransactionView::chooseType
void chooseType(int idx)
Definition: transactionview.cpp:314
TransactionView::bumpFeeAction
QAction * bumpFeeAction
Definition: transactionview.h:80
TransactionView::TransactionView
TransactionView(const PlatformStyle *platformStyle, QWidget *parent=nullptr)
Definition: transactionview.cpp:40
TransactionView::doubleClicked
void doubleClicked(const QModelIndex &)
PlatformStyle
Definition: platformstyle.h:13
TransactionView::copyTxPlainText
void copyTxPlainText()
Definition: transactionview.cpp:475
TransactionView::model
WalletModel * model
Definition: transactionview.h:64
TransactionView::exportClicked
void exportClicked()
Definition: transactionview.cpp:351
TransactionView::dateWidget
QComboBox * dateWidget
Definition: transactionview.h:68
TransactionView::dateFrom
QDateTimeEdit * dateFrom
Definition: transactionview.h:77
TransactionView::Today
@ Today
Definition: transactionview.h:46
TransactionView::Range
@ Range
Definition: transactionview.h:51
TransactionFilterProxy
Filter the transaction list according to pre-specified rules.
Definition: transactionfilterproxy.h:14