2020-10-07 10:36:04 +00:00
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
2020-12-26 19:56:06 +00:00
|
|
|
// Copyright (c) 2020-2021, The Monero Project.
|
2020-10-07 10:36:04 +00:00
|
|
|
|
|
|
|
#ifndef CONTACTSWIDGET_H
|
|
|
|
#define CONTACTSWIDGET_H
|
|
|
|
|
|
|
|
#include "model/AddressBookModel.h"
|
|
|
|
#include "model/AddressBookProxyModel.h"
|
2020-12-23 04:54:57 +00:00
|
|
|
#include "appcontext.h"
|
2020-10-07 10:36:04 +00:00
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QMenu>
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class ContactsWidget;
|
|
|
|
}
|
|
|
|
|
|
|
|
class ContactsWidget : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit ContactsWidget(QWidget *parent = nullptr);
|
2021-05-10 15:05:10 +00:00
|
|
|
void setModel(AddressBookModel *model, Wallet *wallet);
|
2020-12-23 04:54:57 +00:00
|
|
|
~ContactsWidget() override;
|
2020-10-07 10:36:04 +00:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void copyAddress();
|
|
|
|
void copyName();
|
|
|
|
void payTo();
|
2020-12-23 04:54:57 +00:00
|
|
|
void newContact(QString address = "", QString name = "");
|
2020-10-07 10:36:04 +00:00
|
|
|
void deleteContact();
|
|
|
|
void setShowFullAddresses(bool show);
|
|
|
|
void setSearchFilter(const QString &filter);
|
2020-12-31 06:54:19 +00:00
|
|
|
void resetModel();
|
2020-10-07 10:36:04 +00:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void fillAddress(QString &address);
|
|
|
|
|
|
|
|
private slots:
|
2020-12-23 04:54:57 +00:00
|
|
|
void showHeaderMenu(const QPoint &position);
|
2020-10-07 10:36:04 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
Ui::ContactsWidget *ui;
|
|
|
|
|
|
|
|
QAction *m_showFullAddressesAction;
|
|
|
|
QMenu *m_rowMenu;
|
|
|
|
QMenu *m_contextMenu;
|
|
|
|
QMenu *m_headerMenu;
|
|
|
|
AddressBookModel * m_model;
|
|
|
|
AddressBookProxyModel * m_proxyModel;
|
2021-05-10 15:05:10 +00:00
|
|
|
Wallet *m_wallet;
|
2020-10-07 10:36:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CONTACTSWIDGET_H
|