"Fossies" - the Fresh Open Source Software Archive

Member "digikam-6.3.0/core/dplugins/generic/webservices/mediawiki/mediawikiplugin.cpp" (4 Sep 2019, 3598 Bytes) of package /linux/misc/digikam-6.3.0.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "mediawikiplugin.cpp" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 6.2.0_vs_6.3.0.

    1 /* ============================================================
    2  *
    3  * This file is a part of digiKam project
    4  * https://www.digikam.org
    5  *
    6  * Date        : 2018-07-30
    7  * Description : a plugin to export to MediaWiki web-service.
    8  *
    9  * Copyright (C) 2018-2019 by Gilles Caulier <caulier dot gilles at gmail dot com>
   10  *
   11  * This program is free software; you can redistribute it
   12  * and/or modify it under the terms of the GNU General
   13  * Public License as published by the Free Software Foundation;
   14  * either version 2, or (at your option) any later version.
   15  *
   16  * This program is distributed in the hope that it will be useful,
   17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   19  * GNU General Public License for more details.
   20  *
   21  * ============================================================ */
   22 
   23 #include "mediawikiplugin.h"
   24 
   25 // Qt includes
   26 
   27 #include <QPointer>
   28 
   29 // KDE includes
   30 
   31 #include <klocalizedstring.h>
   32 
   33 // Local includes
   34 
   35 #include "mediawikiwindow.h"
   36 
   37 namespace DigikamGenericMediaWikiPlugin
   38 {
   39 
   40 MediaWikiPlugin::MediaWikiPlugin(QObject* const parent)
   41     : DPluginGeneric(parent)
   42 {
   43 }
   44 
   45 MediaWikiPlugin::~MediaWikiPlugin()
   46 {
   47 }
   48 
   49 void MediaWikiPlugin::cleanUp()
   50 {
   51     delete m_toolDlg;
   52 }
   53 
   54 QString MediaWikiPlugin::name() const
   55 {
   56     return i18n("MediaWiki");
   57 }
   58 
   59 QString MediaWikiPlugin::iid() const
   60 {
   61     return QLatin1String(DPLUGIN_IID);
   62 }
   63 
   64 QIcon MediaWikiPlugin::icon() const
   65 {
   66     return QIcon::fromTheme(QLatin1String("dk-mediawiki"));
   67 }
   68 
   69 QString MediaWikiPlugin::description() const
   70 {
   71     return i18n("A tool to export to MediaWiki web-service");
   72 }
   73 
   74 QString MediaWikiPlugin::details() const
   75 {
   76     return i18n("<p>This tool permit to export items to MediaWiki web-service.</p>"
   77                 "<p>See MediaWiki web site for details: <a href='https://www.mediawiki.org/'>https://www.mediawiki.org/</a></p>");
   78 }
   79 
   80 QList<DPluginAuthor> MediaWikiPlugin::authors() const
   81 {
   82     return QList<DPluginAuthor>()
   83             << DPluginAuthor(QString::fromUtf8("Alexandre Mendes"),
   84                              QString::fromUtf8("alex dot mendes1988 at gmail dot com"),
   85                              QString::fromUtf8("(C) 2011"))
   86             << DPluginAuthor(QString::fromUtf8("Guillaume Hormiere"),
   87                              QString::fromUtf8("hormiere dot guillaume at gmail dot com"),
   88                              QString::fromUtf8("(C) 2011-2012"))
   89             << DPluginAuthor(QString::fromUtf8("Peter Potrowl"),
   90                              QString::fromUtf8("peter dot potrowl at gmail dot com"),
   91                              QString::fromUtf8("(C) 2013"))
   92             << DPluginAuthor(QString::fromUtf8("Gilles Caulier"),
   93                              QString::fromUtf8("caulier dot gilles at gmail dot com"),
   94                              QString::fromUtf8("(C) 2011-2019"))
   95             ;
   96 }
   97 
   98 void MediaWikiPlugin::setup(QObject* const parent)
   99 {
  100     DPluginAction* const ac = new DPluginAction(parent);
  101     ac->setIcon(icon());
  102     ac->setText(i18nc("@action", "Export to MediaWiki..."));
  103     ac->setObjectName(QLatin1String("export_MediaWiki"));
  104     ac->setActionCategory(DPluginAction::GenericExport);
  105 
  106     connect(ac, SIGNAL(triggered(bool)),
  107             this, SLOT(slotMediaWiki()));
  108 
  109     addAction(ac);
  110 }
  111 
  112 void MediaWikiPlugin::slotMediaWiki()
  113 {
  114     if (!reactivateToolDialog(m_toolDlg))
  115     {
  116         delete m_toolDlg;
  117         m_toolDlg = new MediaWikiWindow(infoIface(sender()), nullptr);
  118         m_toolDlg->setPlugin(this);
  119         m_toolDlg->show();
  120     }
  121 }
  122 
  123 } // namespace DigikamGenericMediaWikiPlugin