File indexing completed on 2025-01-19 04:46:43

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 "confirmaddressplugin.h"
0008 #include "confirmaddressconfiguredialog.h"
0009 #include "confirmaddressconfigurewidget.h"
0010 #include "confirmaddressinterface.h"
0011 
0012 #include <KPluginFactory>
0013 
0014 K_PLUGIN_CLASS_WITH_JSON(ConfirmAddressPlugin, "kmail_confirmaddressplugin.json")
0015 
0016 ConfirmAddressPlugin::ConfirmAddressPlugin(QObject *parent, const QList<QVariant> &)
0017     : MessageComposer::PluginEditorCheckBeforeSend(parent)
0018 {
0019 }
0020 
0021 ConfirmAddressPlugin::~ConfirmAddressPlugin() = default;
0022 
0023 MessageComposer::PluginEditorCheckBeforeSendInterface *ConfirmAddressPlugin::createInterface(QObject *parent)
0024 {
0025     auto interface = new ConfirmAddressInterface(parent);
0026     connect(this, &ConfirmAddressPlugin::configChanged, interface, &ConfirmAddressInterface::reloadConfig);
0027     connect(interface, &ConfirmAddressInterface::forceReloadConfig, this, &ConfirmAddressPlugin::configChanged);
0028     return interface;
0029 }
0030 
0031 bool ConfirmAddressPlugin::hasConfigureDialog() const
0032 {
0033     return true;
0034 }
0035 
0036 void ConfirmAddressPlugin::showConfigureDialog(QWidget *parent)
0037 {
0038     ConfirmAddressConfigureDialog dlg(parent);
0039     dlg.exec();
0040 }
0041 
0042 #include "confirmaddressplugin.moc"
0043 
0044 #include "moc_confirmaddressplugin.cpp"