forked from dashpay/dash
/
send.h
103 lines (83 loc) · 2.74 KB
/
send.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
// Copyright (c) 2019 The PIVX developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef SEND_H
#define SEND_H
#include <QWidget>
#include <QPushButton>
#include "qt/pivx/pwidget.h"
#include "qt/pivx/contactsdropdown.h"
#include "qt/pivx/sendmultirow.h"
#include "qt/pivx/sendcustomfeedialog.h"
#include "walletmodel.h"
#include "coincontroldialog.h"
#include "zpivcontroldialog.h"
#include "qt/pivx/tooltipmenu.h"
static const int MAX_SEND_POPUP_ENTRIES = 8;
class PIVXGUI;
class ClientModel;
class WalletModel;
class WalletModelTransaction;
namespace Ui {
class send;
class QPushButton;
}
class SendWidget : public PWidget
{
Q_OBJECT
public:
explicit SendWidget(PIVXGUI* parent);
~SendWidget();
void addEntry();
void loadClientModel() override;
void loadWalletModel() override;
signals:
/** Signal raised when a URI was entered or dragged to the GUI */
void receivedURI(const QString& uri);
public slots:
void onChangeAddressClicked();
void onChangeCustomFeeClicked();
void onCoinControlClicked();
void onOpenUriClicked();
void onValueChanged();
void refreshAmounts();
protected:
void resizeEvent(QResizeEvent *event) override;
private slots:
void onPIVSelected(bool _isPIV);
void onSendClicked();
void onContactsClicked(SendMultiRow* entry);
void onMenuClicked(SendMultiRow* entry);
void onAddEntryClicked();
void clearEntries();
void clearAll();
void refreshView();
void onContactMultiClicked();
void onDeleteClicked();
void onResetCustomOptions();
private:
Ui::send *ui;
QPushButton *coinIcon;
QPushButton *btnContacts;
SendCustomFeeDialog* customFeeDialog = nullptr;
bool isCustomFeeSelected = false;
int nDisplayUnit;
QList<SendMultiRow*> entries;
CoinControlDialog *coinControlDialog = nullptr;
ContactsDropdown *menuContacts = nullptr;
TooltipMenu *menu = nullptr;
// Current focus entry
SendMultiRow* focusedEntry = nullptr;
bool isPIV = true;
void resizeMenu();
QString recipientsToString(QList<SendCoinsRecipient> recipients);
SendMultiRow* createEntry();
bool send(QList<SendCoinsRecipient> recipients);
bool sendZpiv(QList<SendCoinsRecipient> recipients);
void updateEntryLabels(QList<SendCoinsRecipient> recipients);
// Process WalletModel::SendCoinsReturn and generate a pair consisting
// of a message and message flags for use in emit message().
// Additional parameter msgArg can be used via .arg(msgArg).
void processSendCoinsReturn(const WalletModel::SendCoinsReturn& sendCoinsReturn, const QString& msgArg = QString(), bool fPrepare = false);
};
#endif // SEND_H