summaryrefslogtreecommitdiffstats
path: root/parts/partexplorer/partexplorer_plugin.cpp
blob: 9741c6aa7f0df10790f166d9fbe35d80df35e0ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/***************************************************************************
 *   Copyright (C) 2003 by Mario Scalas                                    *
 *   [email protected]                                                *
 *                                                                         *
 *   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 <kinstance.h>
#include <tdelocale.h>
#include <kdevgenericfactory.h>
#include <kdebug.h>
#include <tdeaction.h>
#include <tdemainwindow.h>

#include <kdevplugininfo.h>
#include <kdevmainwindow.h>

#include "partexplorerform.h"

static const KDevPluginInfo pluginData("kdevpartexplorer");

typedef KDevGenericFactory<PartExplorerPlugin> PartExplorerPluginFactory;
K_EXPORT_COMPONENT_FACTORY( libkdevpartexplorer, PartExplorerPluginFactory( pluginData ) )

PartExplorerPlugin::PartExplorerPlugin(  TQObject *parent, const char *name, const TQStringList & )
    : KDevPlugin( &pluginData, 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"));

    TDEAction *action = new TDEAction( i18n("&Part Explorer"), 0, this, TQ_SLOT(slotShowForm()),
        actionCollection(), "show_partexplorerform" );
    action->setToolTip(i18n("TDETrader query execution"));
    action->setWhatsThis(i18n("<b>Part explorer</b><p>Shows a dialog for TDETrader query execution. Search your TDE documentation for more information about TDE services and TDETrader."));
}

PartExplorerPlugin::~PartExplorerPlugin()
{
/*
    if (m_widget)
    {
        mainWindow()->removeView( m_widget );
    }
*/	
    //delete m_widget;
}

void PartExplorerPlugin::slotShowForm()
{
    m_widget->show();
}

#include "partexplorer_plugin.moc"