feather/src/CoinsWidget.h

93 lines
2.2 KiB
C
Raw Normal View History

// SPDX-License-Identifier: BSD-3-Clause
2023-01-02 19:30:11 +00:00
// SPDX-FileCopyrightText: 2020-2023 The Monero Project
#ifndef FEATHER_COINSWIDGET_H
#define FEATHER_COINSWIDGET_H
2021-06-28 17:48:23 +00:00
#include <QMenu>
#include <QWidget>
2022-05-24 13:18:43 +00:00
#include <QSvgWidget>
2021-06-28 17:48:23 +00:00
#include "appcontext.h"
#include "model/CoinsModel.h"
#include "model/CoinsProxyModel.h"
#include "libwalletqt/Coins.h"
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);
void setModel(CoinsModel * model, Coins * coins);
~CoinsWidget() override;
2022-03-20 22:30:48 +00:00
void setSpendSelected(const QStringList &pubkeys);
signals:
void spendSelectedChanged(const QStringList &pubkeys);
2021-06-28 17:20:16 +00:00
public slots:
void setSearchbarVisible(bool visible);
2021-07-02 14:51:46 +00:00
void focusSearchbar();
2021-06-28 17:20:16 +00:00
private slots:
void showHeaderMenu(const QPoint& position);
void setShowSpent(bool show);
void freezeAllSelected();
void thawAllSelected();
2022-03-20 22:30:48 +00:00
void spendSelected();
void viewOutput();
void onSweepOutputs();
2021-06-28 17:20:16 +00:00
void setSearchFilter(const QString &filter);
2021-07-02 15:27:26 +00:00
void editLabel();
private:
2021-10-01 13:37:20 +00:00
void freezeCoins(QStringList &pubkeys);
void thawCoins(QStringList &pubkeys);
2022-03-20 22:30:48 +00:00
void selectCoins(const QStringList &pubkeys);
2021-05-02 18:22:38 +00:00
enum copyField {
PubKey = 0,
KeyImage,
TxID,
Address,
2020-12-14 01:30:30 +00:00
Label,
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;
QMenu *m_contextMenu;
2021-05-10 13:20:33 +00:00
QMenu *m_headerMenu;
QMenu *m_copyMenu;
2022-03-20 22:30:48 +00:00
QAction *m_spendAction;
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;
2021-07-02 15:27:26 +00:00
QAction *m_editLabelAction;
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();
2021-10-01 13:37:20 +00:00
QStringList selectedPubkeys();
};
#endif //FEATHER_COINSWIDGET_H