Dash Core  0.12.2.1
P2P Digital Currency
coincontroldialog.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2015 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 "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 class CTxMemPool;
24 
25 namespace Ui {
26  class CoinControlDialog;
27 }
28 
29 #define ASYMP_UTF8 "\xE2\x89\x88"
30 
31 class CoinControlDialog : public QDialog
32 {
33  Q_OBJECT
34 
35 public:
36  explicit CoinControlDialog(const PlatformStyle *platformStyle, QWidget *parent = 0);
38 
39  void setModel(WalletModel *model);
40 
41  // static because also called from sendcoinsdialog
42  static void updateLabels(WalletModel*, QDialog*);
43 
44  static QList<CAmount> payAmounts;
47 
48 private:
52  Qt::SortOrder sortOrder;
53 
54  QMenu *contextMenu;
55  QTreeWidgetItem *contextMenuItem;
57  QAction *lockAction;
58  QAction *unlockAction;
59 
61 
62  QString strPad(QString, int, QString);
63  void sortView(int, Qt::SortOrder);
64  void updateView();
65 
66  enum
67  {
79  };
80 
81  // some columns have a hidden column containing the value used for sorting
82  int getMappedColumn(int column, bool fVisibleColumn = true)
83  {
84  if (fVisibleColumn)
85  {
86  if (column == COLUMN_AMOUNT_INT64)
87  return COLUMN_AMOUNT;
88  else if (column == COLUMN_DATE_INT64)
89  return COLUMN_DATE;
90  }
91  else
92  {
93  if (column == COLUMN_AMOUNT)
94  return COLUMN_AMOUNT_INT64;
95  else if (column == COLUMN_DATE)
96  return COLUMN_DATE_INT64;
97  }
98 
99  return column;
100  }
101 
102 private Q_SLOTS:
103  void showMenu(const QPoint &);
104  void copyAmount();
105  void copyLabel();
106  void copyAddress();
107  void copyTransactionHash();
108  void lockCoin();
109  void unlockCoin();
110  void clipboardQuantity();
111  void clipboardAmount();
112  void clipboardFee();
113  void clipboardAfterFee();
114  void clipboardBytes();
115  void clipboardLowOutput();
116  void clipboardChange();
117  void radioTreeMode(bool);
118  void radioListMode(bool);
119  void viewItemChanged(QTreeWidgetItem*, int);
120  void headerSectionClicked(int);
121  void buttonBoxClicked(QAbstractButton*);
122  void buttonSelectAllClicked();
124  void updateLabelLocked();
125 };
126 
127 #endif // BITCOIN_QT_COINCONTROLDIALOG_H
static QList< CAmount > payAmounts
Ui::CoinControlDialog * ui
static void updateLabels(WalletModel *, QDialog *)
void viewItemChanged(QTreeWidgetItem *, int)
const PlatformStyle * platformStyle
int getMappedColumn(int column, bool fVisibleColumn=true)
void showMenu(const QPoint &)
void sortView(int, Qt::SortOrder)
WalletModel * model
void setModel(WalletModel *model)
void buttonBoxClicked(QAbstractButton *)
static bool fSubtractFeeFromAmount
CoinControlDialog(const PlatformStyle *platformStyle, QWidget *parent=0)
static CCoinControl * coinControl
Qt::SortOrder sortOrder
QTreeWidgetItem * contextMenuItem
QAction * copyTransactionHashAction
QString strPad(QString, int, QString)