Line data Source code
1 : // Copyright (c) 2011-2014 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_RECEIVECOINSDIALOG_H
6 : #define BITCOIN_QT_RECEIVECOINSDIALOG_H
7 :
8 : #include "guiutil.h"
9 :
10 : #include <QDialog>
11 : #include <QHeaderView>
12 : #include <QItemSelection>
13 : #include <QKeyEvent>
14 : #include <QMenu>
15 : #include <QPoint>
16 : #include <QVariant>
17 :
18 : class OptionsModel;
19 : class PlatformStyle;
20 : class WalletModel;
21 :
22 : namespace Ui {
23 : class ReceiveCoinsDialog;
24 : }
25 :
26 : QT_BEGIN_NAMESPACE
27 : class QModelIndex;
28 : QT_END_NAMESPACE
29 :
30 : /** Dialog for requesting payment of bitcoins */
31 : class ReceiveCoinsDialog : public QDialog
32 : {
33 0 : Q_OBJECT
34 :
35 : public:
36 : enum ColumnWidths {
37 : DATE_COLUMN_WIDTH = 130,
38 : LABEL_COLUMN_WIDTH = 120,
39 : AMOUNT_MINIMUM_COLUMN_WIDTH = 160,
40 : MINIMUM_COLUMN_WIDTH = 130
41 : };
42 :
43 : explicit ReceiveCoinsDialog(const PlatformStyle *platformStyle, QWidget *parent = 0);
44 : ~ReceiveCoinsDialog();
45 :
46 : void setModel(WalletModel *model);
47 :
48 : public Q_SLOTS:
49 : void clear();
50 : void reject();
51 : void accept();
52 :
53 : protected:
54 : virtual void keyPressEvent(QKeyEvent *event);
55 :
56 : private:
57 : Ui::ReceiveCoinsDialog *ui;
58 : GUIUtil::TableViewLastColumnResizingFixer *columnResizingFixer;
59 : WalletModel *model;
60 : QMenu *contextMenu;
61 : const PlatformStyle *platformStyle;
62 :
63 : void copyColumnToClipboard(int column);
64 : virtual void resizeEvent(QResizeEvent *event);
65 :
66 : private Q_SLOTS:
67 : void on_receiveButton_clicked();
68 : void on_showRequestButton_clicked();
69 : void on_removeRequestButton_clicked();
70 : void on_recentRequestsView_doubleClicked(const QModelIndex &index);
71 : void recentRequestsView_selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
72 : void updateDisplayUnit();
73 : void showMenu(const QPoint &point);
74 : void copyLabel();
75 : void copyMessage();
76 : void copyAmount();
77 : };
78 :
79 : #endif // BITCOIN_QT_RECEIVECOINSDIALOG_H
|