closer_part.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include <qdialog.h>
00013 #include <qstringlist.h>
00014 #include <qstring.h>
00015
00016 #include <kiconloader.h>
00017 #include <klocale.h>
00018 #include <kdevgenericfactory.h>
00019 #include <kaction.h>
00020 #include <kdebug.h>
00021 #include <kdevpartcontroller.h>
00022 #include <kparts/part.h>
00023 #include <kdevproject.h>
00024 #include <kdevcore.h>
00025 #include <kdevmainwindow.h>
00026
00027 #include "closer_part.h"
00028 #include "closer_dialogimpl.h"
00029
00030 static const KAboutData data("kdevcloser", I18N_NOOP("Close Selected Windows..."), "1.0");
00031
00032 typedef KDevGenericFactory<CloserPart> CloserFactory;
00033 K_EXPORT_COMPONENT_FACTORY( libkdevcloser, CloserFactory( &data ) )
00034
00035 CloserPart::CloserPart(QObject *parent, const char *name, const QStringList& )
00036 : KDevPlugin("Selected Window Closer", "closer", parent, name ? name : "closerPart" )
00037 {
00038 setInstance(CloserFactory::instance());
00039 setXMLFile("kdevpart_closer.rc");
00040
00041 KAction * action = new KAction( i18n("Close Selected Windows..."), CTRL+ALT+Key_W, this,
00042 SLOT( openDialog() ), actionCollection(), "closer" );
00043 action->setToolTip( i18n("Select windows to close") );
00044 action->setWhatsThis(i18n("<b>Close selected windows</b><p>Provides a dialog to select files which will be closed."));
00045
00046 core()->insertNewAction( action );
00047 }
00048
00049
00050 CloserPart::~CloserPart()
00051 {}
00052
00053 void CloserPart::openDialog()
00054 {
00055 CloserDialogImpl d( partController()->openURLs() );
00056 if ( d.exec() == QDialog::Accepted )
00057 {
00058 partController()->closeFiles( d.getCheckedFiles() );
00059 }
00060 }
00061 #include "closer_part.moc"
This file is part of the documentation for KDevelop Version 3.1.2.