KDevelop API Documentation

partexplorer_plugin.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2003 by Mario Scalas                                    *
00003  *   mario.scalas@libero.it                                                *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  ***************************************************************************/
00011 
00012 #include "partexplorer_plugin.h"
00013 
00014 #include <kinstance.h>
00015 #include <klocale.h>
00016 #include <kdevgenericfactory.h>
00017 #include <kdebug.h>
00018 #include <kaction.h>
00019 #include <kmainwindow.h>
00020 
00021 #include <kdevmainwindow.h>
00022 
00023 #include "partexplorerform.h"
00024 
00025 static const KAboutData data("kdevpartexplorer", I18N_NOOP("Part Explorer"), "1.0");
00026 
00027 typedef KDevGenericFactory<PartExplorerPlugin> PartExplorerPluginFactory;
00028 K_EXPORT_COMPONENT_FACTORY( libkdevpartexplorer, PartExplorerPluginFactory( &data ) )
00029 
00030 PartExplorerPlugin::PartExplorerPlugin(  QObject *parent, const char *name, const QStringList & )
00031     : KDevPlugin( "PartExplorer", "partexplorer", parent, name ? name : "PartExplorerPlugin" )
00032 {
00033     // we need an instance
00034     setInstance( PartExplorerPluginFactory::instance() );
00035 
00036     setXMLFile( "kdevpartexplorer.rc" );
00037 
00038     // this should be your custom internal widget
00039     m_widget = new PartExplorerForm( mainWindow()->main() );
00040 //    mainWindow()->embedSelectView( m_widget, i18n("PartExplorer"), i18n("Query system services"));
00041 
00042     KAction *action = new KAction( i18n("&Part Explorer"), 0, this, SLOT(slotShowForm()),
00043         actionCollection(), "show_partexplorerform" );
00044     action->setToolTip(i18n("KTrader query execution"));
00045     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."));
00046 }
00047 
00048 PartExplorerPlugin::~PartExplorerPlugin()
00049 {
00050 /*
00051     if (m_widget)
00052     {
00053         mainWindow()->removeView( m_widget );
00054     }
00055 */  
00056     //delete m_widget;
00057 }
00058 
00059 void PartExplorerPlugin::slotShowForm()
00060 {
00061     m_widget->show();
00062 }
00063 
00064 #include "partexplorer_plugin.moc"
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Feb 22 09:22:41 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003