Warning, file /pim/mailcommon/src/filter/invalidfilters/invalidfilterwidget.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* 0002 SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #include "invalidfilterwidget.h" 0008 #include "invalidfilterlistview.h" 0009 #include <KLocalizedString> 0010 #include <QLabel> 0011 #include <QVBoxLayout> 0012 0013 using namespace MailCommon; 0014 0015 InvalidFilterWidget::InvalidFilterWidget(QWidget *parent) 0016 : QWidget(parent) 0017 , mInvalidFilterListWidget(new InvalidFilterListView(this)) 0018 { 0019 auto vbox = new QVBoxLayout(this); 0020 vbox->setContentsMargins({}); 0021 auto lab = 0022 new QLabel(i18n("The following filters are invalid (e.g. containing no actions " 0023 "or no search rules). Discard or edit invalid filters?")); 0024 lab->setWordWrap(true); 0025 lab->setObjectName(QLatin1StringView("label")); 0026 vbox->addWidget(lab); 0027 0028 mInvalidFilterListWidget->setObjectName(QLatin1StringView("invalidfilterlist")); 0029 connect(mInvalidFilterListWidget, &InvalidFilterListView::showDetails, this, &InvalidFilterWidget::showDetails); 0030 connect(mInvalidFilterListWidget, &InvalidFilterListView::hideInformationWidget, this, &InvalidFilterWidget::hideInformationWidget); 0031 vbox->addWidget(mInvalidFilterListWidget); 0032 } 0033 0034 InvalidFilterWidget::~InvalidFilterWidget() = default; 0035 0036 void InvalidFilterWidget::setInvalidFilters(const QList<InvalidFilterInfo> &lst) 0037 { 0038 mInvalidFilterListWidget->setInvalidFilters(lst); 0039 } 0040 0041 #include "moc_invalidfilterwidget.cpp"