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"
|
|
|
|
|
2021-05-02 18:22:38 +00:00
|
|
|
#include <QMenu>
|
2020-10-07 10:36:04 +00:00
|
|
|
#include <QWidget>
|
|
|
|
#include <QtSvg/QSvgWidget>
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class CoinsWidget;
|
|
|
|
}
|
|
|
|
|
|
|
|
class CoinsWidget : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2021-05-18 15:59:18 +00:00
|
|
|
explicit CoinsWidget(QSharedPointer<AppContext> ctx, QWidget *parent = nullptr);
|
2020-10-07 10:36:04 +00:00
|
|
|
void setModel(CoinsModel * model, Coins * coins);
|
|
|
|
~CoinsWidget() override;
|
|
|
|
|
2021-06-28 17:20:16 +00:00
|
|
|
public slots:
|
|
|
|
void setSearchbarVisible(bool visible);
|
|
|
|
|
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();
|
2021-06-28 16:05:21 +00:00
|
|
|
void onSweepMulti();
|
2021-06-28 17:20:16 +00:00
|
|
|
void setSearchFilter(const QString &filter);
|
2020-10-07 10:36:04 +00:00
|
|
|
|
|
|
|
private:
|
2021-05-02 18:22:38 +00:00
|
|
|
void freezeCoins(const QVector<int>& indexes);
|
|
|
|
void thawCoins(const QVector<int>& indexes);
|
|
|
|
|
2020-10-07 10:36:04 +00:00
|
|
|
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
|
|
|
|
};
|
|
|
|
|
2021-06-27 12:13:05 +00:00
|
|
|
QScopedPointer<Ui::CoinsWidget> ui;
|
2021-05-18 15:59:18 +00:00
|
|
|
QSharedPointer<AppContext> m_ctx;
|
2020-10-07 10:36:04 +00:00
|
|
|
|
|
|
|
QMenu *m_contextMenu;
|
2021-05-10 13:20:33 +00:00
|
|
|
QMenu *m_headerMenu;
|
2020-10-07 10:36:04 +00:00
|
|
|
QMenu *m_copyMenu;
|
|
|
|
QAction *m_showSpentAction;
|
|
|
|
QAction *m_freezeOutputAction;
|
|
|
|
QAction *m_freezeAllSelectedAction;
|
|
|
|
QAction *m_thawOutputAction;
|
|
|
|
QAction *m_thawAllSelectedAction;
|
|
|
|
QAction *m_viewOutputAction;
|
|
|
|
QAction *m_sweepOutputAction;
|
2021-06-28 16:05:21 +00:00
|
|
|
QAction *m_sweepOutputsAction;
|
2020-10-07 10:36:04 +00:00
|
|
|
Coins *m_coins;
|
|
|
|
CoinsModel * m_model;
|
|
|
|
CoinsProxyModel * m_proxyModel;
|
|
|
|
|
|
|
|
void showContextMenu(const QPoint & point);
|
|
|
|
void copy(copyField field);
|
2021-03-14 21:12:02 +00:00
|
|
|
CoinsInfo* currentEntry();
|
2021-06-28 16:05:21 +00:00
|
|
|
QVector<CoinsInfo*> currentEntries();
|
2020-10-07 10:36:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif //FEATHER_COINSWIDGET_H
|