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

0001 /*
0002    SPDX-FileCopyrightText: 2017-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #include "insertshorturlplugineditor.h"
0008 #include "insertshorturlconfiguredialog.h"
0009 #include "insertshorturlplugineditorinterface.h"
0010 #include <KPluginFactory>
0011 #include <QPointer>
0012 
0013 K_PLUGIN_CLASS_WITH_JSON(InsertShorturlPluginEditor, "kmail_insertshorturleditorplugin.json")
0014 
0015 InsertShorturlPluginEditor::InsertShorturlPluginEditor(QObject *parent, const QList<QVariant> &)
0016     : MessageComposer::PluginEditor(parent)
0017 {
0018 }
0019 
0020 InsertShorturlPluginEditor::~InsertShorturlPluginEditor() = default;
0021 
0022 MessageComposer::PluginEditorInterface *InsertShorturlPluginEditor::createInterface(QObject *parent)
0023 {
0024     auto interface = new InsertShorturlPluginEditorInterface(parent);
0025     connect(this, &InsertShorturlPluginEditor::configChanged, interface, &InsertShorturlPluginEditorInterface::loadEngine);
0026     return interface;
0027 }
0028 
0029 bool InsertShorturlPluginEditor::hasPopupMenuSupport() const
0030 {
0031     return true;
0032 }
0033 
0034 bool InsertShorturlPluginEditor::hasConfigureDialog() const
0035 {
0036     return true;
0037 }
0038 
0039 void InsertShorturlPluginEditor::showConfigureDialog(QWidget *parent)
0040 {
0041     QPointer<InsertShorturlConfigureDialog> dlg = new InsertShorturlConfigureDialog(parent);
0042     if (dlg->exec()) {
0043         Q_EMIT configChanged();
0044     }
0045     delete dlg;
0046 }
0047 
0048 #include "insertshorturlplugineditor.moc"
0049 
0050 #include "moc_insertshorturlplugineditor.cpp"