Bitcoin Core 28.99.0
P2P Digital Currency
coincontroldialog.h
Go to the documentation of this file.
1// Copyright (c) 2011-2021 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 <consensus/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
19class PlatformStyle;
20class WalletModel;
21
22namespace wallet {
23class CCoinControl;
24} // namespace wallet
25
26namespace Ui {
28}
29
30#define ASYMP_UTF8 "\xE2\x89\x88"
31
32class CCoinControlWidgetItem : public QTreeWidgetItem
33{
34public:
35 explicit CCoinControlWidgetItem(QTreeWidget *parent, int type = Type) : QTreeWidgetItem(parent, type) {}
36 explicit CCoinControlWidgetItem(QTreeWidgetItem *parent, int type = Type) : QTreeWidgetItem(parent, type) {}
37
38 bool operator<(const QTreeWidgetItem &other) const override;
39};
40
41
42class CoinControlDialog : public QDialog
43{
44 Q_OBJECT
45
46public:
47 explicit CoinControlDialog(wallet::CCoinControl& coin_control, WalletModel* model, const PlatformStyle *platformStyle, QWidget *parent = nullptr);
49
50 // static because also called from sendcoinsdialog
52
53 static QList<CAmount> payAmounts;
55
56protected:
57 void changeEvent(QEvent* e) override;
58
59private:
60 Ui::CoinControlDialog *ui;
64 Qt::SortOrder sortOrder;
65
67 QTreeWidgetItem *contextMenuItem;
69 QAction *lockAction;
70 QAction *unlockAction;
71
73
74 void sortView(int, Qt::SortOrder);
75 void updateView();
76
77 enum
78 {
85 };
86
87 enum
88 {
89 TxHashRole = Qt::UserRole,
91 };
92
94
95private Q_SLOTS:
96 void showMenu(const QPoint &);
97 void copyAmount();
98 void copyLabel();
99 void copyAddress();
101 void lockCoin();
102 void unlockCoin();
103 void clipboardQuantity();
104 void clipboardAmount();
105 void clipboardFee();
106 void clipboardAfterFee();
107 void clipboardBytes();
108 void clipboardChange();
109 void radioTreeMode(bool);
110 void radioListMode(bool);
111 void viewItemChanged(QTreeWidgetItem*, int);
112 void headerSectionClicked(int);
113 void buttonBoxClicked(QAbstractButton*);
115 void updateLabelLocked();
116};
117
118#endif // BITCOIN_QT_COINCONTROLDIALOG_H
CCoinControlWidgetItem(QTreeWidgetItem *parent, int type=Type)
bool operator<(const QTreeWidgetItem &other) const override
CCoinControlWidgetItem(QTreeWidget *parent, int type=Type)
QTreeWidgetItem * contextMenuItem
WalletModel * model
CoinControlDialog(wallet::CCoinControl &coin_control, WalletModel *model, const PlatformStyle *platformStyle, QWidget *parent=nullptr)
const PlatformStyle * platformStyle
void changeEvent(QEvent *e) override
Ui::CoinControlDialog * ui
void sortView(int, Qt::SortOrder)
void showMenu(const QPoint &)
void viewItemChanged(QTreeWidgetItem *, int)
wallet::CCoinControl & m_coin_control
Qt::SortOrder sortOrder
QAction * m_copy_transaction_outpoint_action
static QList< CAmount > payAmounts
static void updateLabels(wallet::CCoinControl &m_coin_control, WalletModel *, QDialog *)
static bool fSubtractFeeFromAmount
void buttonBoxClicked(QAbstractButton *)
Interface to Bitcoin wallet from Qt view code.
Definition: walletmodel.h:48
Coin Control Features.
Definition: coincontrol.h:81