Raven Core  3.0.0
P2P Digital Currency
coincontroldialog.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_COINCONTROLDIALOG_H
7 #define RAVEN_QT_COINCONTROLDIALOG_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 class PlatformStyle;
21 class WalletModel;
22 
23 class CCoinControl;
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  explicit CCoinControlWidgetItem(QTreeWidget *parent, int type = Type) : QTreeWidgetItem(parent, type) {}
35  explicit CCoinControlWidgetItem(int type = Type) : QTreeWidgetItem(type) {}
36  explicit 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  {
78  COLUMN_CHECKBOX = 0,
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 // RAVEN_QT_COINCONTROLDIALOG_H
const PlatformStyle * platformStyle
static CCoinControl * coinControl
CCoinControlWidgetItem(QTreeWidget *parent, int type=Type)
Coin Control Features.
Definition: coincontrol.h:17
static QList< CAmount > payAmounts
QAction * copyTransactionHashAction
Ui::CoinControlDialog * ui
bool operator<(const CNetAddr &a, const CNetAddr &b)
Definition: netaddress.cpp:303
static bool fSubtractFeeFromAmount
QTreeWidgetItem * contextMenuItem
Interface to Raven wallet from Qt view code.
Definition: walletmodel.h:165
CCoinControlWidgetItem(QTreeWidgetItem *parent, int type=Type)
Qt::SortOrder sortOrder
CCoinControlWidgetItem(int type=Type)
WalletModel * model