Bitcoin ABC 0.30.5
P2P Digital Currency
sendcoinsdialog.h
Go to the documentation of this file.
1// Copyright (c) 2011-2016 The Bitcoin Core developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#ifndef BITCOIN_QT_SENDCOINSDIALOG_H
6#define BITCOIN_QT_SENDCOINSDIALOG_H
7
8#include <qt/clientmodel.h>
9#include <qt/walletmodel.h>
10
11#include <QDialog>
12#include <QMessageBox>
13#include <QString>
14#include <QTimer>
15
16class CCoinControl;
17class PlatformStyle;
18class SendCoinsEntry;
20enum class SynchronizationState;
21
22namespace Ui {
23class SendCoinsDialog;
24}
25
26QT_BEGIN_NAMESPACE
27class QUrl;
28QT_END_NAMESPACE
29
31class SendCoinsDialog : public QDialog {
32 Q_OBJECT
33
34public:
36 QWidget *parent = nullptr);
38
41
47 QWidget *setupTabChain(QWidget *prev);
48
49 void setAddress(const QString &address);
50 void pasteEntry(const SendCoinsRecipient &rv);
51 bool handlePaymentRequest(const SendCoinsRecipient &recipient);
52
53public Q_SLOTS:
54 void clear();
55 void reject() override;
56 void accept() override;
59 void setBalance(const interfaces::WalletBalances &balances);
60
61Q_SIGNALS:
62 void coinsSent(const uint256 &txid);
63
64private:
65 Ui::SendCoinsDialog *ui;
68 std::unique_ptr<CCoinControl> m_coin_control;
69 std::unique_ptr<WalletModelTransaction> m_current_transaction;
73
74 // Process WalletModel::SendCoinsReturn and generate a pair consisting of a
75 // message and message flags for use in Q_EMIT message().
76 // Additional parameter msgArg can be used via .arg(msgArg).
77 void
79 const QString &msgArg = QString());
80 void minimizeFeeSection(bool fMinimize);
81 // Format confirmation message
82 bool PrepareSendText(QString &question_string, QString &informative_text,
83 QString &detailed_text);
85 // Update the passed in CCoinControl with state from the GUI
87
88private Q_SLOTS:
92 void removeEntry(SendCoinsEntry *entry);
94 void updateDisplayUnit();
98 void coinControlChangeEdited(const QString &);
108 void updateNumberOfBlocks(int count, const QDateTime &blockDate,
109 double nVerificationProgress, SyncType synctype,
110 SynchronizationState sync_state);
111 void updateSmartFeeLabel();
112
113Q_SIGNALS:
114 // Fired when a message should be reported to the user
115 void message(const QString &title, const QString &message,
116 unsigned int style);
117};
118
119#define SEND_CONFIRM_DELAY 3
120
121class SendConfirmationDialog : public QMessageBox {
122 Q_OBJECT
123
124public:
125 SendConfirmationDialog(const QString &title, const QString &text,
126 const QString &informative_text = "",
127 const QString &detailed_text = "",
129 const QString &confirmText = "Send",
130 QWidget *parent = nullptr);
131 int exec() override;
132
133private Q_SLOTS:
134 void countDown();
135 void updateYesButton();
136
137private:
138 QAbstractButton *yesButton;
142};
143
144#endif // BITCOIN_QT_SENDCOINSDIALOG_H
Coin Control Features.
Definition: coincontrol.h:21
Model for Bitcoin network client.
Definition: clientmodel.h:43
Dialog for sending bitcoins.
void useAvailableBalance(SendCoinsEntry *entry)
WalletModel * model
ClientModel * clientModel
void coinControlChangeEdited(const QString &)
void coinControlChangeChecked(int)
void coinControlClipboardFee()
Ui::SendCoinsDialog * ui
void on_buttonChooseFee_clicked()
void processSendCoinsReturn(const WalletModel::SendCoinsReturn &sendCoinsReturn, const QString &msgArg=QString())
void setClientModel(ClientModel *clientModel)
void updateFeeSectionControls()
std::unique_ptr< CCoinControl > m_coin_control
SendCoinsEntry * addEntry()
void updateNumberOfBlocks(int count, const QDateTime &blockDate, double nVerificationProgress, SyncType synctype, SynchronizationState sync_state)
void pasteEntry(const SendCoinsRecipient &rv)
void updateFeeMinimizedLabel()
void accept() override
const PlatformStyle * platformStyle
void coinControlClipboardQuantity()
void coinControlButtonClicked()
void coinControlClipboardAfterFee()
QWidget * setupTabChain(QWidget *prev)
Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue https://...
bool PrepareSendText(QString &question_string, QString &informative_text, QString &detailed_text)
void setModel(WalletModel *model)
void coinControlClipboardLowOutput()
bool handlePaymentRequest(const SendCoinsRecipient &recipient)
SendCoinsDialog(const PlatformStyle *platformStyle, WalletModel *model, QWidget *parent=nullptr)
void setBalance(const interfaces::WalletBalances &balances)
void coinControlClipboardAmount()
void updateCoinControlState(CCoinControl &ctrl)
void setAddress(const QString &address)
void coinControlClipboardChange()
std::unique_ptr< WalletModelTransaction > m_current_transaction
void removeEntry(SendCoinsEntry *entry)
void reject() override
void coinControlClipboardBytes()
void message(const QString &title, const QString &message, unsigned int style)
void coinsSent(const uint256 &txid)
void on_buttonMinimizeFee_clicked()
void coinControlUpdateLabels()
void coinControlFeatureChanged(bool)
void minimizeFeeSection(bool fMinimize)
A single entry in the dialog for sending bitcoins.
SendConfirmationDialog(const QString &title, const QString &text, const QString &informative_text="", const QString &detailed_text="", int secDelay=SEND_CONFIRM_DELAY, const QString &confirmText="Send", QWidget *parent=nullptr)
QAbstractButton * yesButton
Interface to Bitcoin wallet from Qt view code.
Definition: walletmodel.h:47
256-bit opaque blob.
Definition: uint256.h:129
SyncType
Definition: clientmodel.h:40
#define SEND_CONFIRM_DELAY
Collection of wallet balances.
Definition: wallet.h:347
static int count
Definition: tests.c:31
SynchronizationState
Current sync state passed to tip changed callbacks.
Definition: validation.h:114