diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-05-14 10:31:46 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2011-05-14 10:31:46 +0200 |
commit | 1f2e0df86573910257318cbdc2c80d114f90d85c (patch) | |
tree | 9122f70c4b69955c6aa6f4b8eeb6f14129ef7856 /gui/include | |
parent | 4d1bb15e31d850776d13266262c37aedc8a68d72 (diff) |
begin integration with bitcoin upstream
Diffstat (limited to 'gui/include')
-rw-r--r-- | gui/include/aboutdialog.h | 25 | ||||
-rw-r--r-- | gui/include/addressbookdialog.h | 47 | ||||
-rw-r--r-- | gui/include/addresstablemodel.h | 32 | ||||
-rw-r--r-- | gui/include/bitcoinaddressvalidator.h | 21 | ||||
-rw-r--r-- | gui/include/bitcoingui.h | 69 | ||||
-rw-r--r-- | gui/include/editaddressdialog.h | 22 | ||||
-rw-r--r-- | gui/include/mainoptionspage.h | 18 | ||||
-rw-r--r-- | gui/include/optionsdialog.h | 29 | ||||
-rw-r--r-- | gui/include/sendcoinsdialog.h | 28 | ||||
-rw-r--r-- | gui/include/transactiontablemodel.h | 37 |
10 files changed, 328 insertions, 0 deletions
diff --git a/gui/include/aboutdialog.h b/gui/include/aboutdialog.h new file mode 100644 index 0000000000..827cc741c3 --- /dev/null +++ b/gui/include/aboutdialog.h @@ -0,0 +1,25 @@ +#ifndef ABOUTDIALOG_H +#define ABOUTDIALOG_H + +#include <QDialog> + +namespace Ui { + class AboutDialog; +} + +class AboutDialog : public QDialog +{ + Q_OBJECT + +public: + explicit AboutDialog(QWidget *parent = 0); + ~AboutDialog(); + +private: + Ui::AboutDialog *ui; + +private slots: + void on_buttonBox_accepted(); +}; + +#endif // ABOUTDIALOG_H diff --git a/gui/include/addressbookdialog.h b/gui/include/addressbookdialog.h new file mode 100644 index 0000000000..bf7c2a65a6 --- /dev/null +++ b/gui/include/addressbookdialog.h @@ -0,0 +1,47 @@ +#ifndef ADDRESSBOOKDIALOG_H +#define ADDRESSBOOKDIALOG_H + +#include <QDialog> + +namespace Ui { + class AddressBookDialog; +} +class AddressTableModel; + +QT_BEGIN_NAMESPACE +class QTableView; +QT_END_NAMESPACE + +class AddressBookDialog : public QDialog +{ + Q_OBJECT + +public: + explicit AddressBookDialog(QWidget *parent = 0); + ~AddressBookDialog(); + + enum { + SendingTab = 0, + ReceivingTab = 1 + } Tabs; + + void setModel(AddressTableModel *model); + void setTab(int tab); + const QString &getReturnValue() const { return returnValue; } +private: + Ui::AddressBookDialog *ui; + AddressTableModel *model; + QString returnValue; + + QTableView *getCurrentTable(); + +private slots: + void on_buttonBox_accepted(); + void on_deleteButton_clicked(); + void on_tabWidget_currentChanged(int index); + void on_newAddressButton_clicked(); + void on_editButton_clicked(); + void on_copyToClipboard_clicked(); +}; + +#endif // ADDRESSBOOKDIALOG_H diff --git a/gui/include/addresstablemodel.h b/gui/include/addresstablemodel.h new file mode 100644 index 0000000000..50ed80dd39 --- /dev/null +++ b/gui/include/addresstablemodel.h @@ -0,0 +1,32 @@ +#ifndef ADDRESSTABLEMODEL_H +#define ADDRESSTABLEMODEL_H + +#include <QAbstractTableModel> + +class AddressTableModel : public QAbstractTableModel +{ + Q_OBJECT +public: + explicit AddressTableModel(QObject *parent = 0); + + enum { + Label = 0, /* User specified label */ + Address = 1, /* Bitcoin address */ + Type = 2 /* Send/Receive, used for filter */ + } ColumnIndex; + + static const QString Send; /* Send addres */ + static const QString Receive; /* Receive address */ + + int rowCount(const QModelIndex &parent) const; + int columnCount(const QModelIndex &parent) const; + QVariant data(const QModelIndex &index, int role) const; + QVariant headerData(int section, Qt::Orientation orientation, int role) const; + Qt::ItemFlags flags(const QModelIndex &index) const; +signals: + +public slots: + +}; + +#endif // ADDRESSTABLEMODEL_H diff --git a/gui/include/bitcoinaddressvalidator.h b/gui/include/bitcoinaddressvalidator.h new file mode 100644 index 0000000000..8b57a24714 --- /dev/null +++ b/gui/include/bitcoinaddressvalidator.h @@ -0,0 +1,21 @@ +#ifndef BITCOINADDRESSVALIDATOR_H +#define BITCOINADDRESSVALIDATOR_H + +#include <QRegExpValidator> + +#include <base58.h> + +class BitcoinAddressValidator : public QRegExpValidator +{ + Q_OBJECT +public: + explicit BitcoinAddressValidator(QObject *parent = 0); + + static const QString valid_chars; +signals: + +public slots: + +}; + +#endif // BITCOINADDRESSVALIDATOR_H diff --git a/gui/include/bitcoingui.h b/gui/include/bitcoingui.h new file mode 100644 index 0000000000..9142b6b84b --- /dev/null +++ b/gui/include/bitcoingui.h @@ -0,0 +1,69 @@ +#ifndef BITCOINGUI_H +#define BITCOINGUI_H + +#include <QMainWindow> +#include <QSystemTrayIcon> + +/* Forward declarations */ +class TransactionTableModel; + +QT_BEGIN_NAMESPACE +class QLabel; +class QLineEdit; +QT_END_NAMESPACE + +class BitcoinGUI : public QMainWindow +{ + Q_OBJECT +public: + explicit BitcoinGUI(QWidget *parent = 0); + + /* Transaction table tab indices */ + enum { + AllTransactions = 0, + SentReceived = 1, + Sent = 2, + Received = 3 + } TabIndex; +private: + TransactionTableModel *transaction_model; + + QLineEdit *address; + QLabel *labelBalance; + QLabel *labelConnections; + QLabel *labelBlocks; + QLabel *labelTransactions; + + QAction *quit; + QAction *sendcoins; + QAction *addressbook; + QAction *about; + QAction *receiving_addresses; + QAction *options; + QAction *openBitCoin; + + QSystemTrayIcon *trayIcon; + + void createActions(); + QWidget *createTabs(); + void createTrayIcon(); + +public slots: + void setBalance(double balance); + void setAddress(const QString &address); + void setNumConnections(int count); + void setNumBlocks(int count); + void setNumTransactions(int count); + +private slots: + void sendcoinsClicked(); + void addressbookClicked(); + void optionsClicked(); + void receivingAddressesClicked(); + void aboutClicked(); + + void newAddressClicked(); + void copyClipboardClicked(); +}; + +#endif diff --git a/gui/include/editaddressdialog.h b/gui/include/editaddressdialog.h new file mode 100644 index 0000000000..650ed534a0 --- /dev/null +++ b/gui/include/editaddressdialog.h @@ -0,0 +1,22 @@ +#ifndef EDITADDRESSDIALOG_H +#define EDITADDRESSDIALOG_H + +#include <QDialog> + +namespace Ui { + class EditAddressDialog; +} + +class EditAddressDialog : public QDialog +{ + Q_OBJECT + +public: + explicit EditAddressDialog(QWidget *parent = 0); + ~EditAddressDialog(); + +private: + Ui::EditAddressDialog *ui; +}; + +#endif // EDITADDRESSDIALOG_H diff --git a/gui/include/mainoptionspage.h b/gui/include/mainoptionspage.h new file mode 100644 index 0000000000..de2ef9fcd0 --- /dev/null +++ b/gui/include/mainoptionspage.h @@ -0,0 +1,18 @@ +#ifndef MAINOPTIONSPAGE_H +#define MAINOPTIONSPAGE_H + +#include <QWidget> + +class MainOptionsPage : public QWidget +{ + Q_OBJECT +public: + explicit MainOptionsPage(QWidget *parent = 0); + +signals: + +public slots: + +}; + +#endif // MAINOPTIONSPAGE_H diff --git a/gui/include/optionsdialog.h b/gui/include/optionsdialog.h new file mode 100644 index 0000000000..501c82e9f3 --- /dev/null +++ b/gui/include/optionsdialog.h @@ -0,0 +1,29 @@ +#ifndef OPTIONSDIALOG_H +#define OPTIONSDIALOG_H + +#include <QDialog> + +QT_BEGIN_NAMESPACE +class QStackedWidget; +class QListWidget; +class QListWidgetItem; +QT_END_NAMESPACE + +class OptionsDialog : public QDialog +{ + Q_OBJECT +public: + explicit OptionsDialog(QWidget *parent = 0); + +signals: + +public slots: + void changePage(QListWidgetItem *current, QListWidgetItem *previous); +private: + QListWidget *contents_widget; + QStackedWidget *pages_widget; + + void setupMainPage(); +}; + +#endif // OPTIONSDIALOG_H diff --git a/gui/include/sendcoinsdialog.h b/gui/include/sendcoinsdialog.h new file mode 100644 index 0000000000..a2fcdd0762 --- /dev/null +++ b/gui/include/sendcoinsdialog.h @@ -0,0 +1,28 @@ +#ifndef SENDCOINSDIALOG_H +#define SENDCOINSDIALOG_H + +#include <QDialog> + +namespace Ui { + class SendCoinsDialog; +} + +class SendCoinsDialog : public QDialog +{ + Q_OBJECT + +public: + explicit SendCoinsDialog(QWidget *parent = 0); + ~SendCoinsDialog(); + +private: + Ui::SendCoinsDialog *ui; + +private slots: + void on_buttonBox_rejected(); + void on_addressBookButton_clicked(); + void on_pasteButton_clicked(); + void on_sendButton_clicked(); +}; + +#endif // SENDCOINSDIALOG_H diff --git a/gui/include/transactiontablemodel.h b/gui/include/transactiontablemodel.h new file mode 100644 index 0000000000..77ad730673 --- /dev/null +++ b/gui/include/transactiontablemodel.h @@ -0,0 +1,37 @@ +#ifndef TRANSACTIONTABLEMODEL_H +#define TRANSACTIONTABLEMODEL_H + +#include <QAbstractTableModel> +#include <QStringList> + +class TransactionTableModel : public QAbstractTableModel +{ + Q_OBJECT +public: + explicit TransactionTableModel(QObject *parent = 0); + + enum { + Status = 0, + Date = 1, + Description = 2, + Debit = 3, + Credit = 4, + Type = 5 + } ColumnIndex; + + /* Transaction type */ + static const QString Sent; + static const QString Received; + static const QString Generated; + + int rowCount(const QModelIndex &parent) const; + int columnCount(const QModelIndex &parent) const; + QVariant data(const QModelIndex &index, int role) const; + QVariant headerData(int section, Qt::Orientation orientation, int role) const; + Qt::ItemFlags flags(const QModelIndex &index) const; +private: + QStringList columns; +}; + +#endif + |