Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

transactionview.h 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. // Copyright (c) 2011-2016 The Starwels developers
  2. // Distributed under the MIT software license, see the accompanying
  3. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
  4. #ifndef STARWELS_QT_TRANSACTIONVIEW_H
  5. #define STARWELS_QT_TRANSACTIONVIEW_H
  6. #include "guiutil.h"
  7. #include <QWidget>
  8. #include <QKeyEvent>
  9. class PlatformStyle;
  10. class TransactionFilterProxy;
  11. class WalletModel;
  12. QT_BEGIN_NAMESPACE
  13. class QComboBox;
  14. class QDateTimeEdit;
  15. class QFrame;
  16. class QLineEdit;
  17. class QMenu;
  18. class QModelIndex;
  19. class QSignalMapper;
  20. class QTableView;
  21. QT_END_NAMESPACE
  22. /** Widget showing the transaction list for a wallet, including a filter row.
  23. Using the filter row, the user can view or export a subset of the transactions.
  24. */
  25. class TransactionView : public QWidget
  26. {
  27. Q_OBJECT
  28. public:
  29. explicit TransactionView(const PlatformStyle *platformStyle, QWidget *parent = 0);
  30. void setModel(WalletModel *model);
  31. // Date ranges for filter
  32. enum DateEnum
  33. {
  34. All,
  35. Today,
  36. ThisWeek,
  37. ThisMonth,
  38. LastMonth,
  39. ThisYear,
  40. Range
  41. };
  42. enum ColumnWidths {
  43. STATUS_COLUMN_WIDTH = 30,
  44. WATCHONLY_COLUMN_WIDTH = 23,
  45. DATE_COLUMN_WIDTH = 120,
  46. TYPE_COLUMN_WIDTH = 113,
  47. AMOUNT_MINIMUM_COLUMN_WIDTH = 120,
  48. MINIMUM_COLUMN_WIDTH = 23
  49. };
  50. private:
  51. WalletModel *model;
  52. TransactionFilterProxy *transactionProxyModel;
  53. QTableView *transactionView;
  54. QComboBox *dateWidget;
  55. QComboBox *typeWidget;
  56. QComboBox *watchOnlyWidget;
  57. QLineEdit *addressWidget;
  58. QLineEdit *amountWidget;
  59. QMenu *contextMenu;
  60. QSignalMapper *mapperThirdPartyTxUrls;
  61. QFrame *dateRangeWidget;
  62. QDateTimeEdit *dateFrom;
  63. QDateTimeEdit *dateTo;
  64. QAction *abandonAction;
  65. QAction *bumpFeeAction;
  66. QWidget *createDateRangeWidget();
  67. GUIUtil::TableViewLastColumnResizingFixer *columnResizingFixer;
  68. virtual void resizeEvent(QResizeEvent* event);
  69. bool eventFilter(QObject *obj, QEvent *event);
  70. private Q_SLOTS:
  71. void contextualMenu(const QPoint &);
  72. void dateRangeChanged();
  73. void showDetails();
  74. void copyAddress();
  75. void editLabel();
  76. void copyLabel();
  77. void copyAmount();
  78. void copyTxID();
  79. void copyTxHex();
  80. void copyTxPlainText();
  81. void openThirdPartyTxUrl(QString url);
  82. void updateWatchOnlyColumn(bool fHaveWatchOnly);
  83. void abandonTx();
  84. void bumpFee();
  85. Q_SIGNALS:
  86. void doubleClicked(const QModelIndex&);
  87. /** Fired when a message should be reported to the user */
  88. void message(const QString &title, const QString &message, unsigned int style);
  89. public Q_SLOTS:
  90. void chooseDate(int idx);
  91. void chooseType(int idx);
  92. void chooseWatchonly(int idx);
  93. void changedAmount();
  94. void changedPrefix();
  95. void exportClicked();
  96. void focusTransaction(const QModelIndex&);
  97. };
  98. #endif // STARWELS_QT_TRANSACTIONVIEW_H