2011-07-07 17:33:15 +02:00
|
|
|
#ifndef ADDRESSBOOKPAGE_H
|
|
|
|
#define ADDRESSBOOKPAGE_H
|
2011-05-08 22:23:31 +02:00
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
|
2011-05-12 14:44:52 +02:00
|
|
|
namespace Ui {
|
2011-07-07 17:33:15 +02:00
|
|
|
class AddressBookPage;
|
2011-05-12 14:44:52 +02:00
|
|
|
}
|
2011-05-13 15:58:27 +02:00
|
|
|
class AddressTableModel;
|
2012-06-24 18:28:05 +02:00
|
|
|
class OptionsModel;
|
2011-05-12 14:44:52 +02:00
|
|
|
|
2011-05-13 22:00:27 +02:00
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
class QTableView;
|
2011-07-06 21:52:23 +02:00
|
|
|
class QItemSelection;
|
2011-07-09 10:53:55 +02:00
|
|
|
class QSortFilterProxyModel;
|
2011-12-04 18:01:53 +01:00
|
|
|
class QMenu;
|
2012-05-06 22:41:35 +02:00
|
|
|
class QModelIndex;
|
2011-05-13 22:00:27 +02:00
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
2011-11-13 13:19:52 +01:00
|
|
|
/** Widget that shows a list of sending or receiving addresses.
|
|
|
|
*/
|
2011-07-07 17:33:15 +02:00
|
|
|
class AddressBookPage : public QDialog
|
2011-05-08 22:23:31 +02:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
2011-05-12 14:44:52 +02:00
|
|
|
|
2011-05-08 22:23:31 +02:00
|
|
|
public:
|
2011-06-13 12:07:32 +02:00
|
|
|
enum Tabs {
|
2011-05-12 14:44:52 +02:00
|
|
|
SendingTab = 0,
|
|
|
|
ReceivingTab = 1
|
2011-06-13 12:07:32 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
enum Mode {
|
2011-11-13 13:19:52 +01:00
|
|
|
ForSending, /**< Open address book to pick address for sending */
|
|
|
|
ForEditing /**< Open address book for editing */
|
2011-06-13 12:07:32 +02:00
|
|
|
};
|
|
|
|
|
2011-07-07 17:33:15 +02:00
|
|
|
explicit AddressBookPage(Mode mode, Tabs tab, QWidget *parent = 0);
|
|
|
|
~AddressBookPage();
|
2011-05-08 22:23:31 +02:00
|
|
|
|
2011-05-13 15:58:27 +02:00
|
|
|
void setModel(AddressTableModel *model);
|
2012-06-24 18:28:05 +02:00
|
|
|
void setOptionsModel(OptionsModel *optionsModel);
|
2011-05-13 22:00:27 +02:00
|
|
|
const QString &getReturnValue() const { return returnValue; }
|
2011-07-07 17:33:15 +02:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void done(int retval);
|
2011-07-09 10:53:55 +02:00
|
|
|
void exportClicked();
|
2011-07-07 17:33:15 +02:00
|
|
|
|
2011-05-12 14:44:52 +02:00
|
|
|
private:
|
2011-07-07 17:33:15 +02:00
|
|
|
Ui::AddressBookPage *ui;
|
2011-05-13 15:58:27 +02:00
|
|
|
AddressTableModel *model;
|
2012-06-24 18:28:05 +02:00
|
|
|
OptionsModel *optionsModel;
|
2011-07-02 17:31:27 +02:00
|
|
|
Mode mode;
|
2011-07-07 17:33:15 +02:00
|
|
|
Tabs tab;
|
2011-05-13 22:00:27 +02:00
|
|
|
QString returnValue;
|
2011-07-09 10:53:55 +02:00
|
|
|
QSortFilterProxyModel *proxyModel;
|
2011-12-04 18:01:53 +01:00
|
|
|
QMenu *contextMenu;
|
2013-01-10 08:52:39 +01:00
|
|
|
QAction *deleteAction; // to be able to explicitly disable it
|
2012-05-06 22:41:35 +02:00
|
|
|
QString newAddressToSelect;
|
2011-05-13 22:00:27 +02:00
|
|
|
|
2011-05-12 17:55:24 +02:00
|
|
|
private slots:
|
2013-01-10 08:52:39 +01:00
|
|
|
/** Delete currently selected address entry */
|
2011-05-13 22:00:27 +02:00
|
|
|
void on_deleteButton_clicked();
|
2013-01-10 08:52:39 +01:00
|
|
|
/** Create a new address for receiving coins and / or add a new address book entry */
|
2011-05-12 17:55:24 +02:00
|
|
|
void on_newAddressButton_clicked();
|
2011-12-04 18:01:53 +01:00
|
|
|
/** Copy address of currently selected address entry to clipboard */
|
2011-05-12 17:55:24 +02:00
|
|
|
void on_copyToClipboard_clicked();
|
2013-01-10 08:52:39 +01:00
|
|
|
/** Open the sign message tab in the Sign/Verify Message dialog with currently selected address */
|
2011-12-23 16:14:57 +01:00
|
|
|
void on_signMessage_clicked();
|
2013-01-10 08:52:39 +01:00
|
|
|
/** Open the verify message tab in the Sign/Verify Message dialog with currently selected address */
|
2012-06-15 09:48:26 +02:00
|
|
|
void on_verifyMessage_clicked();
|
2013-01-25 18:46:53 +01:00
|
|
|
/** Open send coins dialog for currently selected address (no button) */
|
|
|
|
void onSendCoins_clicked();
|
2013-01-10 08:52:39 +01:00
|
|
|
/** Generate a QR Code from the currently selected address */
|
2011-11-10 15:20:17 +01:00
|
|
|
void on_showQRCode_clicked();
|
2013-01-10 08:52:39 +01:00
|
|
|
/** Copy label of currently selected address entry to clipboard (no button) */
|
2011-12-04 18:01:53 +01:00
|
|
|
void onCopyLabelAction();
|
2013-01-10 08:52:39 +01:00
|
|
|
/** Edit currently selected address entry (no button) */
|
2011-12-04 18:01:53 +01:00
|
|
|
void onEditAction();
|
2012-05-06 22:41:35 +02:00
|
|
|
|
2013-01-10 08:52:39 +01:00
|
|
|
/** Set button states based on selected tab and selection */
|
|
|
|
void selectionChanged();
|
|
|
|
/** Spawn contextual menu (right mouse menu) for address book entry */
|
|
|
|
void contextualMenu(const QPoint &point);
|
2012-05-06 22:41:35 +02:00
|
|
|
/** New entry/entries were added to address table */
|
2012-12-15 11:15:19 +01:00
|
|
|
void selectNewAddress(const QModelIndex &parent, int begin, int /*end*/);
|
2012-07-08 18:48:56 +02:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void signMessage(QString addr);
|
|
|
|
void verifyMessage(QString addr);
|
2013-01-25 18:46:53 +01:00
|
|
|
void sendCoins(QString addr);
|
2011-05-08 22:23:31 +02:00
|
|
|
};
|
|
|
|
|
2012-11-08 21:45:32 +01:00
|
|
|
#endif // ADDRESSBOOKPAGE_H
|