[test] Replace check_output with low level version
[bitcoinplatinum.git] / src / qt / transactionview.h
blob52e57cae4cf9486d98b7e55278d5ab44b4d32098
1 // Copyright (c) 2011-2016 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.
5 #ifndef BITCOIN_QT_TRANSACTIONVIEW_H
6 #define BITCOIN_QT_TRANSACTIONVIEW_H
8 #include "guiutil.h"
10 #include <QWidget>
11 #include <QKeyEvent>
13 class PlatformStyle;
14 class TransactionFilterProxy;
15 class WalletModel;
17 QT_BEGIN_NAMESPACE
18 class QComboBox;
19 class QDateTimeEdit;
20 class QFrame;
21 class QLineEdit;
22 class QMenu;
23 class QModelIndex;
24 class QSignalMapper;
25 class QTableView;
26 QT_END_NAMESPACE
28 /** Widget showing the transaction list for a wallet, including a filter row.
29 Using the filter row, the user can view or export a subset of the transactions.
31 class TransactionView : public QWidget
33 Q_OBJECT
35 public:
36 explicit TransactionView(const PlatformStyle *platformStyle, QWidget *parent = 0);
38 void setModel(WalletModel *model);
40 // Date ranges for filter
41 enum DateEnum
43 All,
44 Today,
45 ThisWeek,
46 ThisMonth,
47 LastMonth,
48 ThisYear,
49 Range
52 enum ColumnWidths {
53 STATUS_COLUMN_WIDTH = 30,
54 WATCHONLY_COLUMN_WIDTH = 23,
55 DATE_COLUMN_WIDTH = 120,
56 TYPE_COLUMN_WIDTH = 113,
57 AMOUNT_MINIMUM_COLUMN_WIDTH = 120,
58 MINIMUM_COLUMN_WIDTH = 23
61 private:
62 WalletModel *model;
63 TransactionFilterProxy *transactionProxyModel;
64 QTableView *transactionView;
66 QComboBox *dateWidget;
67 QComboBox *typeWidget;
68 QComboBox *watchOnlyWidget;
69 QLineEdit *addressWidget;
70 QLineEdit *amountWidget;
72 QMenu *contextMenu;
73 QSignalMapper *mapperThirdPartyTxUrls;
75 QFrame *dateRangeWidget;
76 QDateTimeEdit *dateFrom;
77 QDateTimeEdit *dateTo;
78 QAction *abandonAction;
79 QAction *bumpFeeAction;
81 QWidget *createDateRangeWidget();
83 GUIUtil::TableViewLastColumnResizingFixer *columnResizingFixer;
85 virtual void resizeEvent(QResizeEvent* event);
87 bool eventFilter(QObject *obj, QEvent *event);
89 private Q_SLOTS:
90 void contextualMenu(const QPoint &);
91 void dateRangeChanged();
92 void showDetails();
93 void copyAddress();
94 void editLabel();
95 void copyLabel();
96 void copyAmount();
97 void copyTxID();
98 void copyTxHex();
99 void copyTxPlainText();
100 void openThirdPartyTxUrl(QString url);
101 void updateWatchOnlyColumn(bool fHaveWatchOnly);
102 void abandonTx();
103 void bumpFee();
105 Q_SIGNALS:
106 void doubleClicked(const QModelIndex&);
108 /** Fired when a message should be reported to the user */
109 void message(const QString &title, const QString &message, unsigned int style);
111 public Q_SLOTS:
112 void chooseDate(int idx);
113 void chooseType(int idx);
114 void chooseWatchonly(int idx);
115 void changedPrefix(const QString &prefix);
116 void changedAmount(const QString &amount);
117 void exportClicked();
118 void focusTransaction(const QModelIndex&);
122 #endif // BITCOIN_QT_TRANSACTIONVIEW_H