Raven Core  3.0.0
P2P Digital Currency
assetsdialog.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_ASSETSDIALOG_H
7 #define RAVEN_QT_ASSETSDIALOG_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 SendAssetsEntry;
19 class SendCoinsRecipient;
20 
21 namespace Ui {
22  class AssetsDialog;
23 }
24 
25 QT_BEGIN_NAMESPACE
26 class QUrl;
27 QT_END_NAMESPACE
28 
30 class AssetsDialog : public QDialog
31 {
32  Q_OBJECT
33 
34 public:
35  explicit AssetsDialog(const PlatformStyle *platformStyle, QWidget *parent = 0);
36  ~AssetsDialog();
37 
38  void setClientModel(ClientModel *clientModel);
39  void setModel(WalletModel *model);
40  void setupAssetControlFrame(const PlatformStyle *platformStyle);
41  void setupScrollView(const PlatformStyle *platformStyle);
42  void setupFeeControl(const PlatformStyle *platformStyle);
43 
46  QWidget *setupTabChain(QWidget *prev);
47 
48  void setAddress(const QString &address);
49  void pasteEntry(const SendAssetsRecipient &rv);
50  bool handlePaymentRequest(const SendAssetsRecipient &recipient);
51  void processNewTransaction();
52 
53  // The first time the transfer asset screen is loaded, the wallet isn't doing loading so the asset list is empty.
54  // The first time the screen is navigated to, refresh the asset list
55  void handleFirstSelection();
56 
57 public Q_SLOTS:
58  void clear();
59  void reject();
60  void accept();
61  SendAssetsEntry *addEntry();
62  void updateTabsAndLabels();
63  void setBalance(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance,
64  const CAmount& watchOnlyBalance, const CAmount& watchUnconfBalance, const CAmount& watchImmatureBalance);
65  void focusAssetListBox();
66 
67 private:
68  Ui::AssetsDialog *ui;
74 
75  // Process WalletModel::SendCoinsReturn and generate a pair consisting
76  // of a message and message flags for use in Q_EMIT message().
77  // Additional parameter msgArg can be used via .arg(msgArg).
78  void processSendCoinsReturn(const WalletModel::SendCoinsReturn &sendCoinsReturn, const QString &msgArg = QString());
79  void minimizeFeeSection(bool fMinimize);
80  void updateFeeMinimizedLabel();
81  // Update the passed in CCoinControl with state from the GUI
82  void updateAssetControlState(CCoinControl& ctrl);
83 
84 
85 
86 private Q_SLOTS:
87  void on_sendButton_clicked();
88  void on_buttonChooseFee_clicked();
89  void on_buttonMinimizeFee_clicked();
90  void removeEntry(SendAssetsEntry* entry);
91  void updateDisplayUnit();
92  void assetControlFeatureChanged(bool);
93  void assetControlButtonClicked();
94  void assetControlChangeChecked(int);
95  void assetControlChangeEdited(const QString &);
96  void assetControlUpdateLabels();
97  void assetControlClipboardQuantity();
98  void assetControlClipboardAmount();
99  void assetControlClipboardFee();
100  void assetControlClipboardAfterFee();
101  void assetControlClipboardBytes();
102  void assetControlClipboardLowOutput();
103  void assetControlClipboardChange();
104  void setMinimumFee();
105  void updateFeeSectionControls();
106  void updateMinFeeLabel();
107  void updateSmartFeeLabel();
108 
109  void customFeeFeatureChanged(bool);
110 
112  void assetControlUpdateSendCoinsDialog();
113  void focusAsset(const QModelIndex& index);
116  Q_SIGNALS:
117  // Fired when a message should be reported to the user
118  void message(const QString &title, const QString &message, unsigned int style);
119 };
120 
121 #endif // RAVEN_QT_ASSETSSDIALOG_H
ClientModel * clientModel
Definition: assetsdialog.h:69
Coin Control Features.
Definition: coincontrol.h:17
A single entry in the dialog for sending ravens.
int64_t CAmount
Amount in corbies (Can be negative)
Definition: amount.h:13
bool fFeeMinimized
Definition: assetsdialog.h:72
Ui::AssetsDialog * ui
Definition: assetsdialog.h:68
Model for Raven network client.
Definition: clientmodel.h:39
WalletModel * model
Definition: assetsdialog.h:70
Interface to Raven wallet from Qt view code.
Definition: walletmodel.h:165
const PlatformStyle * platformStyle
Definition: assetsdialog.h:73
Dialog for sending ravens.
Definition: assetsdialog.h:30
bool fNewRecipientAllowed
Definition: assetsdialog.h:71