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.
5 #ifndef BITCOIN_QT_COINCONTROLDIALOG_H
6 #define BITCOIN_QT_COINCONTROLDIALOG_H
10 #include <QAbstractButton>
17 #include <QTreeWidgetItem>
25 class CoinControlDialog
;
28 #define ASYMP_UTF8 "\xE2\x89\x88"
30 class CCoinControlWidgetItem
: public QTreeWidgetItem
33 explicit CCoinControlWidgetItem(QTreeWidget
*parent
, int type
= Type
) : QTreeWidgetItem(parent
, type
) {}
34 explicit CCoinControlWidgetItem(int type
= Type
) : QTreeWidgetItem(type
) {}
35 explicit CCoinControlWidgetItem(QTreeWidgetItem
*parent
, int type
= Type
) : QTreeWidgetItem(parent
, type
) {}
37 bool operator<(const QTreeWidgetItem
&other
) const;
41 class CoinControlDialog
: public QDialog
46 explicit CoinControlDialog(const PlatformStyle
*platformStyle
, QWidget
*parent
= 0);
49 void setModel(WalletModel
*model
);
51 // static because also called from sendcoinsdialog
52 static void updateLabels(WalletModel
*, QDialog
*);
54 static QList
<CAmount
> payAmounts
;
55 static CCoinControl
*coinControl
;
56 static bool fSubtractFeeFromAmount
;
59 Ui::CoinControlDialog
*ui
;
62 Qt::SortOrder sortOrder
;
65 QTreeWidgetItem
*contextMenuItem
;
66 QAction
*copyTransactionHashAction
;
68 QAction
*unlockAction
;
70 const PlatformStyle
*platformStyle
;
72 void sortView(int, Qt::SortOrder
);
86 friend class CCoinControlWidgetItem
;
89 void showMenu(const QPoint
&);
93 void copyTransactionHash();
96 void clipboardQuantity();
97 void clipboardAmount();
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();
112 #endif // BITCOIN_QT_COINCONTROLDIALOG_H