File indexing completed on 2025-01-05 04:49:30

0001 /*
0002    SPDX-FileCopyrightText: 2016-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #include "automaticaddcontactsplugin.h"
0008 #include "automaticaddcontactsconfiguredialog.h"
0009 #include "automaticaddcontactsinterface.h"
0010 
0011 #include <KPluginFactory>
0012 
0013 K_PLUGIN_CLASS_WITH_JSON(AutomaticAddContactsPlugin, "kmail_automaticaddcontactsplugin.json")
0014 AutomaticAddContactsPlugin::AutomaticAddContactsPlugin(QObject *parent, const QList<QVariant> &)
0015     : MessageComposer::PluginEditorCheckBeforeSend(parent)
0016 {
0017 }
0018 
0019 AutomaticAddContactsPlugin::~AutomaticAddContactsPlugin() = default;
0020 
0021 MessageComposer::PluginEditorCheckBeforeSendInterface *AutomaticAddContactsPlugin::createInterface(QObject *parent)
0022 {
0023     auto interface = new AutomaticAddContactsInterface(parent);
0024     connect(this, &AutomaticAddContactsPlugin::configChanged, interface, &AutomaticAddContactsInterface::reloadConfig);
0025     return interface;
0026 }
0027 
0028 bool AutomaticAddContactsPlugin::hasConfigureDialog() const
0029 {
0030     return true;
0031 }
0032 
0033 void AutomaticAddContactsPlugin::showConfigureDialog(QWidget *parent)
0034 {
0035     AutomaticAddContactsConfigureDialog dlg(parent);
0036     dlg.exec();
0037 }
0038 
0039 #include "automaticaddcontactsplugin.moc"
0040 
0041 #include "moc_automaticaddcontactsplugin.cpp"