Pimcommon

blacklistbalooemailwarning.cpp
1/*
2 SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5
6*/
7
8#include "blacklistbalooemailwarning.h"
9using namespace Qt::Literals::StringLiterals;
10
11#include <KLocalizedString>
12#include <QAction>
13
14using namespace PimCommon;
15
16BlackListBalooEmailWarning::BlackListBalooEmailWarning(QWidget *parent)
17 : KMessageWidget(parent)
18{
19 setVisible(false);
20 setCloseButtonVisible(false);
21 setMessageType(Warning);
22 setWordWrap(true);
23
24 setText(i18n("The list was changed. Do you want to save before to make another search ?"));
25 auto saveAction = new QAction(i18nc("@action", "Save"), this);
26 saveAction->setObjectName("saveblacklist"_L1);
27 connect(saveAction, &QAction::triggered, this, &BlackListBalooEmailWarning::slotSaveBlackList);
28 addAction(saveAction);
29
30 auto searchAction = new QAction(i18nc("@action", "Search"), this);
31 searchAction->setObjectName("search"_L1);
32 connect(searchAction, &QAction::triggered, this, &BlackListBalooEmailWarning::slotSearch);
33 addAction(searchAction);
34
35 auto cancelAction = new QAction(i18nc("@action", "Cancel"), this);
36 cancelAction->setObjectName("cancel"_L1);
37 connect(cancelAction, &QAction::triggered, this, &BlackListBalooEmailWarning::animatedHide);
38 addAction(cancelAction);
39}
40
41BlackListBalooEmailWarning::~BlackListBalooEmailWarning() = default;
42
43void BlackListBalooEmailWarning::slotSaveBlackList()
44{
46 Q_EMIT saveChanges();
47}
48
49void BlackListBalooEmailWarning::slotSearch()
50{
52 Q_EMIT newSearch();
53}
54
55#include "moc_blacklistbalooemailwarning.cpp"
void animatedHide()
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
folderdialogacltab.h
void triggered(bool checked)
Q_EMITQ_EMIT
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:12:05 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.