summaryrefslogtreecommitdiffstats
path: root/parts/konsole/konsoleviewpart.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit114a878c64ce6f8223cfd22d76a20eb16d177e5e (patch)
treeacaf47eb0fa12142d3896416a69e74cbf5a72242 /parts/konsole/konsoleviewpart.cpp
downloadtdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.tar.gz
tdevelop-114a878c64ce6f8223cfd22d76a20eb16d177e5e.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'parts/konsole/konsoleviewpart.cpp')
-rw-r--r--parts/konsole/konsoleviewpart.cpp69
1 files changed, 69 insertions, 0 deletions
diff --git a/parts/konsole/konsoleviewpart.cpp b/parts/konsole/konsoleviewpart.cpp
new file mode 100644
index 00000000..8d7892a5
--- /dev/null
+++ b/parts/konsole/konsoleviewpart.cpp
@@ -0,0 +1,69 @@
+/***************************************************************************
+ * Copyright (C) 2003 by KDevelop Authors *
+ * kdevelop-devel@kde.org *
+ * *
+ * 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 "konsoleviewpart.h"
+
+#include <qwhatsthis.h>
+
+#include <kdevgenericfactory.h>
+#include <kiconloader.h>
+#include <klocale.h>
+
+#include "kdevcore.h"
+#include "kdevproject.h"
+#include "kdevmainwindow.h"
+#include "kdevplugininfo.h"
+#include "kdevshellwidget.h"
+
+
+typedef KDevGenericFactory<KonsoleViewPart> KonsoleViewFactory;
+static const KDevPluginInfo data("kdevkonsoleview");
+K_EXPORT_COMPONENT_FACTORY(libkdevkonsoleview, KonsoleViewFactory(data))
+
+KonsoleViewPart::KonsoleViewPart(QObject *parent, const char *name, const QStringList &)
+ : KDevPlugin(&data, parent, name ? name : "KonsoleViewPart")
+{
+ setInstance( KonsoleViewFactory::instance() );
+
+ m_widget = new KDevShellWidget( 0, "konsole widget" );
+
+ QWhatsThis::add(m_widget, i18n("<b>Konsole</b><p>"
+ "This window contains an embedded konsole window. It will try to follow you when "
+ "you navigate in the source directories")
+ );
+
+ m_widget->setIcon( SmallIcon("konsole") );
+ m_widget->setCaption(i18n("Konsole"));
+
+ m_widget->activate();
+ m_widget->setAutoReactivateOnClose( true );
+
+ mainWindow()->embedOutputView(m_widget, i18n("Konsole"), i18n("Embedded console window"));
+
+ connect(core(), SIGNAL(projectOpened()), this, SLOT(projectOpened()));
+}
+
+
+KonsoleViewPart::~KonsoleViewPart()
+{
+ if ( m_widget )
+ mainWindow()->removeView( m_widget );
+ delete m_widget;
+}
+
+void KonsoleViewPart::projectOpened()
+{
+ QString cd_projectdir = QString("cd ") + project()->projectDirectory() + "\n";
+ m_widget->sendInput( cd_projectdir );
+}
+
+
+#include "konsoleviewpart.moc"