вернул сортировку по любому полю в "транзакциях"
[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 signals:
23     void beforeClose();
24
25 public:
26     explicit CoinControlDialog(QWidget *parent = 0);
27     ~CoinControlDialog();
28
29     void setModel(WalletModel *model);
30
31     // static because also called from sendcoinsdialog
32     static void updateLabels(WalletModel*, QWidget*);
33     static QString getPriorityLabel(double);
34
35     static QList<qint64> payAmounts;
36     static CCoinControl *coinControl;
37
38 protected:
39     void closeEvent(QCloseEvent* e);
40
41 private:
42     Ui::CoinControlDialog *ui;
43     WalletModel *model;
44     int sortColumn;
45     Qt::SortOrder sortOrder;
46
47     QMenu *contextMenu;
48     QTreeWidgetItem *contextMenuItem;
49     QAction *copyTransactionHashAction;
50     //QAction *lockAction;
51     //QAction *unlockAction;
52
53     QString strPad(QString, int, QString);
54     void sortView(int, Qt::SortOrder);
55     void updateView();
56
57     void keyPressEvent(QKeyEvent *);
58
59     enum
60     {
61         COLUMN_CHECKBOX,
62         COLUMN_AMOUNT,
63         COLUMN_LABEL,
64         COLUMN_ADDRESS,
65         COLUMN_DATE,
66         COLUMN_CONFIRMATIONS,
67         COLUMN_WEIGHT,
68         COLUMN_PRIORITY,
69         COLUMN_TXHASH,
70         COLUMN_VOUT_INDEX,
71         COLUMN_AMOUNT_INT64,
72         COLUMN_PRIORITY_INT64
73     };
74
75 private slots:
76     void showMenu(const QPoint &);
77     void copyAmount();
78     void copyLabel();
79     void copyAddress();
80     void copyTransactionHash();
81     //void lockCoin();
82     //void unlockCoin();
83     void clipboardQuantity();
84     void clipboardAmount();
85     void clipboardFee();
86     void clipboardAfterFee();
87     void clipboardBytes();
88     void clipboardPriority();
89     void clipboardLowOutput();
90     void clipboardChange();
91     void radioTreeMode(bool);
92     void radioListMode(bool);
93     void viewItemChanged(QTreeWidgetItem*, int);
94     void headerSectionClicked(int);
95     void on_buttonBox_accepted();
96     void buttonSelectAllClicked();
97     //void updateLabelLocked();
98 };
99
100 #endif // COINCONTROLDIALOG_H