2011-06-28 21:41:56 +02:00
|
|
|
#ifndef TRANSACTIONVIEW_H
|
|
|
|
#define TRANSACTIONVIEW_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
2011-07-08 22:27:36 +02:00
|
|
|
class WalletModel;
|
2011-06-28 21:41:56 +02:00
|
|
|
class TransactionFilterProxy;
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
class QTableView;
|
|
|
|
class QComboBox;
|
|
|
|
class QLineEdit;
|
2011-06-30 21:34:00 +02:00
|
|
|
class QModelIndex;
|
2011-07-08 22:27:36 +02:00
|
|
|
class QMenu;
|
2011-07-22 18:30:25 +02:00
|
|
|
class QFrame;
|
|
|
|
class QDateTimeEdit;
|
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
|
|
|
|
public:
|
|
|
|
explicit TransactionView(QWidget *parent = 0);
|
|
|
|
|
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
|
|
|
|
};
|
|
|
|
|
|
|
|
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;
|
|
|
|
QLineEdit *addressWidget;
|
|
|
|
QLineEdit *amountWidget;
|
|
|
|
|
2011-07-08 22:27:36 +02:00
|
|
|
QMenu *contextMenu;
|
|
|
|
|
2011-07-22 18:30:25 +02:00
|
|
|
QFrame *dateRangeWidget;
|
|
|
|
QDateTimeEdit *dateFrom;
|
|
|
|
QDateTimeEdit *dateTo;
|
|
|
|
|
|
|
|
QWidget *createDateRangeWidget();
|
|
|
|
|
2011-07-08 22:27:36 +02:00
|
|
|
private slots:
|
|
|
|
void contextualMenu(const QPoint &);
|
2011-07-22 18:30:25 +02:00
|
|
|
void dateRangeChanged();
|
2011-12-04 14:14:10 +01:00
|
|
|
void showDetails();
|
|
|
|
void copyAddress();
|
|
|
|
void editLabel();
|
|
|
|
void copyLabel();
|
|
|
|
void copyAmount();
|
2011-07-08 22:27:36 +02:00
|
|
|
|
2011-06-28 21:41:56 +02:00
|
|
|
signals:
|
2011-06-30 21:34:00 +02:00
|
|
|
void doubleClicked(const QModelIndex&);
|
2011-06-28 21:41:56 +02:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void chooseDate(int idx);
|
|
|
|
void chooseType(int idx);
|
|
|
|
void changedPrefix(const QString &prefix);
|
|
|
|
void changedAmount(const QString &amount);
|
2011-07-07 14:27:16 +02:00
|
|
|
void exportClicked();
|
2012-05-12 13:19:44 +02:00
|
|
|
void focusTransaction(const QModelIndex&);
|
2011-06-28 21:41:56 +02:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TRANSACTIONVIEW_H
|