2013-11-04 12:20:43 -03:00
|
|
|
// Copyright (c) 2011-2013 The Bitcoin developers
|
|
|
|
// Distributed under the MIT/X11 software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
2011-06-28 15:41:56 -04:00
|
|
|
#ifndef TRANSACTIONVIEW_H
|
|
|
|
#define TRANSACTIONVIEW_H
|
|
|
|
|
2014-03-21 02:45:47 -03:00
|
|
|
#include "guiutil.h"
|
2011-06-28 15:41:56 -04:00
|
|
|
|
2014-03-21 05:12:01 -03:00
|
|
|
#include <QWidget>
|
2014-05-09 18:50:09 -04:00
|
|
|
#include <QKeyEvent>
|
2014-03-21 05:12:01 -03:00
|
|
|
|
2011-06-28 15:41:56 -04:00
|
|
|
class TransactionFilterProxy;
|
2013-04-13 02:13:08 -03:00
|
|
|
class WalletModel;
|
2011-06-28 15:41:56 -04:00
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
class QComboBox;
|
2013-04-13 02:13:08 -03:00
|
|
|
class QDateTimeEdit;
|
|
|
|
class QFrame;
|
2011-06-28 15:41:56 -04:00
|
|
|
class QLineEdit;
|
2011-07-08 16:27:36 -04:00
|
|
|
class QMenu;
|
2013-04-13 02:13:08 -03:00
|
|
|
class QModelIndex;
|
2014-04-24 17:21:45 -03:00
|
|
|
class QSignalMapper;
|
2013-04-13 02:13:08 -03:00
|
|
|
class QTableView;
|
2011-06-28 15:41:56 -04:00
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
2011-11-13 09:19:52 -03: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 15:41:56 -04:00
|
|
|
class TransactionView : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2013-01-23 17:51:02 -03:00
|
|
|
|
2011-06-28 15:41:56 -04:00
|
|
|
public:
|
|
|
|
explicit TransactionView(QWidget *parent = 0);
|
|
|
|
|
2011-07-08 16:27:36 -04:00
|
|
|
void setModel(WalletModel *model);
|
2011-06-28 15:41:56 -04:00
|
|
|
|
2011-08-08 11:38:17 -04:00
|
|
|
// Date ranges for filter
|
2011-06-28 15:41:56 -04:00
|
|
|
enum DateEnum
|
|
|
|
{
|
|
|
|
All,
|
|
|
|
Today,
|
|
|
|
ThisWeek,
|
|
|
|
ThisMonth,
|
2011-07-01 14:28:11 -04:00
|
|
|
LastMonth,
|
2011-06-28 15:41:56 -04:00
|
|
|
ThisYear,
|
|
|
|
Range
|
|
|
|
};
|
|
|
|
|
2014-03-21 02:45:47 -03:00
|
|
|
enum ColumnWidths {
|
2014-03-21 05:12:01 -03:00
|
|
|
STATUS_COLUMN_WIDTH = 23,
|
2014-08-09 20:26:04 -04:00
|
|
|
WATCHONLY_COLUMN_WIDTH = 23,
|
2014-03-21 05:12:01 -03:00
|
|
|
DATE_COLUMN_WIDTH = 120,
|
|
|
|
TYPE_COLUMN_WIDTH = 120,
|
|
|
|
AMOUNT_MINIMUM_COLUMN_WIDTH = 120,
|
|
|
|
MINIMUM_COLUMN_WIDTH = 23
|
2014-03-21 02:45:47 -03:00
|
|
|
};
|
|
|
|
|
2011-06-28 15:41:56 -04:00
|
|
|
private:
|
2011-07-08 16:27:36 -04:00
|
|
|
WalletModel *model;
|
2011-06-28 15:41:56 -04:00
|
|
|
TransactionFilterProxy *transactionProxyModel;
|
|
|
|
QTableView *transactionView;
|
|
|
|
|
|
|
|
QComboBox *dateWidget;
|
|
|
|
QComboBox *typeWidget;
|
2014-08-09 20:26:04 -04:00
|
|
|
QComboBox *watchOnlyWidget;
|
2011-06-28 15:41:56 -04:00
|
|
|
QLineEdit *addressWidget;
|
|
|
|
QLineEdit *amountWidget;
|
|
|
|
|
2011-07-08 16:27:36 -04:00
|
|
|
QMenu *contextMenu;
|
2014-04-24 17:21:45 -03:00
|
|
|
QSignalMapper *mapperThirdPartyTxUrls;
|
2011-07-08 16:27:36 -04:00
|
|
|
|
2011-07-22 12:30:25 -04:00
|
|
|
QFrame *dateRangeWidget;
|
|
|
|
QDateTimeEdit *dateFrom;
|
|
|
|
QDateTimeEdit *dateTo;
|
|
|
|
|
|
|
|
QWidget *createDateRangeWidget();
|
|
|
|
|
2014-03-21 02:45:47 -03:00
|
|
|
GUIUtil::TableViewLastColumnResizingFixer *columnResizingFixer;
|
|
|
|
|
|
|
|
virtual void resizeEvent(QResizeEvent* event);
|
|
|
|
|
2014-05-09 18:50:09 -04:00
|
|
|
bool eventFilter(QObject *obj, QEvent *event);
|
|
|
|
|
2011-07-08 16:27:36 -04:00
|
|
|
private slots:
|
|
|
|
void contextualMenu(const QPoint &);
|
2011-07-22 12:30:25 -04:00
|
|
|
void dateRangeChanged();
|
2011-12-04 10:14:10 -03:00
|
|
|
void showDetails();
|
|
|
|
void copyAddress();
|
|
|
|
void editLabel();
|
|
|
|
void copyLabel();
|
|
|
|
void copyAmount();
|
2013-03-21 06:33:36 -03:00
|
|
|
void copyTxID();
|
2014-04-24 17:21:45 -03:00
|
|
|
void openThirdPartyTxUrl(QString url);
|
2014-08-09 20:26:04 -04:00
|
|
|
void updateWatchOnlyColumn(bool fHaveWatchOnly);
|
2011-07-08 16:27:36 -04:00
|
|
|
|
2011-06-28 15:41:56 -04:00
|
|
|
signals:
|
2011-06-30 15:34:00 -04:00
|
|
|
void doubleClicked(const QModelIndex&);
|
2011-06-28 15:41:56 -04:00
|
|
|
|
2013-10-26 14:12:29 -03:00
|
|
|
/** Fired when a message should be reported to the user */
|
|
|
|
void message(const QString &title, const QString &message, unsigned int style);
|
|
|
|
|
2011-06-28 15:41:56 -04:00
|
|
|
public slots:
|
|
|
|
void chooseDate(int idx);
|
|
|
|
void chooseType(int idx);
|
2014-08-09 20:26:04 -04:00
|
|
|
void chooseWatchonly(int idx);
|
2011-06-28 15:41:56 -04:00
|
|
|
void changedPrefix(const QString &prefix);
|
|
|
|
void changedAmount(const QString &amount);
|
2011-07-07 08:27:16 -04:00
|
|
|
void exportClicked();
|
2012-05-12 07:19:44 -04:00
|
|
|
void focusTransaction(const QModelIndex&);
|
2011-06-28 15:41:56 -04:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TRANSACTIONVIEW_H
|