BSHA3  0.17.99
P2P Blockchain, based on Bitcoin
sendcoinsdialog.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2018 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/walletmodel.h>
9 
10 #include <QDialog>
11 #include <QMessageBox>
12 #include <QString>
13 #include <QTimer>
14 
15 class ClientModel;
16 class PlatformStyle;
17 class SendCoinsEntry;
18 class SendCoinsRecipient;
19 
20 namespace Ui {
21  class SendCoinsDialog;
22 }
23 
24 QT_BEGIN_NAMESPACE
25 class QUrl;
26 QT_END_NAMESPACE
27 
29 class SendCoinsDialog : public QDialog
30 {
31  Q_OBJECT
32 
33 public:
34  explicit SendCoinsDialog(const PlatformStyle *platformStyle, QWidget *parent = 0);
36 
38  void setModel(WalletModel *model);
39 
42  QWidget *setupTabChain(QWidget *prev);
43 
44  void setAddress(const QString &address);
45  void pasteEntry(const SendCoinsRecipient &rv);
46  bool handlePaymentRequest(const SendCoinsRecipient &recipient);
47 
48 public Q_SLOTS:
49  void clear();
50  void reject();
51  void accept();
53  void updateTabsAndLabels();
54  void setBalance(const interfaces::WalletBalances& balances);
55 
56 Q_SIGNALS:
57  void coinsSent(const uint256& txid);
58 
59 private:
60  Ui::SendCoinsDialog *ui;
66 
67  // Process WalletModel::SendCoinsReturn and generate a pair consisting
68  // of a message and message flags for use in Q_EMIT message().
69  // Additional parameter msgArg can be used via .arg(msgArg).
70  void processSendCoinsReturn(const WalletModel::SendCoinsReturn &sendCoinsReturn, const QString &msgArg = QString());
71  void minimizeFeeSection(bool fMinimize);
73  // Update the passed in CCoinControl with state from the GUI
75 
76 private Q_SLOTS:
77  void on_sendButton_clicked();
80  void removeEntry(SendCoinsEntry* entry);
82  void updateDisplayUnit();
83  void coinControlFeatureChanged(bool);
85  void coinControlChangeChecked(int);
86  void coinControlChangeEdited(const QString &);
95  void setMinimumFee();
97  void updateMinFeeLabel();
98  void updateSmartFeeLabel();
99 
100 Q_SIGNALS:
101  // Fired when a message should be reported to the user
102  void message(const QString &title, const QString &message, unsigned int style);
103 };
104 
105 
106 #define SEND_CONFIRM_DELAY 3
107 
108 class SendConfirmationDialog : public QMessageBox
109 {
110  Q_OBJECT
111 
112 public:
113  SendConfirmationDialog(const QString &title, const QString &text, int secDelay = SEND_CONFIRM_DELAY, QWidget *parent = 0);
114  int exec();
115 
116 private Q_SLOTS:
117  void countDown();
118  void updateYesButton();
119 
120 private:
121  QAbstractButton *yesButton;
123  int secDelay;
124 };
125 
126 #endif // BITCOIN_QT_SENDCOINSDIALOG_H
void removeEntry(SendCoinsEntry *entry)
void updateFeeMinimizedLabel()
void on_buttonChooseFee_clicked()
void coinControlClipboardQuantity()
void coinControlClipboardAfterFee()
#define SEND_CONFIRM_DELAY
void updateCoinControlState(CCoinControl &ctrl)
bool handlePaymentRequest(const SendCoinsRecipient &recipient)
A single entry in the dialog for sending bitcoins.
Coin Control Features.
Definition: coincontrol.h:16
void coinControlFeatureChanged(bool)
QWidget * setupTabChain(QWidget *prev)
Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue https://...
Ui::SendCoinsDialog * ui
SendCoinsEntry * addEntry()
void setBalance(const interfaces::WalletBalances &balances)
void setAddress(const QString &address)
void coinControlClipboardChange()
Collection of wallet balances.
Definition: wallet.h:310
void useAvailableBalance(SendCoinsEntry *entry)
void setClientModel(ClientModel *clientModel)
ClientModel * clientModel
WalletModel * model
Dialog for sending bitcoins.
void coinControlChangeEdited(const QString &)
Model for Bitcoin network client.
Definition: clientmodel.h:44
void coinControlUpdateLabels()
void setModel(WalletModel *model)
void coinControlClipboardLowOutput()
void minimizeFeeSection(bool fMinimize)
void updateFeeSectionControls()
256-bit opaque blob.
Definition: uint256.h:122
Interface to Bitcoin wallet from Qt view code.
Definition: walletmodel.h:125
SendCoinsDialog(const PlatformStyle *platformStyle, QWidget *parent=0)
SendConfirmationDialog(const QString &title, const QString &text, int secDelay=SEND_CONFIRM_DELAY, QWidget *parent=0)
void processSendCoinsReturn(const WalletModel::SendCoinsReturn &sendCoinsReturn, const QString &msgArg=QString())
void coinControlClipboardBytes()
const PlatformStyle * platformStyle
void coinControlClipboardAmount()
void on_buttonMinimizeFee_clicked()
void pasteEntry(const SendCoinsRecipient &rv)
QAbstractButton * yesButton
void message(const QString &title, const QString &message, unsigned int style)
void coinsSent(const uint256 &txid)
void coinControlButtonClicked()
void coinControlClipboardFee()
void coinControlChangeChecked(int)