1
/***************************************************************************
2
* Copyright (C) 2003 by Mario Scalas *
3
* mario.scalas@libero.it *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU General Public License as published by *
7
* the Free Software Foundation; either version 2 of the License, or *
8
* (at your option) any later version. *
10
***************************************************************************/
12
#include "partexplorer_plugin.h"
14
#include <kinstance.h>
16
#include <kdevgenericfactory.h>
19
#include <kmainwindow.h>
21
#include <kdevplugininfo.h>
22
#include <kdevmainwindow.h>
24
#include "partexplorerform.h"
26
static const KDevPluginInfo data("kdevpartexplorer");
28
typedef KDevGenericFactory<PartExplorerPlugin> PartExplorerPluginFactory;
29
K_EXPORT_COMPONENT_FACTORY( libkdevpartexplorer, PartExplorerPluginFactory( data ) )
31
PartExplorerPlugin::PartExplorerPlugin( QObject *parent, const char *name, const QStringList & )
32
: KDevPlugin( &data, parent, name ? name : "PartExplorerPlugin" )
34
// we need an instance
35
setInstance( PartExplorerPluginFactory::instance() );
37
setXMLFile( "kdevpartexplorer.rc" );
39
// this should be your custom internal widget
40
m_widget = new PartExplorerForm( mainWindow()->main() );
41
// mainWindow()->embedSelectView( m_widget, i18n("PartExplorer"), i18n("Query system services"));
43
KAction *action = new KAction( i18n("&Part Explorer"), 0, this, SLOT(slotShowForm()),
44
actionCollection(), "show_partexplorerform" );
45
action->setToolTip(i18n("KTrader query execution"));
46
action->setWhatsThis(i18n("<b>Part explorer</b><p>Shows a dialog for KTrader query execution. Search your KDE documentation for more information about KDE services and KTrader."));
49
PartExplorerPlugin::~PartExplorerPlugin()
54
mainWindow()->removeView( m_widget );
60
void PartExplorerPlugin::slotShowForm()
65
#include "partexplorer_plugin.moc"