Raven Core  3.0.0
P2P Digital Currency
assetcontroldialog.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_ASSETCONTROLDIALOG_H
7 #define RAVEN_QT_ASSETCONTROLDIALOG_H
8 
9 #include "amount.h"
10 
11 #include <QAbstractButton>
12 #include <QAction>
13 #include <QDialog>
14 #include <QList>
15 #include <QMenu>
16 #include <QPoint>
17 #include <QString>
18 #include <QTreeWidgetItem>
19 
20 
21 class PlatformStyle;
22 class WalletModel;
23 
24 class CCoinControl;
25 
26 class QStringListModel;
27 class QSortFilterProxyModel;
28 class QCompleter;
29 
30 namespace Ui {
31  class AssetControlDialog;
32 }
33 
34 #define ASYMP_UTF8 "\xE2\x89\x88"
35 
36 class CAssetControlWidgetItem : public QTreeWidgetItem
37 {
38 public:
39  explicit CAssetControlWidgetItem(QTreeWidget *parent, int type = Type) : QTreeWidgetItem(parent, type) {}
40  explicit CAssetControlWidgetItem(int type = Type) : QTreeWidgetItem(type) {}
41  explicit CAssetControlWidgetItem(QTreeWidgetItem *parent, int type = Type) : QTreeWidgetItem(parent, type) {}
42 
43  bool operator<(const QTreeWidgetItem &other) const;
44 };
45 
46 class AssetControlDialog : public QDialog
47 {
48  Q_OBJECT
49 
50 public:
51  explicit AssetControlDialog(const PlatformStyle *platformStyle, QWidget *parent = 0);
53 
54  void setModel(WalletModel *model);
55 
56  // static because also called from sendcoinsdialog
57  static void updateLabels(WalletModel*, QDialog*);
58 
59  //update the list of assets
60  void updateAssetList(bool fSetOnStart = false);
61 
62  static QList<CAmount> payAmounts;
65  bool fOnStartUp;
66 
67  QStringListModel* stringModel;
68  QSortFilterProxyModel* proxy;
69  QCompleter* completer;
70 
71 private:
72  Ui::AssetControlDialog *ui;
75  Qt::SortOrder sortOrder;
76 
77  QMenu *contextMenu;
78  QTreeWidgetItem *contextMenuItem;
80  QAction *lockAction;
81  QAction *unlockAction;
82 
84 
85  void sortView(int, Qt::SortOrder);
86  void updateView();
87 
88  enum
89  {
90  COLUMN_CHECKBOX = 0,
99  };
101 
102 private Q_SLOTS:
103  void showMenu(const QPoint &);
104  void copyAmount();
105  void copyLabel();
106  void copyAddress();
107  void copyTransactionHash();
108  void lockCoin();
109  void unlockCoin();
110  void clipboardQuantity();
111  void clipboardAmount();
112  void clipboardFee();
113  void clipboardAfterFee();
114  void clipboardBytes();
115  void clipboardLowOutput();
116  void clipboardChange();
117  void radioTreeMode(bool);
118  void radioListMode(bool);
119  void viewItemChanged(QTreeWidgetItem*, int);
120  void headerSectionClicked(int);
121  void buttonBoxClicked(QAbstractButton*);
122  void buttonSelectAllClicked();
123  void updateLabelLocked();
124  void viewAdministratorClicked();
125  void onAssetSelected(QString name);
126 };
127 
128 #endif // RAVEN_QT_ASSETCONTROLDIALOG_H
CAssetControlWidgetItem(QTreeWidget *parent, int type=Type)
QTreeWidgetItem * contextMenuItem
CAssetControlWidgetItem(QTreeWidgetItem *parent, int type=Type)
static bool fSubtractFeeFromAmount
Coin Control Features.
Definition: coincontrol.h:17
static CCoinControl * assetControl
static QList< CAmount > payAmounts
bool operator<(const CNetAddr &a, const CNetAddr &b)
Definition: netaddress.cpp:303
Qt::SortOrder sortOrder
const PlatformStyle * platformStyle
Interface to Raven wallet from Qt view code.
Definition: walletmodel.h:165
Ui::AssetControlDialog * ui
CAssetControlWidgetItem(int type=Type)
QSortFilterProxyModel * proxy
QStringListModel * stringModel
QAction * copyTransactionHashAction