Dogecoin Core  1.14.2
P2P Digital Currency
coincontroldialog.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2016 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 PlatformStyle;
20 class WalletModel;
21 
22 class CCoinControl;
23 class CTxMemPool;
24 
25 namespace Ui {
26  class CoinControlDialog;
27 }
28 
29 #define ASYMP_UTF8 "\xE2\x89\x88"
30 
31 class CCoinControlWidgetItem : public QTreeWidgetItem
32 {
33 public:
34  CCoinControlWidgetItem(QTreeWidget *parent, int type = Type) : QTreeWidgetItem(parent, type) {}
35  CCoinControlWidgetItem(int type = Type) : QTreeWidgetItem(type) {}
36  CCoinControlWidgetItem(QTreeWidgetItem *parent, int type = Type) : QTreeWidgetItem(parent, type) {}
37 
38  bool operator<(const QTreeWidgetItem &other) const;
39 };
40 
41 
42 class CoinControlDialog : public QDialog
43 {
44  Q_OBJECT
45 
46 public:
47  explicit CoinControlDialog(const PlatformStyle *platformStyle, QWidget *parent = 0);
49 
50  void setModel(WalletModel *model);
51 
52  // static because also called from sendcoinsdialog
53  static void updateLabels(WalletModel*, QDialog*);
54 
55  static QList<CAmount> payAmounts;
58 
59 private:
60  Ui::CoinControlDialog *ui;
63  Qt::SortOrder sortOrder;
64 
65  QMenu *contextMenu;
66  QTreeWidgetItem *contextMenuItem;
68  QAction *lockAction;
69  QAction *unlockAction;
70 
72 
73  void sortView(int, Qt::SortOrder);
74  void updateView();
75 
76  enum
77  {
86  };
87  friend class CCoinControlWidgetItem;
88 
89 private Q_SLOTS:
90  void showMenu(const QPoint &);
91  void copyAmount();
92  void copyLabel();
93  void copyAddress();
94  void copyTransactionHash();
95  void lockCoin();
96  void unlockCoin();
97  void clipboardQuantity();
98  void clipboardAmount();
99  void clipboardFee();
100  void clipboardAfterFee();
101  void clipboardBytes();
102  void clipboardLowOutput();
103  void clipboardChange();
104  void radioTreeMode(bool);
105  void radioListMode(bool);
106  void viewItemChanged(QTreeWidgetItem*, int);
107  void headerSectionClicked(int);
108  void buttonBoxClicked(QAbstractButton*);
109  void buttonSelectAllClicked();
110  void updateLabelLocked();
111 };
112 
113 #endif // BITCOIN_QT_COINCONTROLDIALOG_H
Coin Control Features.
Definition: coincontrol.h:12
CCoinControlWidgetItem(QTreeWidgetItem *parent, int type=Type)
CCoinControlWidgetItem(QTreeWidget *parent, int type=Type)
CCoinControlWidgetItem(int type=Type)
bool operator<(const QTreeWidgetItem &other) const
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
Definition: txmempool.h:432
QTreeWidgetItem * contextMenuItem
WalletModel * model
CoinControlDialog(const PlatformStyle *platformStyle, QWidget *parent=0)
void setModel(WalletModel *model)
static void updateLabels(WalletModel *, QDialog *)
const PlatformStyle * platformStyle
QAction * copyTransactionHashAction
Ui::CoinControlDialog * ui
void sortView(int, Qt::SortOrder)
static CCoinControl * coinControl
void showMenu(const QPoint &)
void viewItemChanged(QTreeWidgetItem *, int)
Qt::SortOrder sortOrder
static QList< CAmount > payAmounts
static bool fSubtractFeeFromAmount
void buttonBoxClicked(QAbstractButton *)
Interface to Bitcoin wallet from Qt view code.
Definition: walletmodel.h:99