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 SENDWIDGET_H
|
|
|
|
#define SENDWIDGET_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
#include "appcontext.h"
|
|
|
|
#include "widgets/ccswidget.h"
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class SendWidget;
|
|
|
|
}
|
|
|
|
|
|
|
|
class SendWidget : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit SendWidget(QWidget *parent = nullptr);
|
|
|
|
void fill(const CCSEntry &entry);
|
2020-12-14 00:59:32 +00:00
|
|
|
void fill(const QString &address, const QString& description, double amount = 0);
|
2020-10-07 10:36:04 +00:00
|
|
|
void fill(double amount);
|
|
|
|
void clearFields();
|
|
|
|
~SendWidget() override;
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void sendClicked();
|
|
|
|
void clearClicked();
|
|
|
|
void aliasClicked();
|
|
|
|
void btnMaxClicked();
|
|
|
|
void amountEdited(const QString &text);
|
|
|
|
void addressEdited(const QString &text);
|
|
|
|
void currencyComboChanged(int index);
|
|
|
|
void fillAddress(const QString &address);
|
|
|
|
void updateConversionLabel();
|
|
|
|
void onOpenAliasResolveError(const QString &err);
|
|
|
|
void onOpenAliasResolved(const QString &address, const QString &openAlias);
|
|
|
|
void onWalletClosed();
|
2020-10-15 02:17:57 +00:00
|
|
|
void onPreferredFiatCurrencyChanged();
|
2020-10-07 10:36:04 +00:00
|
|
|
|
|
|
|
void onInitiateTransaction();
|
|
|
|
void onEndTransaction();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void resolveOpenAlias(const QString &address);
|
2020-12-31 03:26:03 +00:00
|
|
|
void createTransaction(const QString &address, quint64 amount, const QString &description, bool all);
|
2020-10-07 10:36:04 +00:00
|
|
|
|
|
|
|
private:
|
2020-11-24 21:16:24 +00:00
|
|
|
void setupComboBox();
|
2020-12-31 03:26:03 +00:00
|
|
|
double amountDouble();
|
2020-11-24 21:16:24 +00:00
|
|
|
|
2020-10-07 10:36:04 +00:00
|
|
|
Ui::SendWidget *ui;
|
|
|
|
AppContext *m_ctx;
|
2020-12-31 03:26:03 +00:00
|
|
|
quint64 amount();
|
2020-10-07 10:36:04 +00:00
|
|
|
double conversionAmount();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SENDWIDGET_H
|