2020-10-07 10:36:04 +00:00
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
2020-12-26 19:56:06 +00:00
|
|
|
// Copyright (c) 2020-2021, The Monero Project.
|
2020-10-07 10:36:04 +00:00
|
|
|
|
|
|
|
#ifndef FEATHER_HISTORYWIDGET_H
|
|
|
|
#define FEATHER_HISTORYWIDGET_H
|
|
|
|
|
|
|
|
#include "model/TransactionHistoryModel.h"
|
|
|
|
#include "model/TransactionHistoryProxyModel.h"
|
|
|
|
#include "libwalletqt/Coins.h"
|
2020-10-19 23:05:42 +00:00
|
|
|
#include "libwalletqt/Wallet.h"
|
2020-10-07 10:36:04 +00:00
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QMenu>
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class HistoryWidget;
|
|
|
|
}
|
|
|
|
|
|
|
|
class HistoryWidget : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit HistoryWidget(QWidget *parent = nullptr);
|
2020-10-19 23:05:42 +00:00
|
|
|
void setModel(TransactionHistoryProxyModel *model, Wallet *wallet);
|
2020-10-07 10:36:04 +00:00
|
|
|
~HistoryWidget() override;
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void setSearchText(const QString &text);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void viewOnBlockExplorer(QString txid);
|
2020-12-14 22:07:23 +00:00
|
|
|
void resendTransaction(QString txid);
|
2020-10-07 10:36:04 +00:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void showTxDetails();
|
|
|
|
void onViewOnBlockExplorer();
|
|
|
|
void setSearchFilter(const QString &filter);
|
2020-12-14 22:07:23 +00:00
|
|
|
void onResendTransaction();
|
2020-10-07 10:36:04 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
enum copyField {
|
|
|
|
TxID = 0,
|
|
|
|
Date,
|
|
|
|
Amount
|
|
|
|
};
|
|
|
|
|
|
|
|
void copy(copyField field);
|
2020-12-14 22:07:23 +00:00
|
|
|
void showContextMenu(const QPoint &point);
|
2020-10-07 10:36:04 +00:00
|
|
|
|
|
|
|
Ui::HistoryWidget *ui;
|
|
|
|
QMenu *m_contextMenu;
|
|
|
|
QMenu *m_copyMenu;
|
|
|
|
TransactionHistory *m_txHistory;
|
|
|
|
TransactionHistoryProxyModel *m_model;
|
2020-10-19 23:05:42 +00:00
|
|
|
Wallet *m_wallet = nullptr;
|
2020-10-07 10:36:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif //FEATHER_HISTORYWIDGET_H
|