Fabcoin Core  0.16.2
P2P Digital Currency
coincontroldialog.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2017 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 FABCOIN_QT_COINCONTROLDIALOG_H
6 #define FABCOIN_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 
24 namespace Ui {
25  class CoinControlDialog;
26 }
27 
28 #define ASYMP_UTF8 "\xE2\x89\x88"
29 
30 class CCoinControlWidgetItem : public QTreeWidgetItem
31 {
32 public:
33  CCoinControlWidgetItem(QTreeWidget *parent, int type = Type) : QTreeWidgetItem(parent, type) {}
34  CCoinControlWidgetItem(int type = Type) : QTreeWidgetItem(type) {}
35  CCoinControlWidgetItem(QTreeWidgetItem *parent, int type = Type) : QTreeWidgetItem(parent, type) {}
36 
37  bool operator<(const QTreeWidgetItem &other) const;
38 };
39 
40 
41 class CoinControlDialog : public QDialog
42 {
43  Q_OBJECT
44 
45 public:
46  explicit CoinControlDialog(const PlatformStyle *platformStyle, QWidget *parent = 0);
48 
49  void setModel(WalletModel *model);
50 
51  // static because also called from sendcoinsdialog
52  static void updateLabels(WalletModel*, QDialog*);
53 
54  static QList<CAmount> payAmounts;
57 
58 private:
62  Qt::SortOrder sortOrder;
63 
64  QMenu *contextMenu;
65  QTreeWidgetItem *contextMenuItem;
67  QAction *lockAction;
68  QAction *unlockAction;
69 
71 
72  void sortView(int, Qt::SortOrder);
73  void updateView();
74 
75  enum
76  {
77  COLUMN_CHECKBOX = 0,
85  };
86  friend class CCoinControlWidgetItem;
87 
88 private Q_SLOTS:
89  void showMenu(const QPoint &);
90  void copyAmount();
91  void copyLabel();
92  void copyAddress();
93  void copyTransactionHash();
94  void lockCoin();
95  void unlockCoin();
96  void clipboardQuantity();
97  void clipboardAmount();
98  void clipboardFee();
99  void clipboardAfterFee();
100  void clipboardBytes();
101  void clipboardLowOutput();
102  void clipboardChange();
103  void radioTreeMode(bool);
104  void radioListMode(bool);
105  void viewItemChanged(QTreeWidgetItem*, int);
106  void headerSectionClicked(int);
107  void buttonBoxClicked(QAbstractButton*);
108  void buttonSelectAllClicked();
109  void updateLabelLocked();
110 };
111 
112 #endif // FABCOIN_QT_COINCONTROLDIALOG_H
const PlatformStyle * platformStyle
static CCoinControl * coinControl
CCoinControlWidgetItem(QTreeWidget *parent, int type=Type)
Coin Control Features.
Definition: coincontrol.h:16
static QList< CAmount > payAmounts
QAction * copyTransactionHashAction
Ui::CoinControlDialog * ui
static bool fSubtractFeeFromAmount
QTreeWidgetItem * contextMenuItem
PlatformStyle::TableColorType type
Definition: rpcconsole.cpp:61
Interface to Fabcoin wallet from Qt view code.
Definition: walletmodel.h:103
CCoinControlWidgetItem(QTreeWidgetItem *parent, int type=Type)
Qt::SortOrder sortOrder
CCoinControlWidgetItem(int type=Type)
WalletModel * model
bool operator<(const ::CryptoPP::OID &lhs, const ::CryptoPP::OID &rhs)
Definition: asn.h:562