mirror of
https://github.com/feather-wallet/feather.git
synced 2024-12-23 12:09:50 +00:00
contacts: double click to pay to
This commit is contained in:
parent
e2a591baed
commit
e8057fc35d
1 changed files with 7 additions and 2 deletions
|
@ -36,6 +36,12 @@ ContactsWidget::ContactsWidget(QSharedPointer<AppContext> ctx, QWidget *parent)
|
||||||
|
|
||||||
connect(ui->contacts->header(), &QHeaderView::customContextMenuRequested, this, &ContactsWidget::showHeaderMenu);
|
connect(ui->contacts->header(), &QHeaderView::customContextMenuRequested, this, &ContactsWidget::showHeaderMenu);
|
||||||
|
|
||||||
|
connect(ui->contacts, &QTreeView::doubleClicked, [this](QModelIndex index){
|
||||||
|
if (!(m_model->flags(index) & Qt::ItemIsEditable)) {
|
||||||
|
this->payTo();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// context menu
|
// context menu
|
||||||
ui->contacts->setContextMenuPolicy(Qt::CustomContextMenu);
|
ui->contacts->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
m_contextMenu = new QMenu(ui->contacts);
|
m_contextMenu = new QMenu(ui->contacts);
|
||||||
|
@ -45,8 +51,7 @@ ContactsWidget::ContactsWidget(QSharedPointer<AppContext> ctx, QWidget *parent)
|
||||||
|
|
||||||
// row context menu
|
// row context menu
|
||||||
m_rowMenu = new QMenu(ui->contacts);
|
m_rowMenu = new QMenu(ui->contacts);
|
||||||
m_rowMenu->addAction(icons()->icon("copy.png"), "Copy address", this, &ContactsWidget::copyAddress);
|
m_rowMenu->addAction("Copy address", this, &ContactsWidget::copyAddress);
|
||||||
m_rowMenu->addAction(icons()->icon("copy.png"), "Copy name", this, &ContactsWidget::copyName);
|
|
||||||
m_rowMenu->addAction("Pay to", this, &ContactsWidget::payTo);
|
m_rowMenu->addAction("Pay to", this, &ContactsWidget::payTo);
|
||||||
m_rowMenu->addAction("Delete", this, &ContactsWidget::deleteContact);
|
m_rowMenu->addAction("Delete", this, &ContactsWidget::deleteContact);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue