Pimcommon
blacklistakonadisearchemailcompletionwidget.cpp
30BlackListAkonadiSearchEmailCompletionWidget::BlackListAkonadiSearchEmailCompletionWidget(QWidget *parent)
36 , mSearchButton(new QPushButton(QIcon::fromTheme(QStringLiteral("edit-find")), i18n("Search"), this))
39 , mShowAllBlackListedEmails(new QPushButton(i18nc("@action:button", "Show Blacklisted Emails"), this))
40 , mMoreResult(new QLabel(i18nc("@label:textbox", "<qt><a href=\"more_result\">More result...</a></qt>"), this))
53 mSearchLineEdit->setPlaceholderText(i18nc("@info:placeholder", "Research is done from 3 characters"));
58 connect(mSearchLineEdit, &QLineEdit::returnPressed, this, &BlackListAkonadiSearchEmailCompletionWidget::slotCheckIfUpdateBlackListIsNeeded);
62 connect(mSearchButton, &QAbstractButton::clicked, this, &BlackListAkonadiSearchEmailCompletionWidget::slotCheckIfUpdateBlackListIsNeeded);
67 connect(mShowAllBlackListedEmails, &QAbstractButton::clicked, this, &BlackListAkonadiSearchEmailCompletionWidget::slotShowAllBlacklistedEmail);
74 connect(mBlackListWarning, &BlackListAkonadiSearchEmailWarning::newSearch, this, &BlackListAkonadiSearchEmailCompletionWidget::slotSearch);
75 connect(mBlackListWarning, &BlackListAkonadiSearchEmailWarning::saveChanges, this, &BlackListAkonadiSearchEmailCompletionWidget::slotSaveChanges);
85 connect(mSelectButton, &QAbstractButton::clicked, this, &BlackListAkonadiSearchEmailCompletionWidget::slotSelectEmails);
89 connect(mUnselectButton, &QAbstractButton::clicked, this, &BlackListAkonadiSearchEmailCompletionWidget::slotUnselectEmails);
96 connect(mMoreResult, &QLabel::linkActivated, this, &BlackListAkonadiSearchEmailCompletionWidget::slotLinkClicked);
100 connect(mSearchLineEdit, &QLineEdit::textChanged, this, &BlackListAkonadiSearchEmailCompletionWidget::slotSearchLineEditChanged);
126 mExcludeDomainLineEdit->setPlaceholderText(i18nc("@info:placeholder", "Separate domain with \'%1\'", QLatin1Char(',')));
132 auto excludeEmailRegularExpressionLabel = new QLabel(i18nc("@label:textbox", "Exclude email with Regular Expression:"), this);
140 mExcludeEmailFromRegularExpressionLineEdit->setPlaceholderText(i18nc("@info:placeholder", "Separate regular expression with \'%1\'", QLatin1Char(',')));
142 connect(mEmailList, &QListWidget::itemSelectionChanged, this, &BlackListAkonadiSearchEmailCompletionWidget::slotSelectionChanged);
144 connect(mEmailList, &QListWidget::customContextMenuRequested, this, &BlackListAkonadiSearchEmailCompletionWidget::slotCustomContextMenuRequested);
147BlackListAkonadiSearchEmailCompletionWidget::~BlackListAkonadiSearchEmailCompletionWidget() = default;
156void BlackListAkonadiSearchEmailCompletionWidget::slotCustomContextMenuRequested(const QPoint &pos)
161 menu.addAction(i18n("Select"), this, &BlackListAkonadiSearchEmailCompletionWidget::slotSelectEmails);
163 menu.addAction(i18n("Unselect"), this, &BlackListAkonadiSearchEmailCompletionWidget::slotUnselectEmails);
173 const QStringList lstExcludeEmailsRegularExpressions = group.readEntry("ExcludeEmailsRegexp", QStringList());
175 mExcludeEmailFromRegularExpressionLineEdit->setText(lstExcludeEmailsRegularExpressions.join(QLatin1Char(',')));
187 const QString excludeEmailsRegexp = mExcludeEmailFromRegularExpressionLineEdit->text().remove(QLatin1Char(' '));
188 const QStringList newExcludeEmailsRegExp = excludeEmailsRegexp.split(QLatin1Char(','), Qt::SkipEmptyParts);
192 const QStringList newExcludeDomain = excludeDomains.split(QLatin1Char(','), Qt::SkipEmptyParts);
273 connect(job, &BlackListAkonadiSearchEmailSearchJob::emailsFound, this, &BlackListAkonadiSearchEmailCompletionWidget::slotEmailFound);
void clear()
void animatedShow()
QString i18np(const char *singular, const char *plural, const TYPE &arg...)
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
void catchReturnKey(QObject *lineEdit)
void clicked(bool checked)
void scrollToBottom()
void addLayout(QLayout *layout, int stretch)
bool isEmpty() const const
void linkActivated(const QString &link)
void setText(const QString &)
void setContentsMargins(const QMargins &margins)
void returnPressed()
void setText(const QString &)
void textChanged(const QString &text)
void itemSelectionChanged()
QList< QListWidgetItem * > selectedItems() const const
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
qsizetype length() const const
QStringList split(QChar sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const const
QString trimmed() const const
QString join(QChar separator) const const
Unchecked
NoContextMenu
SkipEmptyParts
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
void customContextMenuRequested(const QPoint &pos)
void setEnabled(bool)
QPoint mapToGlobal(const QPoint &pos) const const
pos
virtual void setVisible(bool visible)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:02:56 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:02:56 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.