File indexing completed on 2025-01-19 03:52:46
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2018-07-30 0007 * Description : plugin to email items. 0008 * 0009 * SPDX-FileCopyrightText: 2018-2024 by Gilles Caulier <caulier dot gilles at gmail dot com> 0010 * 0011 * SPDX-License-Identifier: GPL-2.0-or-later 0012 * 0013 * ============================================================ */ 0014 0015 #include "sendbymailplugin.h" 0016 0017 // Qt includes 0018 0019 #include <QPointer> 0020 0021 // KDE includes 0022 0023 #include <klocalizedstring.h> 0024 0025 // Local includes 0026 0027 #include "mailwizard.h" 0028 0029 namespace DigikamGenericSendByMailPlugin 0030 { 0031 0032 SendByMailPlugin::SendByMailPlugin(QObject* const parent) 0033 : DPluginGeneric(parent) 0034 { 0035 } 0036 0037 SendByMailPlugin::~SendByMailPlugin() 0038 { 0039 } 0040 0041 QString SendByMailPlugin::name() const 0042 { 0043 return i18n("Send by Email"); 0044 } 0045 0046 QString SendByMailPlugin::iid() const 0047 { 0048 return QLatin1String(DPLUGIN_IID); 0049 } 0050 0051 QIcon SendByMailPlugin::icon() const 0052 { 0053 return QIcon::fromTheme(QLatin1String("mail-send")); 0054 } 0055 0056 QString SendByMailPlugin::description() const 0057 { 0058 return i18n("A tool to send images by E-mail"); 0059 } 0060 0061 QString SendByMailPlugin::details() const 0062 { 0063 return i18n("<p>This tool allows users to back-process items (as resize) before to send by e-mail.</p>" 0064 "<p>Items to process can be selected one by one or by group through a selection of albums.</p>" 0065 "<p>Different mail client application can be used to process files on the network.</p>"); 0066 } 0067 0068 QString SendByMailPlugin::handbookSection() const 0069 { 0070 return QLatin1String("post_processing"); 0071 } 0072 0073 QString SendByMailPlugin::handbookChapter() const 0074 { 0075 return QLatin1String("send_images"); 0076 } 0077 0078 QList<DPluginAuthor> SendByMailPlugin::authors() const 0079 { 0080 return QList<DPluginAuthor>() 0081 << DPluginAuthor(QString::fromUtf8("Michael Hoechstetter"), 0082 QString::fromUtf8("michael dot hoechstetter at gmx dot de"), 0083 QString::fromUtf8("(C) 2006")) 0084 << DPluginAuthor(QString::fromUtf8("Tom Albers"), 0085 QString::fromUtf8("tomalbers at kde dot nl"), 0086 QString::fromUtf8("(C) 2007")) 0087 << DPluginAuthor(QString::fromUtf8("Gilles Caulier"), 0088 QString::fromUtf8("caulier dot gilles at gmail dot com"), 0089 QString::fromUtf8("(C) 2004-2020"), 0090 i18n("Author and Maintainer")) 0091 ; 0092 } 0093 0094 void SendByMailPlugin::setup(QObject* const parent) 0095 { 0096 DPluginAction* const ac = new DPluginAction(parent); 0097 ac->setIcon(icon()); 0098 ac->setText(i18nc("@action", "Send by Mail...")); 0099 ac->setObjectName(QLatin1String("sendbymail")); 0100 ac->setActionCategory(DPluginAction::GenericTool); 0101 0102 connect(ac, SIGNAL(triggered(bool)), 0103 this, SLOT(slotSendByMail())); 0104 0105 addAction(ac); 0106 } 0107 0108 void SendByMailPlugin::slotSendByMail() 0109 { 0110 QPointer<MailWizard> wzrd = new MailWizard(nullptr, infoIface(sender())); 0111 wzrd->setPlugin(this); 0112 wzrd->exec(); 0113 delete wzrd; 0114 } 0115 0116 } // namespace DigikamGenericSendByMailPlugin 0117 0118 #include "moc_sendbymailplugin.cpp"