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_COINSWIDGET_H
|
|
|
|
#define FEATHER_COINSWIDGET_H
|
|
|
|
|
|
|
|
#include "appcontext.h"
|
|
|
|
#include "model/CoinsModel.h"
|
|
|
|
#include "model/CoinsProxyModel.h"
|
|
|
|
#include "libwalletqt/Coins.h"
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QtSvg/QSvgWidget>
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class CoinsWidget;
|
|
|
|
}
|
|
|
|
|
|
|
|
class CoinsWidget : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit CoinsWidget(QWidget *parent = nullptr);
|
|
|
|
void setModel(CoinsModel * model, Coins * coins);
|
|
|
|
~CoinsWidget() override;
|
|
|
|
|
2020-12-31 06:54:19 +00:00
|
|
|
public slots:
|
|
|
|
void resetModel();
|
|
|
|
|
2020-10-07 10:36:04 +00:00
|
|
|
private slots:
|
|
|
|
void showHeaderMenu(const QPoint& position);
|
|
|
|
void setShowSpent(bool show);
|
|
|
|
void freezeOutput();
|
|
|
|
void freezeAllSelected();
|
|
|
|
void thawOutput();
|
|
|
|
void thawAllSelected();
|
|
|
|
void viewOutput();
|
|
|
|
void onSweepOutput();
|
|
|
|
|
|
|
|
signals:
|
2021-02-03 23:14:20 +00:00
|
|
|
void freeze(QVector<int> indexes);
|
|
|
|
void thaw(QVector<int> indexes);
|
2020-10-07 10:36:04 +00:00
|
|
|
void sweepOutput(const QString &keyImage, const QString &address, bool isChurn, int outputs);
|
|
|
|
|
|
|
|
private:
|
|
|
|
enum copyField {
|
|
|
|
PubKey = 0,
|
|
|
|
KeyImage,
|
|
|
|
TxID,
|
|
|
|
Address,
|
2020-12-14 01:30:30 +00:00
|
|
|
Label,
|
2020-10-07 10:36:04 +00:00
|
|
|
Height,
|
|
|
|
Amount
|
|
|
|
};
|
|
|
|
|
|
|
|
Ui::CoinsWidget *ui;
|
|
|
|
|
|
|
|
QMenu *m_contextMenu;
|
|
|
|
QMenu *m_copyMenu;
|
|
|
|
QAction *m_showSpentAction;
|
|
|
|
QMenu *m_headerMenu;
|
|
|
|
QAction *m_freezeOutputAction;
|
|
|
|
QAction *m_freezeAllSelectedAction;
|
|
|
|
QAction *m_thawOutputAction;
|
|
|
|
QAction *m_thawAllSelectedAction;
|
|
|
|
QAction *m_viewOutputAction;
|
|
|
|
QAction *m_sweepOutputAction;
|
|
|
|
Coins *m_coins;
|
|
|
|
CoinsModel * m_model;
|
|
|
|
CoinsProxyModel * m_proxyModel;
|
2020-10-14 02:21:38 +00:00
|
|
|
AppContext *m_ctx;
|
2020-10-07 10:36:04 +00:00
|
|
|
|
|
|
|
void showContextMenu(const QPoint & point);
|
|
|
|
void copy(copyField field);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif //FEATHER_COINSWIDGET_H
|