forked from qt-creator/qt-creator
Make output window implementation reusable.
Removes the dependencies to project explorer and text editor plugins and moves unrelated code to its own file.
This commit is contained in:
@@ -34,7 +34,11 @@
|
||||
#include "buildmanager.h"
|
||||
#include "showoutputtaskhandler.h"
|
||||
#include "task.h"
|
||||
#include "projectexplorerconstants.h"
|
||||
#include "projectexplorer.h"
|
||||
#include "projectexplorersettings.h"
|
||||
|
||||
#include <coreplugin/icontext.h>
|
||||
#include <find/basetextfind.h>
|
||||
#include <aggregation/aggregate.h>
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
@@ -58,7 +62,8 @@ const int MAX_LINECOUNT = 50000;
|
||||
|
||||
CompileOutputWindow::CompileOutputWindow(BuildManager * /*bm*/)
|
||||
{
|
||||
m_outputWindow = new OutputWindow();
|
||||
Core::Context context(Constants::C_COMPILE_OUTPUT);
|
||||
m_outputWindow = new OutputWindow(context);
|
||||
m_outputWindow->setWindowTitle(tr("Compile Output"));
|
||||
m_outputWindow->setWindowIcon(QIcon(QLatin1String(Qt4ProjectManager::Constants::ICON_WINDOW)));
|
||||
m_outputWindow->setReadOnly(true);
|
||||
@@ -72,6 +77,9 @@ CompileOutputWindow::CompileOutputWindow(BuildManager * /*bm*/)
|
||||
|
||||
m_handler = new ShowOutputTaskHandler(this);
|
||||
ExtensionSystem::PluginManager::instance()->addObject(m_handler);
|
||||
connect(ProjectExplorerPlugin::instance(), SIGNAL(settingsChanged()),
|
||||
this, SLOT(updateWordWrapMode()));
|
||||
updateWordWrapMode();
|
||||
}
|
||||
|
||||
CompileOutputWindow::~CompileOutputWindow()
|
||||
@@ -80,6 +88,11 @@ CompileOutputWindow::~CompileOutputWindow()
|
||||
delete m_handler;
|
||||
}
|
||||
|
||||
void CompileOutputWindow::updateWordWrapMode()
|
||||
{
|
||||
m_outputWindow->setWordWrapEnabled(ProjectExplorerPlugin::instance()->projectExplorerSettings().wrapAppOutput);
|
||||
}
|
||||
|
||||
bool CompileOutputWindow::hasFocus()
|
||||
{
|
||||
return m_outputWindow->hasFocus();
|
||||
|
||||
Reference in New Issue
Block a user