Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

coincontroldialog.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2015 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.
4 
5 #ifndef BITCOIN_QT_COINCONTROLDIALOG_H
6 #define BITCOIN_QT_COINCONTROLDIALOG_H
7 
8 #include <amount.h>
9 
10 #include <QAbstractButton>
11 #include <QAction>
12 #include <QDialog>
13 #include <QList>
14 #include <QMenu>
15 #include <QPoint>
16 #include <QString>
17 #include <QTreeWidgetItem>
18 
19 class WalletModel;
20 
21 class CCoinControl;
22 
23 namespace Ui {
24  class CoinControlDialog;
25 }
26 
27 #define ASYMP_UTF8 "\xE2\x89\x88"
28 
29 class CCoinControlWidgetItem : public QTreeWidgetItem
30 {
31 public:
32  explicit CCoinControlWidgetItem(QTreeWidget *parent, int type = Type) : QTreeWidgetItem(parent, type) {}
33  explicit CCoinControlWidgetItem(int type = Type) : QTreeWidgetItem(type) {}
34  explicit CCoinControlWidgetItem(QTreeWidgetItem *parent, int type = Type) : QTreeWidgetItem(parent, type) {}
35 
36  bool operator<(const QTreeWidgetItem &other) const;
37 };
38 
39 
40 class CoinControlDialog : public QDialog
41 {
42  Q_OBJECT
43 
44 public:
45  explicit CoinControlDialog(QWidget* parent = 0);
47 
48  void setModel(WalletModel *model);
49 
50  // static because also called from sendcoinsdialog
51  static void updateLabels(WalletModel*, QDialog*);
52 
53  static QList<CAmount> payAmounts;
54  static CCoinControl *coinControl();
56  static void usePrivateSend(bool fUsePrivateSend);
57 
58 private:
59  Ui::CoinControlDialog *ui;
62  Qt::SortOrder sortOrder;
63 
64  QMenu *contextMenu;
65  QTreeWidgetItem *contextMenuItem;
67  QAction *lockAction;
68  QAction *unlockAction;
69 
70  bool fHideAdditional{true};
71 
72  void sortView(int, Qt::SortOrder);
73  void updateView();
74 
75  enum
76  {
84  };
85 
86  enum
87  {
88  TxHashRole = Qt::UserRole,
90  };
91 
92  friend class CCoinControlWidgetItem;
93 
94  enum class Mode {
95  NORMAL,
97  };
98 
100 
101 private Q_SLOTS:
102  void showMenu(const QPoint &);
103  void copyAmount();
104  void copyLabel();
105  void copyAddress();
106  void copyTransactionHash();
107  void lockCoin();
108  void unlockCoin();
109  void clipboardQuantity();
110  void clipboardAmount();
111  void clipboardFee();
112  void clipboardAfterFee();
113  void clipboardBytes();
114  void clipboardLowOutput();
115  void clipboardChange();
116  void radioTreeMode(bool);
117  void radioListMode(bool);
118  void viewItemChanged(QTreeWidgetItem*, int);
119  void headerSectionClicked(int);
120  void buttonBoxClicked(QAbstractButton*);
121  void buttonSelectAllClicked();
123  void updateLabelLocked();
124  void on_hideButton_clicked();
125 };
126 
127 #endif // BITCOIN_QT_COINCONTROLDIALOG_H
static CoinControlDialog::Mode mode
void viewItemChanged(QTreeWidgetItem *, int)
CCoinControlWidgetItem(QTreeWidget *parent, int type=Type)
static void usePrivateSend(bool fUsePrivateSend)
Coin Control Features.
Definition: coincontrol.h:28
static QList< CAmount > payAmounts
bool operator<(const QTreeWidgetItem &other) const
QAction * copyTransactionHashAction
Ui::CoinControlDialog * ui
CoinControlDialog(QWidget *parent=0)
static void updateLabels(WalletModel *, QDialog *)
void setModel(WalletModel *model)
static bool fSubtractFeeFromAmount
QTreeWidgetItem * contextMenuItem
Interface to Bitcoin wallet from Qt view code.
Definition: walletmodel.h:100
CCoinControlWidgetItem(QTreeWidgetItem *parent, int type=Type)
void sortView(int, Qt::SortOrder)
Qt::SortOrder sortOrder
CCoinControlWidgetItem(int type=Type)
void buttonBoxClicked(QAbstractButton *)
WalletModel * model
void showMenu(const QPoint &)
static CCoinControl * coinControl()
Released under the MIT license