makeviewpart.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "makeviewpart.h"
00013
00014 #include <qwhatsthis.h>
00015 #include <qdir.h>
00016 #include <kdebug.h>
00017 #include <klocale.h>
00018 #include <kaction.h>
00019 #include <kiconloader.h>
00020
00021 #include "kdevproject.h"
00022 #include "kdevcore.h"
00023 #include "kdevmainwindow.h"
00024
00025 #include "outputviewsfactory.h"
00026 #include "makewidget.h"
00027
00028
00029 MakeViewPart::MakeViewPart(QObject *parent, const char *name, const QStringList &)
00030 : KDevMakeFrontend("MakeOutput", "makeoutput", parent, name)
00031 {
00032 setInstance(OutputViewsFactory::instance());
00033
00034 setXMLFile("kdevmakeview.rc");
00035
00036 m_dcop = new KDevMakeFrontendIface(this);
00037
00038 m_widget = new MakeWidget(this);
00039 m_widget->setIcon( SmallIcon("exec") );
00040 m_widget->setCaption(i18n("Messages Output"));
00041 QWhatsThis::add(m_widget, i18n("<b>Messages output</b><p>"
00042 "The messages window shows the output of the compiler and "
00043 "used build tools like make, ant, uic, dcopidl etc. "
00044 "For compiler error messages, click on the error message. "
00045 "This will automatically open the source file and set the "
00046 "cursor to the line that caused the compiler error/warning."));
00047
00048 mainWindow()->embedOutputView(m_widget, i18n("Messages"), i18n("Compiler output messages"));
00049
00050 KAction *action;
00051 action = new KAction( i18n("&Next Error"), Key_F4, m_widget, SLOT(nextError()),
00052 actionCollection(), "view_next_error");
00053 action->setToolTip( i18n("Go to the next error") );
00054 action->setWhatsThis(i18n("<b>Next error</b><p>Switches to the file and line where the next error was reported from."));
00055 action = new KAction( i18n("&Previous Error"), SHIFT+Key_F4, m_widget, SLOT(prevError()),
00056 actionCollection(), "view_previous_error");
00057 action->setToolTip( i18n("Go to the previous error") );
00058 action->setWhatsThis(i18n("<b>Previous error</b><p>Switches to the file and line where the previous error was reported from."));
00059
00060 connect( core(), SIGNAL(stopButtonClicked(KDevPlugin*)),
00061 this, SLOT(slotStopButtonClicked(KDevPlugin*)) );
00062 }
00063
00064
00065 MakeViewPart::~MakeViewPart()
00066 {
00067 if ( m_widget )
00068 mainWindow()->removeView( m_widget );
00069 delete m_widget;
00070 delete m_dcop;
00071 }
00072
00073 void MakeViewPart::slotStopButtonClicked(KDevPlugin* which)
00074 {
00075 if ( which != 0 && which != this )
00076 return;
00077 m_widget->killJob();
00078 }
00079
00080 void MakeViewPart::queueCommand(const QString &dir, const QString &command)
00081 {
00082 m_widget->queueJob(dir, command);
00083 }
00084
00085
00086 bool MakeViewPart::isRunning()
00087 {
00088 return m_widget->isRunning();
00089 }
00090
00091 QWidget* MakeViewPart::widget()
00092 {
00093 return m_widget.operator->();
00094 }
00095
00096 void MakeViewPart::updateSettingsFromConfig()
00097 {
00098 m_widget->updateSettingsFromConfig();
00099 }
00100
00101 #include "makeviewpart.moc"
This file is part of the documentation for KDevelop Version 3.1.2.