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