mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-20 00:41:23 +00:00
load nsplugins on user demand. The gui is ugly and I don't really care since
I don't even plan to use this feature personally. If someone wants to, clean it up. Off by default, configuration option to come shortly. FEATURE: 36020 svn path=/trunk/kdebase/nsplugins/; revision=393042
This commit is contained in:
parent
62743fc82f
commit
21fa1f3771
|
@ -5,6 +5,7 @@
|
|||
|
||||
Copyright (c) 2000 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
|
||||
Stefan Schimanski <1Stein@gmx.de>
|
||||
Copyright (c) 2002-2005 George Staikos <staikos@kde.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -30,11 +31,14 @@
|
|||
#include <kprocess.h>
|
||||
#include <kdebug.h>
|
||||
#include <kglobal.h>
|
||||
#include <klocale.h>
|
||||
#include <kstandarddirs.h>
|
||||
#include <kconfig.h>
|
||||
#include <dcopclient.h>
|
||||
#include <dcopstub.h>
|
||||
#include <qlayout.h>
|
||||
#include <qobject.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qxembed.h>
|
||||
#include <qtextstream.h>
|
||||
#include <qregexp.h>
|
||||
|
@ -53,7 +57,27 @@ int NSPluginLoader::s_refCount = 0;
|
|||
NSPluginInstance::NSPluginInstance(QWidget *parent, const QCString& app, const QCString& id)
|
||||
: DCOPStub(app, id), NSPluginInstanceIface_stub(app, id), EMBEDCLASS(parent)
|
||||
{
|
||||
_loader = 0L;
|
||||
shown = false;
|
||||
QGridLayout *_layout = new QGridLayout(this, 1, 1);
|
||||
KConfig cfg("kcmnspluginrc", false);
|
||||
cfg.setGroup("Misc");
|
||||
if (cfg.readBoolEntry("demandLoad", false)) {
|
||||
_button = new QPushButton(i18n("Start Plugin"), dynamic_cast<EMBEDCLASS*>(this));
|
||||
_layout->addWidget(_button, 0, 0);
|
||||
connect(_button, SIGNAL(clicked()), this, SLOT(doLoadPlugin()));
|
||||
show();
|
||||
} else {
|
||||
_button = 0L;
|
||||
doLoadPlugin();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void NSPluginInstance::doLoadPlugin() {
|
||||
if (!_loader) {
|
||||
delete _button;
|
||||
_button = 0L;
|
||||
_loader = NSPluginLoader::instance();
|
||||
setBackgroundMode(QWidget::NoBackground);
|
||||
setProtocol(QXEmbed::XPLAIN);
|
||||
|
@ -61,6 +85,7 @@ NSPluginInstance::NSPluginInstance(QWidget *parent, const QCString& app, const Q
|
|||
displayPlugin();
|
||||
show();
|
||||
shown = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -443,3 +468,4 @@ NSPluginInstance *NSPluginLoader::newInstance(QWidget *parent, QString url,
|
|||
return plugin;
|
||||
}
|
||||
|
||||
// vim: ts=4 sw=4 et
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
Copyright (c) 2000 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
|
||||
Stefan Schimanski <1Stein@gmx.de>
|
||||
Copyright (c) 2002-2005 George Staikos <staikos@kde.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -39,6 +40,8 @@
|
|||
#define EMBEDCLASS QXEmbed
|
||||
|
||||
class KProcess;
|
||||
class QPushButton;
|
||||
class QGridLayout;
|
||||
|
||||
class NSPluginInstance : public EMBEDCLASS, virtual public NSPluginInstanceIface_stub
|
||||
{
|
||||
|
@ -48,11 +51,16 @@ public:
|
|||
NSPluginInstance(QWidget *parent, const QCString& app, const QCString& id);
|
||||
~NSPluginInstance();
|
||||
|
||||
private slots:
|
||||
void doLoadPlugin();
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *event);
|
||||
void windowChanged(WId w);
|
||||
class NSPluginLoader *_loader;
|
||||
bool shown;
|
||||
QPushButton *_button;
|
||||
QGridLayout *_layout;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -1,3 +1,25 @@
|
|||
/*
|
||||
Netscape Plugin Loader KPart
|
||||
|
||||
Copyright (c) 2000 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
|
||||
Stefan Schimanski <1Stein@gmx.de>
|
||||
Copyright (c) 2002-2005 George Staikos <staikos@kde.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include <dcopclient.h>
|
||||
#include <kaboutdata.h>
|
||||
#include <kaction.h>
|
||||
|
@ -205,7 +227,8 @@ PluginPart::PluginPart(QWidget *parentWidget, const char *widgetName, QObject *p
|
|||
|
||||
// create a canvas to insert our widget
|
||||
_canvas = new PluginCanvasWidget( parentWidget, widgetName );
|
||||
_canvas->setFocusPolicy( QWidget::ClickFocus );
|
||||
//_canvas->setFocusPolicy( QWidget::ClickFocus );
|
||||
_canvas->setFocusPolicy( QWidget::WheelFocus );
|
||||
_canvas->setBackgroundMode( QWidget::NoBackground );
|
||||
setWidget(_canvas);
|
||||
_canvas->show();
|
||||
|
@ -221,7 +244,7 @@ PluginPart::~PluginPart()
|
|||
delete _callback;
|
||||
_loader->release();
|
||||
if (_destructed)
|
||||
*_destructed = true;;
|
||||
*_destructed = true;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,3 +1,26 @@
|
|||
/*
|
||||
Netscape Plugin Loader KPart
|
||||
|
||||
Copyright (c) 2000 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
|
||||
Stefan Schimanski <1Stein@gmx.de>
|
||||
Copyright (c) 2002-2005 George Staikos <staikos@kde.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __plugin_part_h__
|
||||
#define __plugin_part_h__
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
Copyright (c) 2000 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
|
||||
Stefan Schimanski <1Stein@gmx.de>
|
||||
2003 George Staikos <staikos@kde.org>
|
||||
2003-2005 George Staikos <staikos@kde.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
Copyright (c) 2000 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
|
||||
Stefan Schimanski <1Stein@gmx.de>
|
||||
Copyright (c) 2003-2005 George Staikos <staikos@kde.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
|
Loading…
Reference in a new issue