Files
thehub/hub-qt/transactionview.h
T

132 lines
3.3 KiB
C++
Raw Permalink Normal View History

2017-11-09 19:34:51 +01:00
/*
* This file is part of the Flowee project
* Copyright (C) 2011-2015 The Bitcoin Core developers
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
2013-11-04 16:20:43 +01:00
2018-01-16 10:47:52 +00:00
#ifndef FLOWEE_QT_TRANSACTIONVIEW_H
#define FLOWEE_QT_TRANSACTIONVIEW_H
#include "guiutil.h"
#include <QWidget>
#include <QKeyEvent>
2015-07-28 15:20:14 +02:00
class PlatformStyle;
class TransactionFilterProxy;
2013-04-13 00:13:08 -05:00
class WalletModel;
QT_BEGIN_NAMESPACE
class QComboBox;
2011-07-22 18:30:25 +02:00
class QDateTimeEdit;
2013-04-13 00:13:08 -05:00
class QFrame;
class QLineEdit;
class QMenu;
class QModelIndex;
class QSignalMapper;
2013-04-13 00:13:08 -05:00
class QTableView;
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.
*/
class TransactionView : public QWidget
{
Q_OBJECT
2013-01-23 21:51:02 +01:00
public:
2015-07-28 15:20:14 +02:00
explicit TransactionView(const PlatformStyle *platformStyle, QWidget *parent = 0);
void setModel(WalletModel *model);
2011-08-08 17:38:17 +02:00
// Date ranges for filter
enum DateEnum
{
All,
Today,
ThisWeek,
ThisMonth,
2011-07-01 20:28:11 +02:00
LastMonth,
ThisYear,
Range
};
enum ColumnWidths {
2015-01-09 11:46:30 +01:00
STATUS_COLUMN_WIDTH = 30,
WATCHONLY_COLUMN_WIDTH = 23,
DATE_COLUMN_WIDTH = 120,
2015-01-09 11:46:30 +01:00
TYPE_COLUMN_WIDTH = 113,
AMOUNT_MINIMUM_COLUMN_WIDTH = 120,
MINIMUM_COLUMN_WIDTH = 23
};
private:
WalletModel *model;
TransactionFilterProxy *transactionProxyModel;
QTableView *transactionView;
QComboBox *dateWidget;
QComboBox *typeWidget;
QComboBox *watchOnlyWidget;
QLineEdit *addressWidget;
QLineEdit *amountWidget;
QMenu *contextMenu;
QSignalMapper *mapperThirdPartyTxUrls;
2011-07-22 18:30:25 +02:00
QFrame *dateRangeWidget;
QDateTimeEdit *dateFrom;
QDateTimeEdit *dateTo;
QWidget *createDateRangeWidget();
GUIUtil::TableViewLastColumnResizingFixer *columnResizingFixer;
virtual void resizeEvent(QResizeEvent* event);
bool eventFilter(QObject *obj, QEvent *event);
2015-07-14 13:59:05 +02:00
private Q_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();
void copyTxID();
void copyTxHex();
void openThirdPartyTxUrl(QString url);
void updateWatchOnlyColumn(bool fHaveWatchOnly);
2015-07-14 13:59:05 +02:00
Q_SIGNALS:
void doubleClicked(const QModelIndex&);
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-07-14 13:59:05 +02:00
public Q_SLOTS:
void chooseDate(int idx);
void chooseType(int idx);
void chooseWatchonly(int idx);
void changedPrefix(const QString &prefix);
void changedAmount(const QString &amount);
2011-07-07 14:27:16 +02:00
void exportClicked();
void focusTransaction(const QModelIndex&);
};
2018-01-16 10:47:52 +00:00
#endif