Commit cc61dd7b authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Allow to insert email when we double click

parent e67aba19
Pipeline #85352 passed with stage
in 57 minutes and 56 seconds
......@@ -23,6 +23,7 @@ SelectMailDialog::SelectMailDialog(QWidget *parent)
mSelectMailWidget->setObjectName(QStringLiteral("selectmailwidget"));
mainLayout->addWidget(mSelectMailWidget);
connect(mSelectMailWidget, &SelectMailWidget::doubleClicked, this, &SelectMailDialog::slotInsertEmails);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
buttonBox->setObjectName(QStringLiteral("buttonbox"));
......@@ -42,6 +43,11 @@ QStringList SelectMailDialog::selectedEmails() const
return mSelectMailWidget->selectedEmails();
}
void SelectMailDialog::slotInsertEmails()
{
Q_EMIT emailSelected(selectedEmails());
}
void SelectMailDialog::accept()
{
Q_EMIT emailSelected(selectedEmails());
......
......@@ -25,6 +25,7 @@ Q_SIGNALS:
private:
void writeConfig();
void readConfig();
void slotInsertEmails();
SelectMailWidget *const mSelectMailWidget;
};
......@@ -25,6 +25,7 @@ SelectMailWidget::SelectMailWidget(QWidget *parent)
mView->view()->setAlternatingRowColors(true);
mView->view()->setSortingEnabled(true);
mView->view()->sortByColumn(0, Qt::AscendingOrder);
connect(mView, &Akonadi::EmailAddressSelectionWidget::doubleClicked, this, &SelectMailWidget::doubleClicked);
}
SelectMailWidget::~SelectMailWidget()
......
......@@ -21,6 +21,9 @@ public:
Q_REQUIRED_RESULT QStringList selectedEmails() const;
Q_SIGNALS:
void doubleClicked();
private:
Akonadi::EmailAddressSelectionWidget *mView = nullptr;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment