Mailcommon

invalidfilterwidget.cpp
1 /*
2  SPDX-FileCopyrightText: 2015-2022 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #include "invalidfilterwidget.h"
8 #include "invalidfilterlistview.h"
9 #include <KLocalizedString>
10 #include <QLabel>
11 #include <QVBoxLayout>
12 
13 using namespace MailCommon;
14 
15 InvalidFilterWidget::InvalidFilterWidget(QWidget *parent)
16  : QWidget(parent)
17  , mInvalidFilterListWidget(new InvalidFilterListView(this))
18 {
19  auto vbox = new QVBoxLayout(this);
20  vbox->setContentsMargins({});
21  auto lab =
22  new QLabel(i18n("The following filters are invalid (e.g. containing no actions "
23  "or no search rules). Discard or edit invalid filters?"));
24  lab->setWordWrap(true);
25  lab->setObjectName(QStringLiteral("label"));
26  vbox->addWidget(lab);
27 
28  mInvalidFilterListWidget->setObjectName(QStringLiteral("invalidfilterlist"));
29  connect(mInvalidFilterListWidget, &InvalidFilterListView::showDetails, this, &InvalidFilterWidget::showDetails);
30  connect(mInvalidFilterListWidget, &InvalidFilterListView::hideInformationWidget, this, &InvalidFilterWidget::hideInformationWidget);
31  vbox->addWidget(mInvalidFilterListWidget);
32 }
33 
34 InvalidFilterWidget::~InvalidFilterWidget() = default;
35 
36 void InvalidFilterWidget::setInvalidFilters(const QVector<InvalidFilterInfo> &lst)
37 {
38  mInvalidFilterListWidget->setInvalidFilters(lst);
39 }
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QString i18n(const char *text, const TYPE &arg...)
The filter dialog.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Sep 24 2022 03:58:15 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.