diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-24 01:49:02 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-02-24 01:49:02 +0000 |
commit | 5de3dd4762ca33a0f92e79ffa4fe2ff67069d531 (patch) | |
tree | bad482b7afa4cdf47422d60a5dd2c61c7e333b09 /src/languages/languagemanager.cpp | |
download | ktechlab-5de3dd4762ca33a0f92e79ffa4fe2ff67069d531.tar.gz ktechlab-5de3dd4762ca33a0f92e79ffa4fe2ff67069d531.zip |
Added KDE3 version of ktechlab
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ktechlab@1095338 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/languages/languagemanager.cpp')
-rw-r--r-- | src/languages/languagemanager.cpp | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/src/languages/languagemanager.cpp b/src/languages/languagemanager.cpp new file mode 100644 index 0000000..a6dddd8 --- /dev/null +++ b/src/languages/languagemanager.cpp @@ -0,0 +1,108 @@ +/*************************************************************************** + * Copyright (C) 2005 by David Saxton * + * david@bluehaze.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 "docmanager.h" +#include "languagemanager.h" +#include "logview.h" +#include "ktechlab.h" +#include "ktempfile.h" +#include "src/core/ktlconfig.h" +#include "outputmethoddlg.h" +#include "processchain.h" +#include "projectmanager.h" + +#include "microbe.h" +#include "gpasm.h" +#include "gpdasm.h" + +#include <kdockwidget.h> +#include <kiconloader.h> +#include <klocale.h> +#include <qwhatsthis.h> + +#include <assert.h> + + +LanguageManager * LanguageManager::m_pSelf = 0l; + + +LanguageManager * LanguageManager::self( KateMDI::ToolView * parent, KTechlab * ktl ) +{ + if (!m_pSelf) + { + assert(parent); + assert(ktl); + m_pSelf = new LanguageManager( parent, ktl ); + } + return m_pSelf; +} + + +LanguageManager::LanguageManager( KateMDI::ToolView * parent, KTechlab * ktl ) + : QObject((QObject*)ktl) +{ + p_ktechlab = ktl; + m_logView = new LogView( parent, "LanguageManager LogView"); + + QWhatsThis::add( m_logView, i18n("These messages show the output of language-related functionality such as compiling and assembling.<br><br>For error messages, clicking on the line will automatically open up the file at the position of the error.") ); + connect( m_logView, SIGNAL(paraClicked(const QString&, MessageInfo )), this, SLOT(slotParaClicked(const QString&, MessageInfo )) ); + reset(); +} + + +LanguageManager::~LanguageManager() +{ +} + + +void LanguageManager::reset() +{ + m_logView->clear(); +} + + +ProcessChain * LanguageManager::compile( ProcessOptions options ) +{ + if ( KTLConfig::raiseMessagesLog() ) + p_ktechlab->showToolView( p_ktechlab->toolView( toolViewIdentifier() ) ); + + return new ProcessChain( options, p_ktechlab ); +} + + +ProcessListChain * LanguageManager::compile( ProcessOptionsList pol ) +{ + if ( KTLConfig::raiseMessagesLog() ) + p_ktechlab->showToolView( p_ktechlab->toolView( toolViewIdentifier() ) ); + + return new ProcessListChain( pol, p_ktechlab ); +} + + +void LanguageManager::slotError( const QString &error, MessageInfo messageInfo ) +{ + m_logView->addOutput( error, LogView::ot_error, messageInfo ); +} +void LanguageManager::slotWarning( const QString &error, MessageInfo messageInfo ) +{ + m_logView->addOutput( error, LogView::ot_warning, messageInfo ); +} +void LanguageManager::slotMessage( const QString &error, MessageInfo messageInfo ) +{ + m_logView->addOutput( error, LogView::ot_message, messageInfo ); +} + +void LanguageManager::slotParaClicked( const QString& message, MessageInfo messageInfo ) +{ + Q_UNUSED(message); + DocManager::self()->gotoTextLine( messageInfo.fileURL(), messageInfo.fileLine() ); +} + +#include "languagemanager.moc" |