From 114a878c64ce6f8223cfd22d76a20eb16d177e5e Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: 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 --- parts/outputviews/makeviewpart.cpp | 105 +++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 parts/outputviews/makeviewpart.cpp (limited to 'parts/outputviews/makeviewpart.cpp') diff --git a/parts/outputviews/makeviewpart.cpp b/parts/outputviews/makeviewpart.cpp new file mode 100644 index 00000000..3f2ebbd8 --- /dev/null +++ b/parts/outputviews/makeviewpart.cpp @@ -0,0 +1,105 @@ +/*************************************************************************** + * Copyright (C) 1999-2001 by Bernd Gehrmann * + * bernd@kdevelop.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 "makeviewpart.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "kdevproject.h" +#include "kdevcore.h" +#include "kdevmainwindow.h" + +#include "makewidget.h" + +static const KDevPluginInfo data("kdevmakeview"); +typedef KDevGenericFactory< MakeViewPart > MakeViewFactory; +K_EXPORT_COMPONENT_FACTORY( libkdevmakeview, MakeViewFactory( data ) ) + +MakeViewPart::MakeViewPart(QObject *parent, const char *name, const QStringList &) + : KDevMakeFrontend(&data, parent, name) +{ + setInstance(MakeViewFactory::instance()); + + setXMLFile("kdevmakeview.rc"); + + m_dcop = new KDevMakeFrontendIface(this); + + m_widget = new MakeWidget(this); + m_widget->setIcon( SmallIcon("exec") ); + m_widget->setCaption(i18n("Messages Output")); + QWhatsThis::add(m_widget, i18n("Messages output

" + "The messages window shows the output of the compiler and " + "used build tools like make, ant, uic, dcopidl etc. " + "For compiler error messages, click on the error message. " + "This will automatically open the source file and set the " + "cursor to the line that caused the compiler error/warning.")); + + mainWindow()->embedOutputView(m_widget, i18n("Messages"), i18n("Compiler output messages")); + + KAction *action; + action = new KAction( i18n("&Next Error"), Key_F4, m_widget, SLOT(nextError()), + actionCollection(), "view_next_error"); + action->setToolTip( i18n("Go to the next error") ); + action->setWhatsThis(i18n("Next error

Switches to the file and line where the next error was reported from.")); + action = new KAction( i18n("&Previous Error"), SHIFT+Key_F4, m_widget, SLOT(prevError()), + actionCollection(), "view_previous_error"); + action->setToolTip( i18n("Go to the previous error") ); + action->setWhatsThis(i18n("Previous error

Switches to the file and line where the previous error was reported from.")); + + connect( core(), SIGNAL(stopButtonClicked(KDevPlugin*)), + this, SLOT(slotStopButtonClicked(KDevPlugin*)) ); +} + + +MakeViewPart::~MakeViewPart() +{ + if ( m_widget ) + mainWindow()->removeView( m_widget ); + delete m_widget; + delete m_dcop; +} + +void MakeViewPart::slotStopButtonClicked(KDevPlugin* which) +{ + if ( which != 0 && which != this ) + return; + m_widget->killJob(); +} + +void MakeViewPart::queueCommand(const QString &dir, const QString &command) +{ + m_widget->queueJob(dir, command); +} + + +bool MakeViewPart::isRunning() +{ + return m_widget->isRunning(); +} + +QWidget* MakeViewPart::widget() +{ + return m_widget.operator->(); +} + +void MakeViewPart::updateSettingsFromConfig() +{ + m_widget->updateSettingsFromConfig(); +} + +#include "makeviewpart.moc" -- cgit v1.2.1