From 114a878c64ce6f8223cfd22d76a20eb16d177e5e Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- parts/partexplorer/partexplorer_plugin.cpp | 65 ++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 parts/partexplorer/partexplorer_plugin.cpp (limited to 'parts/partexplorer/partexplorer_plugin.cpp') diff --git a/parts/partexplorer/partexplorer_plugin.cpp b/parts/partexplorer/partexplorer_plugin.cpp new file mode 100644 index 00000000..92aaf696 --- /dev/null +++ b/parts/partexplorer/partexplorer_plugin.cpp @@ -0,0 +1,65 @@ +/*************************************************************************** + * Copyright (C) 2003 by Mario Scalas * + * mario.scalas@libero.it * + * * + * 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. * + * * + ***************************************************************************/ + +#include "partexplorer_plugin.h" + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "partexplorerform.h" + +static const KDevPluginInfo data("kdevpartexplorer"); + +typedef KDevGenericFactory PartExplorerPluginFactory; +K_EXPORT_COMPONENT_FACTORY( libkdevpartexplorer, PartExplorerPluginFactory( data ) ) + +PartExplorerPlugin::PartExplorerPlugin( QObject *parent, const char *name, const QStringList & ) + : KDevPlugin( &data, parent, name ? name : "PartExplorerPlugin" ) +{ + // we need an instance + setInstance( PartExplorerPluginFactory::instance() ); + + setXMLFile( "kdevpartexplorer.rc" ); + + // this should be your custom internal widget + m_widget = new PartExplorerForm( mainWindow()->main() ); +// mainWindow()->embedSelectView( m_widget, i18n("PartExplorer"), i18n("Query system services")); + + KAction *action = new KAction( i18n("&Part Explorer"), 0, this, SLOT(slotShowForm()), + actionCollection(), "show_partexplorerform" ); + action->setToolTip(i18n("KTrader query execution")); + action->setWhatsThis(i18n("Part explorer

Shows a dialog for KTrader query execution. Search your KDE documentation for more information about KDE services and KTrader.")); +} + +PartExplorerPlugin::~PartExplorerPlugin() +{ +/* + if (m_widget) + { + mainWindow()->removeView( m_widget ); + } +*/ + //delete m_widget; +} + +void PartExplorerPlugin::slotShowForm() +{ + m_widget->show(); +} + +#include "partexplorer_plugin.moc" -- cgit v1.2.1