mirror of
https://github.com/dashpay/dash.git
synced 2024-12-28 21:42:47 +01:00
61c5fb9ef7
7b137aced
[Qt] Add delay before filtering transactions Fixes 3141 (Lucas Betschart)
Pull request description:
As discussed in https://github.com/bitcoin/bitcoin/issues/3141.
This adds a QTimer pause of 200ms before start to filter so it should be possible to filter big data sets easier.
Tree-SHA512: ee599367794eac2c5b8bc7ecac47f44295e40c0ff543ff2f2c4860590f917b59b1cfb273fa564e6eb4c44016c0ef412d49f1a8f1b36b07e034022f51bb76653c
128 lines
3.1 KiB
C++
128 lines
3.1 KiB
C++
// Copyright (c) 2011-2015 The Bitcoin Core developers
|
|
// Distributed under the MIT software license, see the accompanying
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
#ifndef BITCOIN_QT_TRANSACTIONVIEW_H
|
|
#define BITCOIN_QT_TRANSACTIONVIEW_H
|
|
|
|
#include "guiutil.h"
|
|
|
|
#include <QWidget>
|
|
#include <QKeyEvent>
|
|
|
|
class PlatformStyle;
|
|
class TransactionFilterProxy;
|
|
class WalletModel;
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
class QComboBox;
|
|
class QDateTimeEdit;
|
|
class QFrame;
|
|
class QItemSelectionModel;
|
|
class QLineEdit;
|
|
class QMenu;
|
|
class QModelIndex;
|
|
class QSignalMapper;
|
|
class QTableView;
|
|
QT_END_NAMESPACE
|
|
|
|
/** 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
|
|
|
|
public:
|
|
explicit TransactionView(const PlatformStyle *platformStyle, QWidget *parent = 0);
|
|
|
|
void setModel(WalletModel *model);
|
|
|
|
// Date ranges for filter
|
|
enum DateEnum
|
|
{
|
|
All,
|
|
Today,
|
|
ThisWeek,
|
|
ThisMonth,
|
|
LastMonth,
|
|
ThisYear,
|
|
Range
|
|
};
|
|
|
|
enum ColumnWidths {
|
|
STATUS_COLUMN_WIDTH = 30,
|
|
WATCHONLY_COLUMN_WIDTH = 23,
|
|
INSTANTSEND_COLUMN_WIDTH = 23,
|
|
DATE_COLUMN_WIDTH = 120,
|
|
TYPE_COLUMN_WIDTH = 240,
|
|
AMOUNT_MINIMUM_COLUMN_WIDTH = 120,
|
|
MINIMUM_COLUMN_WIDTH = 23
|
|
};
|
|
|
|
private:
|
|
WalletModel *model;
|
|
TransactionFilterProxy *transactionProxyModel;
|
|
QTableView *transactionView;
|
|
QComboBox *dateWidget;
|
|
QComboBox *typeWidget;
|
|
QComboBox *watchOnlyWidget;
|
|
QComboBox *instantsendWidget;
|
|
QLineEdit *addressWidget;
|
|
QLineEdit *amountWidget;
|
|
|
|
QMenu *contextMenu;
|
|
QSignalMapper *mapperThirdPartyTxUrls;
|
|
|
|
QFrame *dateRangeWidget;
|
|
QDateTimeEdit *dateFrom;
|
|
QDateTimeEdit *dateTo;
|
|
QAction *abandonAction;
|
|
|
|
QWidget *createDateRangeWidget();
|
|
|
|
GUIUtil::TableViewLastColumnResizingFixer *columnResizingFixer;
|
|
|
|
virtual void resizeEvent(QResizeEvent* event) override;
|
|
|
|
bool eventFilter(QObject *obj, QEvent *event) override;
|
|
|
|
private Q_SLOTS:
|
|
void contextualMenu(const QPoint &);
|
|
void dateRangeChanged();
|
|
void showDetails();
|
|
void showAddressQRCode();
|
|
void copyAddress();
|
|
void editLabel();
|
|
void copyLabel();
|
|
void copyAmount();
|
|
void copyTxID();
|
|
void copyTxHex();
|
|
void copyTxPlainText();
|
|
void openThirdPartyTxUrl(QString url);
|
|
void updateWatchOnlyColumn(bool fHaveWatchOnly);
|
|
void abandonTx();
|
|
|
|
Q_SIGNALS:
|
|
void doubleClicked(const QModelIndex&);
|
|
|
|
/** Fired when a message should be reported to the user */
|
|
void message(const QString &title, const QString &message, unsigned int style);
|
|
|
|
/** Send computed sum back to wallet-view */
|
|
void trxAmount(QString amount);
|
|
|
|
public Q_SLOTS:
|
|
void chooseDate(int idx);
|
|
void chooseType(int idx);
|
|
void chooseWatchonly(int idx);
|
|
void chooseInstantSend(int idx);
|
|
void changedAmount();
|
|
void changedPrefix();
|
|
void exportClicked();
|
|
void focusTransaction(const QModelIndex&);
|
|
void computeSum();
|
|
};
|
|
|
|
#endif // BITCOIN_QT_TRANSACTIONVIEW_H
|