File indexing completed on 2025-01-05 03:53:45
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2018-07-30 0007 * Description : a plugin to export items to web-services (unified version). 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 "unifiedplugin.h" 0016 0017 // Qt includes 0018 0019 #include <QPointer> 0020 0021 // KDE includes 0022 0023 #include <klocalizedstring.h> 0024 0025 namespace DigikamGenericUnifiedPlugin 0026 { 0027 0028 UnifiedPlugin::UnifiedPlugin(QObject* const parent) 0029 : DPluginGeneric(parent) 0030 { 0031 } 0032 0033 UnifiedPlugin::~UnifiedPlugin() 0034 { 0035 } 0036 0037 void UnifiedPlugin::cleanUp() 0038 { 0039 delete m_toolDlg; 0040 } 0041 0042 QString UnifiedPlugin::name() const 0043 { 0044 return i18nc("@title", "Unified"); 0045 } 0046 0047 QString UnifiedPlugin::iid() const 0048 { 0049 return QLatin1String(DPLUGIN_IID); 0050 } 0051 0052 QIcon UnifiedPlugin::icon() const 0053 { 0054 return QIcon::fromTheme(QLatin1String("internet-web-browser")); 0055 } 0056 0057 QString UnifiedPlugin::description() const 0058 { 0059 return i18nc("@info", "A tool to export items to web-services"); 0060 } 0061 0062 QString UnifiedPlugin::details() const 0063 { 0064 return i18nc("@info", "This tool allows users to export items to many web-services.\n\n" 0065 "This is a unified tool, grouping many tools in one."); 0066 } 0067 0068 QString UnifiedPlugin::handbookSection() const 0069 { 0070 return QLatin1String("export_tools"); 0071 } 0072 0073 QString UnifiedPlugin::handbookChapter() const 0074 { 0075 return QLatin1String("unified_tool"); 0076 } 0077 0078 QList<DPluginAuthor> UnifiedPlugin::authors() const 0079 { 0080 return QList<DPluginAuthor>() 0081 << DPluginAuthor(QString::fromUtf8("Thanh Trung Dinh"), 0082 QString::fromUtf8("dinhthanhtrung1996 at gmail dot com"), 0083 QString::fromUtf8("(C) 2018")) 0084 << DPluginAuthor(QString::fromUtf8("Maik Qualmann"), 0085 QString::fromUtf8("metzpinguin at gmail dot com"), 0086 QString::fromUtf8("(C) 2018-2021")) 0087 << DPluginAuthor(QString::fromUtf8("Gilles Caulier"), 0088 QString::fromUtf8("caulier dot gilles at gmail dot com"), 0089 QString::fromUtf8("(C) 2018-2021")) 0090 ; 0091 } 0092 0093 void UnifiedPlugin::setup(QObject* const parent) 0094 { 0095 DPluginAction* const ac = new DPluginAction(parent); 0096 ac->setIcon(icon()); 0097 ac->setText(i18nc("@action", "Export to Webservices...")); 0098 ac->setObjectName(QLatin1String("export_unified")); 0099 ac->setActionCategory(DPluginAction::GenericExport); 0100 0101 connect(ac, SIGNAL(triggered(bool)), 0102 this, SLOT(slotUnified())); 0103 0104 addAction(ac); 0105 } 0106 0107 void UnifiedPlugin::slotUnified() 0108 { 0109 if (!reactivateToolDialog(m_toolDlg)) 0110 { 0111 delete m_toolDlg; 0112 m_toolDlg = new WSWizard(infoIface(sender()), 0); 0113 m_toolDlg->setPlugin(this); 0114 m_toolDlg->show(); 0115 } 0116 } 0117 0118 } // namespace DigikamGenericUnifiedPlugin 0119 0120 #include "moc_unifiedplugin.cpp"