2020-10-07 10:36:04 +00:00
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
2024-01-01 17:07:58 +00:00
|
|
|
// SPDX-FileCopyrightText: 2020-2024 The Monero Project
|
2020-10-07 10:36:04 +00:00
|
|
|
|
2021-06-27 12:51:15 +00:00
|
|
|
#ifndef FEATHER_CONTACTSWIDGET_H
|
|
|
|
#define FEATHER_CONTACTSWIDGET_H
|
2020-10-07 10:36:04 +00:00
|
|
|
|
2021-10-13 13:55:07 +00:00
|
|
|
#include <QPushButton>
|
2020-10-07 10:36:04 +00:00
|
|
|
#include <QWidget>
|
|
|
|
#include <QMenu>
|
|
|
|
|
2021-06-28 17:48:23 +00:00
|
|
|
#include "model/AddressBookModel.h"
|
|
|
|
#include "model/AddressBookProxyModel.h"
|
2023-03-01 02:05:56 +00:00
|
|
|
#include "libwalletqt/Wallet.h"
|
2021-06-28 17:48:23 +00:00
|
|
|
|
2020-10-07 10:36:04 +00:00
|
|
|
namespace Ui {
|
|
|
|
class ContactsWidget;
|
|
|
|
}
|
|
|
|
|
|
|
|
class ContactsWidget : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2023-03-01 02:05:56 +00:00
|
|
|
explicit ContactsWidget(Wallet *wallet, QWidget *parent = nullptr);
|
2020-12-23 04:54:57 +00:00
|
|
|
~ContactsWidget() override;
|
2020-10-07 10:36:04 +00:00
|
|
|
|
2021-05-23 14:58:18 +00:00
|
|
|
void setSearchbarVisible(bool visible);
|
|
|
|
void focusSearchbar();
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
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:
|
2021-06-27 12:13:05 +00:00
|
|
|
QScopedPointer<Ui::ContactsWidget> ui;
|
2023-03-01 02:05:56 +00:00
|
|
|
Wallet *m_wallet;
|
2020-10-07 10:36:04 +00:00
|
|
|
|
|
|
|
QAction *m_showFullAddressesAction;
|
|
|
|
QMenu *m_rowMenu;
|
|
|
|
QMenu *m_contextMenu;
|
|
|
|
QMenu *m_headerMenu;
|
|
|
|
AddressBookModel * m_model;
|
|
|
|
AddressBookProxyModel * m_proxyModel;
|
2021-10-13 13:55:07 +00:00
|
|
|
QPushButton *m_btn_addContact;
|
2020-10-07 10:36:04 +00:00
|
|
|
};
|
|
|
|
|
2021-06-27 12:51:15 +00:00
|
|
|
#endif // FEATHER_CONTACTSWIDGET_H
|