1
/* ============================================================
3
* This file is a part of kipi-plugins project
4
* http://www.digikam.org
7
* Description : A KIPI plugin to export with DLNA Technology
9
* Copyright (C) 2012 by Smit Mehta <smit dot meh at gmail dot com>
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.
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.
21
* ============================================================ */
23
#include "plugin_dlnaexport.moc"
33
#include <klibloader.h>
35
#include <klocalizedstring.h>
36
#include <kshortcut.h>
37
#include <kactioncollection.h>
38
#include <kstandarddirs.h>
39
#include <kwindowsystem.h>
40
#include <kapplication.h>
44
#include <libkipi/interface.h>
50
namespace KIPIDLNAExportPlugin
53
K_PLUGIN_FACTORY(DLNAExportFactory, registerPlugin<Plugin_DLNAExport>();)
54
K_EXPORT_PLUGIN(DLNAExportFactory("kipiplugin_dlnaexport") )
56
class Plugin_DLNAExport::Private
66
KAction* actionExport;
70
Plugin_DLNAExport::Plugin_DLNAExport(QObject* const parent, const QVariantList&)
71
: Plugin(DLNAExportFactory::componentData(), parent, "DLNAExport"),
74
kDebug(AREA_CODE_LOADING) << "Plugin_DLNAExport plugin loaded";
76
setUiBaseName("kipiplugin_dlnaexportui.rc");
80
Plugin_DLNAExport::~Plugin_DLNAExport()
85
void Plugin_DLNAExport::setup(QWidget* const widget)
87
Plugin::setup(widget);
91
kError() << "KIPI interface is null!";
95
KIconLoader::global()->addAppDir("kipiplugin_dlnaexport");
99
void Plugin_DLNAExport::setupActions()
101
setDefaultCategory(ExportPlugin);
103
d->actionExport = new KAction(this);
104
d->actionExport->setText(i18n("Export via &DLNA"));
105
d->actionExport->setIcon(KIcon("dlna"));
107
connect(d->actionExport, SIGNAL(triggered(bool)),
108
this, SLOT(slotExport()));
110
addAction("dlnaexport", d->actionExport);
113
void Plugin_DLNAExport::slotExport()
117
// We clean it up in the close button
118
d->dlgExport = new Wizard(kapp->activeWindow());
122
if (d->dlgExport->isMinimized())
124
KWindowSystem::unminimizeWindow(d->dlgExport->winId());
127
KWindowSystem::activateWindow(d->dlgExport->winId());
130
d->dlgExport->show();
133
} // namespace KIPIDLNAExportPlugin