You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

transactionview.h 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. #ifndef TRANSACTIONVIEW_H
  5. #define TRANSACTIONVIEW_H
  6. #include "guiutil.h"
  7. #include <QWidget>
  8. class TransactionFilterProxy;
  9. class WalletModel;
  10. QT_BEGIN_NAMESPACE
  11. class QComboBox;
  12. class QDateTimeEdit;
  13. class QFrame;
  14. class QLineEdit;
  15. class QMenu;
  16. class QModelIndex;
  17. class QSignalMapper;
  18. class QTableView;
  19. QT_END_NAMESPACE
  20. /** Widget showing the transaction list for a wallet, including a filter row.
  21. Using the filter row, the user can view or export a subset of the transactions.
  22. */
  23. class TransactionView : public QWidget
  24. {
  25. Q_OBJECT
  26. public:
  27. explicit TransactionView(QWidget *parent = 0);
  28. void setModel(WalletModel *model);
  29. // Date ranges for filter
  30. enum DateEnum
  31. {
  32. All,
  33. Today,
  34. ThisWeek,
  35. ThisMonth,
  36. LastMonth,
  37. ThisYear,
  38. Range
  39. };
  40. enum ColumnWidths {
  41. STATUS_COLUMN_WIDTH = 23,
  42. DATE_COLUMN_WIDTH = 120,
  43. TYPE_COLUMN_WIDTH = 120,
  44. AMOUNT_MINIMUM_COLUMN_WIDTH = 120,
  45. MINIMUM_COLUMN_WIDTH = 23
  46. };
  47. private:
  48. WalletModel *model;
  49. TransactionFilterProxy *transactionProxyModel;
  50. QTableView *transactionView;
  51. QComboBox *dateWidget;
  52. QComboBox *typeWidget;
  53. QLineEdit *addressWidget;
  54. QLineEdit *amountWidget;
  55. QMenu *contextMenu;
  56. QSignalMapper *mapperThirdPartyTxUrls;
  57. QFrame *dateRangeWidget;
  58. QDateTimeEdit *dateFrom;
  59. QDateTimeEdit *dateTo;
  60. QWidget *createDateRangeWidget();
  61. GUIUtil::TableViewLastColumnResizingFixer *columnResizingFixer;
  62. virtual void resizeEvent(QResizeEvent* event);
  63. private slots:
  64. void contextualMenu(const QPoint &);
  65. void dateRangeChanged();
  66. void showDetails();
  67. void copyAddress();
  68. void editLabel();
  69. void copyLabel();
  70. void copyAmount();
  71. void copyTxID();
  72. void openThirdPartyTxUrl(QString url);
  73. signals:
  74. void doubleClicked(const QModelIndex&);
  75. /** Fired when a message should be reported to the user */
  76. void message(const QString &title, const QString &message, unsigned int style);
  77. public slots:
  78. void chooseDate(int idx);
  79. void chooseType(int idx);
  80. void changedPrefix(const QString &prefix);
  81. void changedAmount(const QString &amount);
  82. void exportClicked();
  83. void focusTransaction(const QModelIndex&);
  84. };
  85. #endif // TRANSACTIONVIEW_H