Raven Core  3.0.0
P2P Digital Currency
sendcoinsdialog.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2016 The Bitcoin Core developers
2 // Copyright (c) 2017-2019 The Raven Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #ifndef RAVEN_QT_SENDCOINSDIALOG_H
7 #define RAVEN_QT_SENDCOINSDIALOG_H
8 
9 #include "walletmodel.h"
10 
11 #include <QDialog>
12 #include <QMessageBox>
13 #include <QString>
14 #include <QTimer>
15 
16 class ClientModel;
17 class PlatformStyle;
18 class SendCoinsEntry;
19 class SendCoinsRecipient;
20 
21 namespace Ui {
22  class SendCoinsDialog;
23 }
24 
25 QT_BEGIN_NAMESPACE
26 class QUrl;
27 QT_END_NAMESPACE
28 
30 class SendCoinsDialog : public QDialog
31 {
32  Q_OBJECT
33 
34 public:
35  explicit SendCoinsDialog(const PlatformStyle *platformStyle, QWidget *parent = 0);
36  ~SendCoinsDialog();
37 
38  void setClientModel(ClientModel *clientModel);
39  void setModel(WalletModel *model);
40 
43  QWidget *setupTabChain(QWidget *prev);
44 
45  void setAddress(const QString &address);
46  void pasteEntry(const SendCoinsRecipient &rv);
47  bool handlePaymentRequest(const SendCoinsRecipient &recipient);
48 
49  void setupCoinControl(const PlatformStyle *platformStyle);
50  void setupScrollView(const PlatformStyle *platformStyle);
51  void setupFeeControl(const PlatformStyle *platformStyle);
52 public Q_SLOTS:
53  void clear();
54  void reject();
55  void accept();
56  SendCoinsEntry *addEntry();
57  void updateTabsAndLabels();
58  void setBalance(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance,
59  const CAmount& watchOnlyBalance, const CAmount& watchUnconfBalance, const CAmount& watchImmatureBalance);
60 
61 private:
62  Ui::SendCoinsDialog *ui;
68 
69  // Process WalletModel::SendCoinsReturn and generate a pair consisting
70  // of a message and message flags for use in Q_EMIT message().
71  // Additional parameter msgArg can be used via .arg(msgArg).
72  void processSendCoinsReturn(const WalletModel::SendCoinsReturn &sendCoinsReturn, const QString &msgArg = QString());
73  void minimizeFeeSection(bool fMinimize);
74  void updateFeeMinimizedLabel();
75  // Update the passed in CCoinControl with state from the GUI
76  void updateCoinControlState(CCoinControl& ctrl);
77 
78 private Q_SLOTS:
79  void on_sendButton_clicked();
80  void on_buttonChooseFee_clicked();
81  void on_buttonMinimizeFee_clicked();
82  void removeEntry(SendCoinsEntry* entry);
83  void updateDisplayUnit();
84  void coinControlFeatureChanged(bool);
85  void coinControlButtonClicked();
86  void coinControlChangeChecked(int);
87  void coinControlChangeEdited(const QString &);
88  void coinControlUpdateLabels();
89  void coinControlClipboardQuantity();
90  void coinControlClipboardAmount();
91  void coinControlClipboardFee();
92  void coinControlClipboardAfterFee();
93  void coinControlClipboardBytes();
94  void coinControlClipboardLowOutput();
95  void coinControlClipboardChange();
96  void setMinimumFee();
97  void updateFeeSectionControls();
98  void updateMinFeeLabel();
99  void updateSmartFeeLabel();
100 
101 Q_SIGNALS:
102  // Fired when a message should be reported to the user
103  void message(const QString &title, const QString &message, unsigned int style);
104 };
105 
106 
107 #define SEND_CONFIRM_DELAY 3
108 
109 class SendConfirmationDialog : public QMessageBox
110 {
111  Q_OBJECT
112 
113 public:
114  SendConfirmationDialog(const QString &title, const QString &text, int secDelay = SEND_CONFIRM_DELAY, QWidget *parent = 0);
115  int exec();
116 
117 private Q_SLOTS:
118  void countDown();
119  void updateYesButton();
120 
121 private:
122  QAbstractButton *yesButton;
124  int secDelay;
125 };
126 
127 #endif // RAVEN_QT_SENDCOINSDIALOG_H
#define SEND_CONFIRM_DELAY
A single entry in the dialog for sending ravens.
Coin Control Features.
Definition: coincontrol.h:17
int64_t CAmount
Amount in corbies (Can be negative)
Definition: amount.h:13
Ui::SendCoinsDialog * ui
ClientModel * clientModel
WalletModel * model
Dialog for sending ravens.
Model for Raven network client.
Definition: clientmodel.h:39
Interface to Raven wallet from Qt view code.
Definition: walletmodel.h:165
const PlatformStyle * platformStyle
QAbstractButton * yesButton