~ubuntu-branches/debian/sid/kdevelop/sid

« back to all changes in this revision

Viewing changes to parts/partexplorer/partexplorer_plugin.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2010-05-05 07:21:55 UTC
  • mfrom: (1.2.3 upstream) (5.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100505072155-h78lx19pu04sbhtn
Tags: 4:4.0.0-2
* Upload to unstable (Closes: #579947, #481832).
* Acknowledge obsolete NMU fixes (Closes: #562410, #546961).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
 *   Copyright (C) 2003 by Mario Scalas                                    *
3
 
 *   mario.scalas@libero.it                                                *
4
 
 *                                                                         *
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.                                   *
9
 
 *                                                                         *
10
 
 ***************************************************************************/
11
 
 
12
 
#include "partexplorer_plugin.h"
13
 
 
14
 
#include <kinstance.h>
15
 
#include <klocale.h>
16
 
#include <kdevgenericfactory.h>
17
 
#include <kdebug.h>
18
 
#include <kaction.h>
19
 
#include <kmainwindow.h>
20
 
 
21
 
#include <kdevplugininfo.h>
22
 
#include <kdevmainwindow.h>
23
 
 
24
 
#include "partexplorerform.h"
25
 
 
26
 
static const KDevPluginInfo data("kdevpartexplorer");
27
 
 
28
 
typedef KDevGenericFactory<PartExplorerPlugin> PartExplorerPluginFactory;
29
 
K_EXPORT_COMPONENT_FACTORY( libkdevpartexplorer, PartExplorerPluginFactory( data ) )
30
 
 
31
 
PartExplorerPlugin::PartExplorerPlugin(  QObject *parent, const char *name, const QStringList & )
32
 
    : KDevPlugin( &data, parent, name ? name : "PartExplorerPlugin" )
33
 
{
34
 
    // we need an instance
35
 
    setInstance( PartExplorerPluginFactory::instance() );
36
 
 
37
 
    setXMLFile( "kdevpartexplorer.rc" );
38
 
 
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"));
42
 
 
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."));
47
 
}
48
 
 
49
 
PartExplorerPlugin::~PartExplorerPlugin()
50
 
{
51
 
/*
52
 
    if (m_widget)
53
 
    {
54
 
        mainWindow()->removeView( m_widget );
55
 
    }
56
 
*/      
57
 
    //delete m_widget;
58
 
}
59
 
 
60
 
void PartExplorerPlugin::slotShowForm()
61
 
{
62
 
    m_widget->show();
63
 
}
64
 
 
65
 
#include "partexplorer_plugin.moc"