"Fossies" - the Fresh Open Source Software Archive

Member "digikam-6.3.0/core/dplugins/generic/webservices/yandexfotki/yfplugin.cpp" (4 Sep 2019, 3107 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 "yfplugin.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 YandexFotki 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 "yfplugin.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 "yfwindow.h"
   36 
   37 namespace DigikamGenericYFPlugin
   38 {
   39 
   40 YFPlugin::YFPlugin(QObject* const parent)
   41     : DPluginGeneric(parent)
   42 {
   43 }
   44 
   45 YFPlugin::~YFPlugin()
   46 {
   47 }
   48 
   49 void YFPlugin::cleanUp()
   50 {
   51     delete m_toolDlg;
   52 }
   53 
   54 QString YFPlugin::name() const
   55 {
   56     return i18n("YandexFotki");
   57 }
   58 
   59 QString YFPlugin::iid() const
   60 {
   61     return QLatin1String(DPLUGIN_IID);
   62 }
   63 
   64 QIcon YFPlugin::icon() const
   65 {
   66     return QIcon::fromTheme(QLatin1String("internet-web-browser"));
   67 }
   68 
   69 QString YFPlugin::description() const
   70 {
   71     return i18n("A tool to export to YandexFotki web-service");
   72 }
   73 
   74 QString YFPlugin::details() const
   75 {
   76     return i18n("<p>This tool permit to export items to YandexFotki web-service.</p>"
   77                 "<p>See YandexFotki web site for details: <a href='https://fotki.yandex.ru/'>https://fotki.yandex.ru/</a></p>");
   78 }
   79 
   80 QList<DPluginAuthor> YFPlugin::authors() const
   81 {
   82     return QList<DPluginAuthor>()
   83             << DPluginAuthor(QString::fromUtf8("Roman Tsisyk"),
   84                              QString::fromUtf8("roman at tsisyk dot com"),
   85                              QString::fromUtf8("(C) 2010"))
   86             << DPluginAuthor(QString::fromUtf8("Gilles Caulier"),
   87                              QString::fromUtf8("caulier dot gilles at gmail dot com"),
   88                              QString::fromUtf8("(C) 2010-2019"))
   89             ;
   90 }
   91 
   92 void YFPlugin::setup(QObject* const parent)
   93 {
   94     DPluginAction* const ac = new DPluginAction(parent);
   95     ac->setIcon(icon());
   96     ac->setText(i18nc("@action", "Export to &Yandex.Fotki..."));
   97     ac->setObjectName(QLatin1String("export_yandexfotki"));
   98     ac->setActionCategory(DPluginAction::GenericExport);
   99     ac->setShortcut(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_Y);
  100 
  101     connect(ac, SIGNAL(triggered(bool)),
  102             this, SLOT(slotYandexFotki()));
  103 
  104     addAction(ac);
  105 }
  106 
  107 void YFPlugin::slotYandexFotki()
  108 {
  109     if (!reactivateToolDialog(m_toolDlg))
  110     {
  111         delete m_toolDlg;
  112         m_toolDlg = new YFWindow(infoIface(sender()), nullptr);
  113         m_toolDlg->setPlugin(this);
  114         m_toolDlg->show();
  115     }
  116 }
  117 
  118 } // namespace DigikamGenericYFPlugin