Raven Core  3.0.0
P2P Digital Currency
createassetdialog.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2014 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_CREATEASSETDIALOG_H
7 #define RAVEN_QT_CREATEASSETDIALOG_H
8 
9 #include "walletmodel.h"
10 
11 #include <QDialog>
12 
13 class PlatformStyle;
14 class WalletModel;
15 class ClientModel;
16 
17 namespace Ui {
18  class CreateAssetDialog;
19 }
20 
21 QT_BEGIN_NAMESPACE
22 class QModelIndex;
23 class QStringListModel;
24 class QSortFilterProxyModel;
25 class QCompleter;
26 QT_END_NAMESPACE
27 
29 class CreateAssetDialog : public QDialog
30 {
31 Q_OBJECT
32 
33 public:
34  explicit CreateAssetDialog(const PlatformStyle *platformStyle, QWidget *parent = 0);
36 
37  void setClientModel(ClientModel *clientModel);
38  void setModel(WalletModel *model);
39 
40  int type;
41  QString format;
42 
43 
44  void setupCoinControlFrame(const PlatformStyle *platformStyle);
45  void setupAssetDataView(const PlatformStyle *platformStyle);
46  void setupFeeControl(const PlatformStyle *platformStyle);
47 
48  void updateAssetList();
49 
50  void clear();
51  void selectTypeName(int type, QString name);
52 
53  QStringListModel* stringModel;
54  QSortFilterProxyModel* proxy;
55  QCompleter* completer;
56 
57 private:
58  Ui::CreateAssetDialog *ui;
63 
64  bool checkedAvailablity = false;
65 
66  void toggleIPFSText();
67  void setUpValues();
68  void showMessage(QString string);
69  void showValidMessage(QString string);
70  void hideMessage();
71  void disableCreateButton();
72  void enableCreateButton();
73  void CheckFormState();
74  void updatePresentedAssetName(QString name);
75  QString GetSpecialCharacter();
76  QString GetAssetName();
77  void UpdateAssetNameMaxSize();
78  void UpdateAssetNameToUpper();
79  void setUniqueSelected();
80  void clearSelected();
81 
82  //CoinControl
83  // Update the passed in CCoinControl with state from the GUI
84  void updateCoinControlState(CCoinControl& ctrl);
85 
86  //Fee
87  void updateFeeMinimizedLabel();
88  void minimizeFeeSection(bool fMinimize);
89 
90  //Validation
91  bool checkIPFSHash(QString hash);
92 
93 private Q_SLOTS:
94  void ipfsStateChanged();
95  void checkAvailabilityClicked();
96  void onNameChanged(QString name);
97  void onAddressNameChanged(QString address);
98  void onIPFSHashChanged(QString hash);
99  void onCreateAssetClicked();
100  void onUnitChanged(int value);
101  void onChangeAddressChanged(QString changeAddress);
102  void onAssetTypeActivated(int index);
103  void onAssetListActivated(int index);
104  void onClearButtonClicked();
105 
106  //CoinControl
107  void coinControlFeatureChanged(bool);
108  void coinControlButtonClicked();
109  void coinControlChangeChecked(int);
110  void coinControlChangeEdited(const QString &);
111  void coinControlClipboardQuantity();
112  void coinControlClipboardAmount();
113  void coinControlClipboardFee();
114  void coinControlClipboardAfterFee();
115  void coinControlClipboardBytes();
116  void coinControlClipboardLowOutput();
117  void coinControlClipboardChange();
118  void coinControlUpdateLabels();
119 
120  //Fee
121  void on_buttonChooseFee_clicked();
122  void on_buttonMinimizeFee_clicked();
123  void setMinimumFee();
124  void updateFeeSectionControls();
125  void updateMinFeeLabel();
126  void updateSmartFeeLabel();
127  void feeControlFeatureChanged(bool);
128 
129  void setBalance(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance,
130  const CAmount& watchOnlyBalance, const CAmount& watchUnconfBalance, const CAmount& watchImmatureBalance);
131  void updateDisplayUnit();
132 
133 
134  void focusSubAsset(const QModelIndex& index);
135  void focusUniqueAsset(const QModelIndex& index);
136 
137 protected:
138  bool eventFilter( QObject* sender, QEvent* event);
139 
140 
141 Q_SIGNALS:
142  // Fired when a message should be reported to the user
143  void message(const QString &title, const QString &message, unsigned int style);
144 };
145 
146 #endif // RAVEN_QT_CREATEASSETDIALOG_H
ClientModel * clientModel
QCompleter * completer
Coin Control Features.
Definition: coincontrol.h:17
int64_t CAmount
Amount in corbies (Can be negative)
Definition: amount.h:13
Ui::CreateAssetDialog * ui
Model for Raven network client.
Definition: clientmodel.h:39
QSortFilterProxyModel * proxy
Interface to Raven wallet from Qt view code.
Definition: walletmodel.h:165
Dialog showing transaction details.
QStringListModel * stringModel
const PlatformStyle * platformStyle
WalletModel * model