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.

coincontroldialog.h 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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_COINCONTROLDIALOG_H
  5. #define STARWELS_QT_COINCONTROLDIALOG_H
  6. #include "amount.h"
  7. #include <QAbstractButton>
  8. #include <QAction>
  9. #include <QDialog>
  10. #include <QList>
  11. #include <QMenu>
  12. #include <QPoint>
  13. #include <QString>
  14. #include <QTreeWidgetItem>
  15. class PlatformStyle;
  16. class WalletModel;
  17. class CCoinControl;
  18. namespace Ui {
  19. class CoinControlDialog;
  20. }
  21. #define ASYMP_UTF8 "\xE2\x89\x88"
  22. class CCoinControlWidgetItem : public QTreeWidgetItem
  23. {
  24. public:
  25. CCoinControlWidgetItem(QTreeWidget *parent, int type = Type) : QTreeWidgetItem(parent, type) {}
  26. CCoinControlWidgetItem(int type = Type) : QTreeWidgetItem(type) {}
  27. CCoinControlWidgetItem(QTreeWidgetItem *parent, int type = Type) : QTreeWidgetItem(parent, type) {}
  28. bool operator<(const QTreeWidgetItem &other) const;
  29. };
  30. class CoinControlDialog : public QDialog
  31. {
  32. Q_OBJECT
  33. public:
  34. explicit CoinControlDialog(const PlatformStyle *platformStyle, QWidget *parent = 0);
  35. ~CoinControlDialog();
  36. void setModel(WalletModel *model);
  37. // static because also called from sendcoinsdialog
  38. static void updateLabels(WalletModel*, QDialog*);
  39. static QList<CAmount> payAmounts;
  40. static CCoinControl *coinControl;
  41. static bool fSubtractFeeFromAmount;
  42. private:
  43. Ui::CoinControlDialog *ui;
  44. WalletModel *model;
  45. int sortColumn;
  46. Qt::SortOrder sortOrder;
  47. QMenu *contextMenu;
  48. QTreeWidgetItem *contextMenuItem;
  49. QAction *copyTransactionHashAction;
  50. QAction *lockAction;
  51. QAction *unlockAction;
  52. const PlatformStyle *platformStyle;
  53. void sortView(int, Qt::SortOrder);
  54. void updateView();
  55. enum
  56. {
  57. COLUMN_CHECKBOX = 0,
  58. COLUMN_AMOUNT,
  59. COLUMN_LABEL,
  60. COLUMN_ADDRESS,
  61. COLUMN_DATE,
  62. COLUMN_CONFIRMATIONS,
  63. COLUMN_TXHASH,
  64. COLUMN_VOUT_INDEX,
  65. };
  66. friend class CCoinControlWidgetItem;
  67. private Q_SLOTS:
  68. void showMenu(const QPoint &);
  69. void copyAmount();
  70. void copyLabel();
  71. void copyAddress();
  72. void copyTransactionHash();
  73. void lockCoin();
  74. void unlockCoin();
  75. void clipboardQuantity();
  76. void clipboardAmount();
  77. void clipboardFee();
  78. void clipboardAfterFee();
  79. void clipboardBytes();
  80. void clipboardLowOutput();
  81. void clipboardChange();
  82. void radioTreeMode(bool);
  83. void radioListMode(bool);
  84. void viewItemChanged(QTreeWidgetItem*, int);
  85. void headerSectionClicked(int);
  86. void buttonBoxClicked(QAbstractButton*);
  87. void buttonSelectAllClicked();
  88. void updateLabelLocked();
  89. };
  90. #endif // STARWELS_QT_COINCONTROLDIALOG_H