Support more than one CScheduler thread for serial clients
[bitcoinplatinum.git] / src / qt / sendcoinsdialog.h
blobff7040ac5b380568f4ae77edf6dfa4162cb5ab07
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"
10 #include <QDialog>
11 #include <QMessageBox>
12 #include <QString>
13 #include <QTimer>
15 class ClientModel;
16 class PlatformStyle;
17 class SendCoinsEntry;
18 class SendCoinsRecipient;
20 namespace Ui {
21 class SendCoinsDialog;
24 QT_BEGIN_NAMESPACE
25 class QUrl;
26 QT_END_NAMESPACE
28 /** Dialog for sending bitcoins */
29 class SendCoinsDialog : public QDialog
31 Q_OBJECT
33 public:
34 explicit SendCoinsDialog(const PlatformStyle *platformStyle, QWidget *parent = 0);
35 ~SendCoinsDialog();
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);
48 public Q_SLOTS:
49 void clear();
50 void reject();
51 void accept();
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);
57 private:
58 Ui::SendCoinsDialog *ui;
59 ClientModel *clientModel;
60 WalletModel *model;
61 bool fNewRecipientAllowed;
62 bool fFeeMinimized;
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();
72 private Q_SLOTS:
73 void on_sendButton_clicked();
74 void on_buttonChooseFee_clicked();
75 void on_buttonMinimizeFee_clicked();
76 void removeEntry(SendCoinsEntry* entry);
77 void updateDisplayUnit();
78 void coinControlFeatureChanged(bool);
79 void coinControlButtonClicked();
80 void coinControlChangeChecked(int);
81 void coinControlChangeEdited(const QString &);
82 void coinControlUpdateLabels();
83 void coinControlClipboardQuantity();
84 void coinControlClipboardAmount();
85 void coinControlClipboardFee();
86 void coinControlClipboardAfterFee();
87 void coinControlClipboardBytes();
88 void coinControlClipboardLowOutput();
89 void coinControlClipboardChange();
90 void setMinimumFee();
91 void updateFeeSectionControls();
92 void updateMinFeeLabel();
93 void updateSmartFeeLabel();
94 void updateGlobalFeeVariables();
96 Q_SIGNALS:
97 // Fired when a message should be reported to the user
98 void message(const QString &title, const QString &message, unsigned int style);
102 #define SEND_CONFIRM_DELAY 3
104 class SendConfirmationDialog : public QMessageBox
106 Q_OBJECT
108 public:
109 SendConfirmationDialog(const QString &title, const QString &text, int secDelay = SEND_CONFIRM_DELAY, QWidget *parent = 0);
110 int exec();
112 private Q_SLOTS:
113 void countDown();
114 void updateYesButton();
116 private:
117 QAbstractButton *yesButton;
118 QTimer countDownTimer;
119 int secDelay;
122 #endif // BITCOIN_QT_SENDCOINSDIALOG_H