dash/src/qt/coincontroldialog.h

128 lines
3.0 KiB
C
Raw Normal View History

// Copyright (c) 2011-2015 The Bitcoin Core developers
2014-12-13 05:09:33 +01:00
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
2014-11-03 16:16:40 +01:00
#ifndef BITCOIN_QT_COINCONTROLDIALOG_H
#define BITCOIN_QT_COINCONTROLDIALOG_H
2013-08-12 17:03:03 +02:00
Backport 11651 (#3358) * scripted-diff: Replace #include "" with #include <> (ryanofsky) -BEGIN VERIFY SCRIPT- for f in \ src/*.cpp \ src/*.h \ src/bench/*.cpp \ src/bench/*.h \ src/compat/*.cpp \ src/compat/*.h \ src/consensus/*.cpp \ src/consensus/*.h \ src/crypto/*.cpp \ src/crypto/*.h \ src/crypto/ctaes/*.h \ src/policy/*.cpp \ src/policy/*.h \ src/primitives/*.cpp \ src/primitives/*.h \ src/qt/*.cpp \ src/qt/*.h \ src/qt/test/*.cpp \ src/qt/test/*.h \ src/rpc/*.cpp \ src/rpc/*.h \ src/script/*.cpp \ src/script/*.h \ src/support/*.cpp \ src/support/*.h \ src/support/allocators/*.h \ src/test/*.cpp \ src/test/*.h \ src/wallet/*.cpp \ src/wallet/*.h \ src/wallet/test/*.cpp \ src/wallet/test/*.h \ src/zmq/*.cpp \ src/zmq/*.h do base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f done -END VERIFY SCRIPT- Signed-off-by: Pasta <pasta@dashboost.org> * scripted-diff: Replace #include "" with #include <> (Dash Specific) -BEGIN VERIFY SCRIPT- for f in \ src/bls/*.cpp \ src/bls/*.h \ src/evo/*.cpp \ src/evo/*.h \ src/governance/*.cpp \ src/governance/*.h \ src/llmq/*.cpp \ src/llmq/*.h \ src/masternode/*.cpp \ src/masternode/*.h \ src/privatesend/*.cpp \ src/privatesend/*.h do base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f done -END VERIFY SCRIPT- Signed-off-by: Pasta <pasta@dashboost.org> * build: Remove -I for everything but project root Remove -I from build system for everything but the project root, and built-in dependencies. Signed-off-by: Pasta <pasta@dashboost.org> # Conflicts: # src/Makefile.test.include * qt: refactor: Use absolute include paths in .ui files * qt: refactor: Changes to make include paths absolute This makes all include paths in the GUI absolute. Many changes are involved as every single source file in src/qt/ assumes to be able to use relative includes. Signed-off-by: Pasta <pasta@dashboost.org> # Conflicts: # src/qt/dash.cpp # src/qt/optionsmodel.cpp # src/qt/test/rpcnestedtests.cpp * test: refactor: Use absolute include paths for test data files * Recommend #include<> syntax in developer notes * refactor: Include obj/build.h instead of build.h * END BACKPORT #11651 Remove trailing whitespace causing travis failure * fix backport 11651 Signed-off-by: Pasta <pasta@dashboost.org> * More of 11651 * fix blockchain.cpp Signed-off-by: pasta <pasta@dashboost.org> * Add missing "qt/" in includes * Add missing "test/" in includes * Fix trailing whitespaces Co-authored-by: Wladimir J. van der Laan <laanwj@gmail.com> Co-authored-by: Russell Yanofsky <russ@yanofsky.org> Co-authored-by: MeshCollider <dobsonsa68@gmail.com> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2020-03-19 23:46:56 +01:00
#include <amount.h>
2013-08-12 17:03:03 +02:00
#include <QAbstractButton>
#include <QAction>
#include <QDialog>
#include <QList>
#include <QMenu>
#include <QPoint>
#include <QString>
#include <QTreeWidgetItem>
class WalletModel;
2013-08-12 17:03:03 +02:00
class CCoinControl;
namespace Ui {
class CoinControlDialog;
}
#define ASYMP_UTF8 "\xE2\x89\x88"
class CCoinControlWidgetItem : public QTreeWidgetItem
{
public:
explicit CCoinControlWidgetItem(QTreeWidget *parent, int type = Type) : QTreeWidgetItem(parent, type) {}
explicit CCoinControlWidgetItem(int type = Type) : QTreeWidgetItem(type) {}
explicit CCoinControlWidgetItem(QTreeWidgetItem *parent, int type = Type) : QTreeWidgetItem(parent, type) {}
bool operator<(const QTreeWidgetItem &other) const;
};
2013-08-12 17:03:03 +02:00
class CoinControlDialog : public QDialog
{
Q_OBJECT
public:
explicit CoinControlDialog(QWidget* parent = 0);
2013-08-12 17:03:03 +02:00
~CoinControlDialog();
void setModel(WalletModel *model);
// static because also called from sendcoinsdialog
static void updateLabels(WalletModel*, QDialog*);
2014-04-23 00:46:19 +02:00
static QList<CAmount> payAmounts;
static CCoinControl *coinControl();
static bool fSubtractFeeFromAmount;
static void usePrivateSend(bool fUsePrivateSend);
2013-08-12 17:03:03 +02:00
private:
Ui::CoinControlDialog *ui;
WalletModel *model;
int sortColumn;
Qt::SortOrder sortOrder;
QMenu *contextMenu;
QTreeWidgetItem *contextMenuItem;
QAction *copyTransactionHashAction;
QAction *lockAction;
QAction *unlockAction;
qt: Finetune CoinControlDialog + bitcoin#14828 (#3701) * qt: Add min-height for CoinControlTreeWidget#treeWidget::item The rows resize without it if they get locked and the lock icon appears besides the checkbox. Looks weird.. and especially if you press the lock all button its just not nice. * qt: Set background transparency for CoinControl item::hover * Merge #14828: qt: Remove hidden columns in coin control dialog 1c28feb7d qt: Remove hidden columns in coin control dialog (João Barbosa) Pull request description: Instead of having hidden columns, store the data in specific roles. Overlaps with #14817, fixes #11811. Tree-SHA512: e86e9ca426b9146ac28997ca1920dbae6cc4e2e494ff94fe131d605cd6c013183fc5de10036c886a4d6dcae497ac4067de3791be0ef9c88f7ce9f57f7bd97422 * qt: Add border-bottom for tree items in CoinControl * qt: Stretch address column in CoinControlDialog * Adjust column width for a couple of columns * qt: Hide PrivateSend rounds column for normal Send tab's CoinControl * qt: Hide unrelated coins in CoinControl based on active mode. Still allow to show them. * qt: Hide empty top level items in CoinControlDialog's tree mode * qt: Hide tree/list radio buttons and default to list for PrivateSend * qt: Hide address/label column in CoinControl for PrivateSend * qt: Remove obsolete empty columns * qt: Rename column "PS Rounds" to "Mixing Rounds" * qt: Move border-bottom in already existing css selector * Reveal all PS related coins in coincontrol while in PS mode, not only ones with rounds>=1 Also tweak button text * qt: Only moving a statement a bit * qt: Hide the "hideButton" in CoinControlDialog if PrivatSend is disabled And make it default to show all coins in that case.. Co-authored-by: Jonas Schnelli <dev@jonasschnelli.ch> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2020-09-23 09:31:50 +02:00
bool fHideAdditional{true};
2013-08-12 17:03:03 +02:00
void sortView(int, Qt::SortOrder);
void updateView();
enum
{
COLUMN_CHECKBOX = 0,
2013-08-12 17:03:03 +02:00
COLUMN_AMOUNT,
COLUMN_LABEL,
COLUMN_ADDRESS,
COLUMN_PRIVATESEND_ROUNDS,
2013-08-12 17:03:03 +02:00
COLUMN_DATE,
COLUMN_CONFIRMATIONS,
};
qt: Finetune CoinControlDialog + bitcoin#14828 (#3701) * qt: Add min-height for CoinControlTreeWidget#treeWidget::item The rows resize without it if they get locked and the lock icon appears besides the checkbox. Looks weird.. and especially if you press the lock all button its just not nice. * qt: Set background transparency for CoinControl item::hover * Merge #14828: qt: Remove hidden columns in coin control dialog 1c28feb7d qt: Remove hidden columns in coin control dialog (João Barbosa) Pull request description: Instead of having hidden columns, store the data in specific roles. Overlaps with #14817, fixes #11811. Tree-SHA512: e86e9ca426b9146ac28997ca1920dbae6cc4e2e494ff94fe131d605cd6c013183fc5de10036c886a4d6dcae497ac4067de3791be0ef9c88f7ce9f57f7bd97422 * qt: Add border-bottom for tree items in CoinControl * qt: Stretch address column in CoinControlDialog * Adjust column width for a couple of columns * qt: Hide PrivateSend rounds column for normal Send tab's CoinControl * qt: Hide unrelated coins in CoinControl based on active mode. Still allow to show them. * qt: Hide empty top level items in CoinControlDialog's tree mode * qt: Hide tree/list radio buttons and default to list for PrivateSend * qt: Hide address/label column in CoinControl for PrivateSend * qt: Remove obsolete empty columns * qt: Rename column "PS Rounds" to "Mixing Rounds" * qt: Move border-bottom in already existing css selector * Reveal all PS related coins in coincontrol while in PS mode, not only ones with rounds>=1 Also tweak button text * qt: Only moving a statement a bit * qt: Hide the "hideButton" in CoinControlDialog if PrivatSend is disabled And make it default to show all coins in that case.. Co-authored-by: Jonas Schnelli <dev@jonasschnelli.ch> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2020-09-23 09:31:50 +02:00
enum
{
TxHashRole = Qt::UserRole,
VOutRole
};
friend class CCoinControlWidgetItem;
2014-03-03 04:16:42 +01:00
enum class Mode {
NORMAL,
PRIVATESEND,
};
static CoinControlDialog::Mode mode;
private Q_SLOTS:
2013-08-12 17:03:03 +02:00
void showMenu(const QPoint &);
void copyAmount();
void copyLabel();
void copyAddress();
void copyTransactionHash();
void lockCoin();
void unlockCoin();
void clipboardQuantity();
void clipboardAmount();
void clipboardFee();
void clipboardAfterFee();
void clipboardBytes();
void clipboardLowOutput();
void clipboardChange();
void radioTreeMode(bool);
void radioListMode(bool);
void viewItemChanged(QTreeWidgetItem*, int);
void headerSectionClicked(int);
void buttonBoxClicked(QAbstractButton*);
void buttonSelectAllClicked();
void buttonToggleLockClicked();
2013-08-12 17:03:03 +02:00
void updateLabelLocked();
qt: Finetune CoinControlDialog + bitcoin#14828 (#3701) * qt: Add min-height for CoinControlTreeWidget#treeWidget::item The rows resize without it if they get locked and the lock icon appears besides the checkbox. Looks weird.. and especially if you press the lock all button its just not nice. * qt: Set background transparency for CoinControl item::hover * Merge #14828: qt: Remove hidden columns in coin control dialog 1c28feb7d qt: Remove hidden columns in coin control dialog (João Barbosa) Pull request description: Instead of having hidden columns, store the data in specific roles. Overlaps with #14817, fixes #11811. Tree-SHA512: e86e9ca426b9146ac28997ca1920dbae6cc4e2e494ff94fe131d605cd6c013183fc5de10036c886a4d6dcae497ac4067de3791be0ef9c88f7ce9f57f7bd97422 * qt: Add border-bottom for tree items in CoinControl * qt: Stretch address column in CoinControlDialog * Adjust column width for a couple of columns * qt: Hide PrivateSend rounds column for normal Send tab's CoinControl * qt: Hide unrelated coins in CoinControl based on active mode. Still allow to show them. * qt: Hide empty top level items in CoinControlDialog's tree mode * qt: Hide tree/list radio buttons and default to list for PrivateSend * qt: Hide address/label column in CoinControl for PrivateSend * qt: Remove obsolete empty columns * qt: Rename column "PS Rounds" to "Mixing Rounds" * qt: Move border-bottom in already existing css selector * Reveal all PS related coins in coincontrol while in PS mode, not only ones with rounds>=1 Also tweak button text * qt: Only moving a statement a bit * qt: Hide the "hideButton" in CoinControlDialog if PrivatSend is disabled And make it default to show all coins in that case.. Co-authored-by: Jonas Schnelli <dev@jonasschnelli.ch> Co-authored-by: UdjinM6 <UdjinM6@users.noreply.github.com>
2020-09-23 09:31:50 +02:00
void on_hideButton_clicked();
2013-08-12 17:03:03 +02:00
};
2014-11-03 16:16:40 +01:00
#endif // BITCOIN_QT_COINCONTROLDIALOG_H