Master Core  v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
coincontroldialog.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2013 The Bitcoin developers
2 // Distributed under the MIT/X11 software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef COINCONTROLDIALOG_H
6 #define COINCONTROLDIALOG_H
7 
8 #include <QAbstractButton>
9 #include <QAction>
10 #include <QDialog>
11 #include <QList>
12 #include <QMenu>
13 #include <QPoint>
14 #include <QString>
15 #include <QTreeWidgetItem>
16 
17 namespace Ui {
18  class CoinControlDialog;
19 }
20 class WalletModel;
21 class CCoinControl;
22 
23 class CoinControlDialog : public QDialog
24 {
25  Q_OBJECT
26 
27 public:
28  explicit CoinControlDialog(QWidget *parent = 0);
30 
31  void setModel(WalletModel *model);
32 
33  // static because also called from sendcoinsdialog
34  static void updateLabels(WalletModel*, QDialog*);
35  static QString getPriorityLabel(double);
36 
37  static QList<qint64> payAmounts;
39 
40 private:
44  Qt::SortOrder sortOrder;
45 
46  QMenu *contextMenu;
47  QTreeWidgetItem *contextMenuItem;
49  QAction *lockAction;
50  QAction *unlockAction;
51 
52  QString strPad(QString, int, QString);
53  void sortView(int, Qt::SortOrder);
54  void updateView();
55 
56  enum
57  {
70  };
71 
72  // some columns have a hidden column containing the value used for sorting
73  int getMappedColumn(int column, bool fVisibleColumn = true)
74  {
75  if (fVisibleColumn)
76  {
77  if (column == COLUMN_AMOUNT_INT64)
78  return COLUMN_AMOUNT;
79  else if (column == COLUMN_PRIORITY_INT64)
80  return COLUMN_PRIORITY;
81  else if (column == COLUMN_DATE_INT64)
82  return COLUMN_DATE;
83  }
84  else
85  {
86  if (column == COLUMN_AMOUNT)
87  return COLUMN_AMOUNT_INT64;
88  else if (column == COLUMN_PRIORITY)
89  return COLUMN_PRIORITY_INT64;
90  else if (column == COLUMN_DATE)
91  return COLUMN_DATE_INT64;
92  }
93 
94  return column;
95  }
96 
97 private slots:
98  void showMenu(const QPoint &);
99  void copyAmount();
100  void copyLabel();
101  void copyAddress();
102  void copyTransactionHash();
103  void lockCoin();
104  void unlockCoin();
105  void clipboardQuantity();
106  void clipboardAmount();
107  void clipboardFee();
108  void clipboardAfterFee();
109  void clipboardBytes();
110  void clipboardPriority();
111  void clipboardLowOutput();
112  void clipboardChange();
113  void radioTreeMode(bool);
114  void radioListMode(bool);
115  void viewItemChanged(QTreeWidgetItem*, int);
116  void headerSectionClicked(int);
117  void buttonBoxClicked(QAbstractButton*);
118  void buttonSelectAllClicked();
119  void updateLabelLocked();
120 };
121 
122 #endif // COINCONTROLDIALOG_H
void viewItemChanged(QTreeWidgetItem *, int)
static CCoinControl * coinControl
int getMappedColumn(int column, bool fVisibleColumn=true)
Coin Control Features.
Definition: coincontrol.h:11
QAction * copyTransactionHashAction
Ui::CoinControlDialog * ui
static QString getPriorityLabel(double)
CoinControlDialog(QWidget *parent=0)
static void updateLabels(WalletModel *, QDialog *)
void setModel(WalletModel *model)
QTreeWidgetItem * contextMenuItem
Interface to Bitcoin wallet from Qt view code.
Definition: walletmodel.h:96
void sortView(int, Qt::SortOrder)
static QList< qint64 > payAmounts
Qt::SortOrder sortOrder
QString strPad(QString, int, QString)
void buttonBoxClicked(QAbstractButton *)
WalletModel * model
void showMenu(const QPoint &)