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.
5 #ifndef BITCOIN_QT_SENDCOINSDIALOG_H
6 #define BITCOIN_QT_SENDCOINSDIALOG_H
8 #include "walletmodel.h"
11 #include <QMessageBox>
18 class SendCoinsRecipient
;
21 class SendCoinsDialog
;
28 /** Dialog for sending bitcoins */
29 class SendCoinsDialog
: public QDialog
34 explicit SendCoinsDialog(const PlatformStyle
*platformStyle
, QWidget
*parent
= 0);
37 void setClientModel(ClientModel
*clientModel
);
38 void setModel(WalletModel
*model
);
40 /** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907).
42 QWidget
*setupTabChain(QWidget
*prev
);
44 void setAddress(const QString
&address
);
45 void pasteEntry(const SendCoinsRecipient
&rv
);
46 bool handlePaymentRequest(const SendCoinsRecipient
&recipient
);
52 SendCoinsEntry
*addEntry();
53 void updateTabsAndLabels();
54 void setBalance(const CAmount
& balance
, const CAmount
& unconfirmedBalance
, const CAmount
& immatureBalance
,
55 const CAmount
& watchOnlyBalance
, const CAmount
& watchUnconfBalance
, const CAmount
& watchImmatureBalance
);
58 Ui::SendCoinsDialog
*ui
;
59 ClientModel
*clientModel
;
61 bool fNewRecipientAllowed
;
63 const PlatformStyle
*platformStyle
;
65 // Process WalletModel::SendCoinsReturn and generate a pair consisting
66 // of a message and message flags for use in Q_EMIT message().
67 // Additional parameter msgArg can be used via .arg(msgArg).
68 void processSendCoinsReturn(const WalletModel::SendCoinsReturn
&sendCoinsReturn
, const QString
&msgArg
= QString());
69 void minimizeFeeSection(bool fMinimize
);
70 void updateFeeMinimizedLabel();
71 // Update the passed in CCoinControl with state from the GUI
72 void updateCoinControlState(CCoinControl
& ctrl
);
75 void on_sendButton_clicked();
76 void on_buttonChooseFee_clicked();
77 void on_buttonMinimizeFee_clicked();
78 void removeEntry(SendCoinsEntry
* entry
);
79 void updateDisplayUnit();
80 void coinControlFeatureChanged(bool);
81 void coinControlButtonClicked();
82 void coinControlChangeChecked(int);
83 void coinControlChangeEdited(const QString
&);
84 void coinControlUpdateLabels();
85 void coinControlClipboardQuantity();
86 void coinControlClipboardAmount();
87 void coinControlClipboardFee();
88 void coinControlClipboardAfterFee();
89 void coinControlClipboardBytes();
90 void coinControlClipboardLowOutput();
91 void coinControlClipboardChange();
93 void updateFeeSectionControls();
94 void updateMinFeeLabel();
95 void updateSmartFeeLabel();
98 // Fired when a message should be reported to the user
99 void message(const QString
&title
, const QString
&message
, unsigned int style
);
103 #define SEND_CONFIRM_DELAY 3
105 class SendConfirmationDialog
: public QMessageBox
110 SendConfirmationDialog(const QString
&title
, const QString
&text
, int secDelay
= SEND_CONFIRM_DELAY
, QWidget
*parent
= 0);
115 void updateYesButton();
118 QAbstractButton
*yesButton
;
119 QTimer countDownTimer
;
123 #endif // BITCOIN_QT_SENDCOINSDIALOG_H