~bzoltan/kubuntu-packaging/decouple_cmake_plugin

« back to all changes in this revision

Viewing changes to src/plugins/projectexplorer/compileoutputwindow.cpp

  • Committer: Timo Jyrinki
  • Date: 2013-11-15 12:25:23 UTC
  • mfrom: (1.1.28)
  • Revision ID: timo.jyrinki@canonical.com-20131115122523-i2kyamsu4gs2mu1m
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
#include <extensionsystem/pluginmanager.h>
41
41
#include <texteditor/texteditorsettings.h>
42
42
#include <texteditor/fontsettings.h>
 
43
#include <utils/ansiescapecodehandler.h>
43
44
 
44
45
#include <QIcon>
45
46
#include <QTextCharFormat>
81
82
private slots:
82
83
    void fontSettingsChanged()
83
84
    {
84
 
        setFont(TextEditor::TextEditorSettings::instance()->fontSettings().font());
 
85
        setFont(TextEditor::TextEditorSettings::fontSettings().font());
85
86
    }
86
87
 
87
88
protected:
89
90
    {
90
91
        int line = cursorForPosition(ev->pos()).block().blockNumber();
91
92
        if (unsigned taskid = m_taskids.value(line, 0)) {
92
 
            TaskHub *hub = ExtensionSystem::PluginManager::getObject<TaskHub>();
93
 
            hub->showTaskInEditor(taskid);
 
93
            TaskHub::showTaskInEditor(taskid);
94
94
        } else {
95
95
            QPlainTextEdit::mouseDoubleClickEvent(ev);
96
96
        }
104
104
} // namespace ProjectExplorer
105
105
 
106
106
CompileOutputWindow::CompileOutputWindow(BuildManager * /*bm*/, QAction *cancelBuildAction) :
107
 
    m_cancelBuildButton(new QToolButton)
 
107
    m_cancelBuildButton(new QToolButton),
 
108
    m_escapeCodeHandler(new Utils::AnsiEscapeCodeHandler)
108
109
{
109
110
    Core::Context context(Constants::C_COMPILE_OUTPUT);
110
111
    m_outputWindow = new CompileOutputTextEdit(context);
143
144
    ExtensionSystem::PluginManager::removeObject(m_handler);
144
145
    delete m_handler;
145
146
    delete m_cancelBuildButton;
 
147
    delete m_escapeCodeHandler;
146
148
}
147
149
 
148
150
void CompileOutputWindow::updateWordWrapMode()
149
151
{
150
 
    m_outputWindow->setWordWrapEnabled(ProjectExplorerPlugin::instance()->projectExplorerSettings().wrapAppOutput);
 
152
    m_outputWindow->setWordWrapEnabled(ProjectExplorerPlugin::projectExplorerSettings().wrapAppOutput);
151
153
}
152
154
 
153
155
bool CompileOutputWindow::hasFocus() const
204
206
 
205
207
    }
206
208
 
207
 
    m_outputWindow->appendText(text, textFormat);
 
209
    foreach (const Utils::StringFormatPair &pair, m_escapeCodeHandler->parseText(text, textFormat))
 
210
        m_outputWindow->appendText(pair.first, pair.second);
208
211
}
209
212
 
210
213
void CompileOutputWindow::clearContents()
272
275
    m_outputWindow->setTextCursor(newCursor);
273
276
}
274
277
 
 
278
void CompileOutputWindow::flush()
 
279
{
 
280
    if (m_escapeCodeHandler)
 
281
        m_escapeCodeHandler->endFormatScope();
 
282
}
 
283
 
275
284
#include "compileoutputwindow.moc"