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