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.

receivecoinsdialog.h 2.0KB

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