1301fb9f3b87541ffa5e0713446a9575483186a6
[novacoin.git] / src / qt / coincontroldialog.h
1 #ifndef COINCONTROLDIALOG_H
2 #define COINCONTROLDIALOG_H
3
4 #include <QAbstractButton>
5 #include <QAction>
6 #include <QWidget>
7 #include <QList>
8 #include <QMenu>
9 #include <QPoint>
10 #include <QString>
11 #include <QTreeWidgetItem>
12
13 namespace Ui {
14     class CoinControlDialog;
15 }
16 class WalletModel;
17 class CCoinControl;
18
19 class CoinControlDialog : public QWidget
20 {
21     Q_OBJECT
22
23 public:
24     explicit CoinControlDialog(QWidget *parent = 0);
25     ~CoinControlDialog();
26
27     void setModel(WalletModel *model);
28
29     // static because also called from sendcoinsdialog
30     static void updateLabels(WalletModel*, QWidget*);
31     static QString getPriorityLabel(double);
32
33     static QList<qint64> payAmounts;
34     static CCoinControl *coinControl;
35
36 private:
37     Ui::CoinControlDialog *ui;
38     WalletModel *model;
39     int sortColumn;
40     Qt::SortOrder sortOrder;
41
42     QMenu *contextMenu;
43     QTreeWidgetItem *contextMenuItem;
44     QAction *copyTransactionHashAction;
45     //QAction *lockAction;
46     //QAction *unlockAction;
47
48     QString strPad(QString, int, QString);
49     void sortView(int, Qt::SortOrder);
50     void updateView();
51
52     void keyPressEvent(QKeyEvent *);
53
54     enum
55     {
56         COLUMN_CHECKBOX,
57         COLUMN_AMOUNT,
58         COLUMN_LABEL,
59         COLUMN_ADDRESS,
60         COLUMN_DATE,
61         COLUMN_CONFIRMATIONS,
62         COLUMN_WEIGHT,
63         COLUMN_PRIORITY,
64         COLUMN_TXHASH,
65         COLUMN_VOUT_INDEX,
66         COLUMN_AMOUNT_INT64,
67         COLUMN_PRIORITY_INT64
68     };
69
70 private slots:
71     void showMenu(const QPoint &);
72     void copyAmount();
73     void copyLabel();
74     void copyAddress();
75     void copyTransactionHash();
76     //void lockCoin();
77     //void unlockCoin();
78     void clipboardQuantity();
79     void clipboardAmount();
80     void clipboardFee();
81     void clipboardAfterFee();
82     void clipboardBytes();
83     void clipboardPriority();
84     void clipboardLowOutput();
85     void clipboardChange();
86     void radioTreeMode(bool);
87     void radioListMode(bool);
88     void viewItemChanged(QTreeWidgetItem*, int);
89     void headerSectionClicked(int);
90     void on_buttonBox_accepted();
91     void buttonSelectAllClicked();
92     //void updateLabelLocked();
93 };
94
95 #endif // COINCONTROLDIALOG_H