"Fossies" - the Fresh Open Source Software Archive

Member "digikam-6.3.0/core/dplugins/generic/webservices/debianscreenshots/dsplugin.cpp" (4 Sep 2019, 2913 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 "dsplugin.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 tool to export images to Debian Screenshots site
    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 "dsplugin.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 "dswindow.h"
   36 
   37 namespace DigikamGenericDebianScreenshotsPlugin
   38 {
   39 
   40 DSPlugin::DSPlugin(QObject* const parent)
   41     : DPluginGeneric(parent)
   42 {
   43 }
   44 
   45 DSPlugin::~DSPlugin()
   46 {
   47 }
   48 
   49 void DSPlugin::cleanUp()
   50 {
   51     delete m_toolDlg;
   52 }
   53 
   54 QString DSPlugin::name() const
   55 {
   56     return i18n("DebianScreenshots");
   57 }
   58 
   59 QString DSPlugin::iid() const
   60 {
   61     return QLatin1String(DPLUGIN_IID);
   62 }
   63 
   64 QIcon DSPlugin::icon() const
   65 {
   66     return QIcon::fromTheme(QLatin1String("dk-debianscreenshots"));
   67 }
   68 
   69 QString DSPlugin::description() const
   70 {
   71     return i18n("A tool to export to Debian Screenshots site");
   72 }
   73 
   74 QString DSPlugin::details() const
   75 {
   76     return i18n("<p>This tool permit to export items to Debian Screenshots site.</p>"
   77                 "<p>See Debian Screenshots web site for details: <a href='https://screenshots.debian.net/'>https://screenshots.debian.net/</a></p>");
   78 }
   79 
   80 QList<DPluginAuthor> DSPlugin::authors() const
   81 {
   82     return QList<DPluginAuthor>()
   83             << DPluginAuthor(QString::fromUtf8("Pau Garcia i Quiles"),
   84                              QString::fromUtf8("pgquiles at elpauer dot org"),
   85                              QString::fromUtf8("(C) 2010"))
   86             ;
   87 }
   88 
   89 void DSPlugin::setup(QObject* const parent)
   90 {
   91     DPluginAction* const ac = new DPluginAction(parent);
   92     ac->setIcon(icon());
   93     ac->setText(i18nc("@action", "Export to &Debian Screenshots..."));
   94     ac->setObjectName(QLatin1String("export_debianscreenshot"));
   95     ac->setActionCategory(DPluginAction::GenericExport);
   96 
   97     connect(ac, SIGNAL(triggered(bool)),
   98             this, SLOT(slotDebianScreenshots()));
   99 
  100     addAction(ac);
  101 }
  102 
  103 void DSPlugin::slotDebianScreenshots()
  104 {
  105     if (!reactivateToolDialog(m_toolDlg))
  106     {
  107         delete m_toolDlg;
  108         m_toolDlg = new DSWindow(infoIface(sender()), 0);
  109         m_toolDlg->setPlugin(this);
  110         m_toolDlg->show();
  111     }
  112 }
  113 
  114 } // namespace DigikamGenericDebianScreenshotsPlugin