forked from qt-creator/qt-creator
Compile output: Add 'Cancel Build' button
Change-Id: Ib633c172f3e5a79818ac737016948cbeda82ac41 Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
committed by
Daniel Teske
parent
12236050b9
commit
9270d858c1
@@ -52,6 +52,7 @@
|
||||
#include <QTextEdit>
|
||||
#include <QScrollBar>
|
||||
#include <QPlainTextEdit>
|
||||
#include <QToolButton>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace ProjectExplorer::Internal;
|
||||
@@ -100,7 +101,8 @@ private:
|
||||
} // namespace Internal
|
||||
} // namespace ProjectExplorer
|
||||
|
||||
CompileOutputWindow::CompileOutputWindow(BuildManager * /*bm*/)
|
||||
CompileOutputWindow::CompileOutputWindow(BuildManager * /*bm*/, QAction *cancelBuildAction) :
|
||||
m_cancelBuildButton(new QToolButton)
|
||||
{
|
||||
Core::Context context(Constants::C_COMPILE_OUTPUT);
|
||||
m_outputWindow = new CompileOutputTextEdit(context);
|
||||
@@ -110,6 +112,8 @@ CompileOutputWindow::CompileOutputWindow(BuildManager * /*bm*/)
|
||||
m_outputWindow->setUndoRedoEnabled(false);
|
||||
m_outputWindow->setMaxLineCount(MAX_LINECOUNT);
|
||||
|
||||
m_cancelBuildButton->setDefaultAction(cancelBuildAction);
|
||||
|
||||
Aggregation::Aggregate *agg = new Aggregation::Aggregate;
|
||||
agg->add(m_outputWindow);
|
||||
agg->add(new Find::BaseTextFind(m_outputWindow));
|
||||
@@ -127,6 +131,7 @@ CompileOutputWindow::~CompileOutputWindow()
|
||||
{
|
||||
ExtensionSystem::PluginManager::instance()->removeObject(m_handler);
|
||||
delete m_handler;
|
||||
delete m_cancelBuildButton;
|
||||
}
|
||||
|
||||
void CompileOutputWindow::updateWordWrapMode()
|
||||
@@ -154,6 +159,11 @@ QWidget *CompileOutputWindow::outputWidget(QWidget *)
|
||||
return m_outputWindow;
|
||||
}
|
||||
|
||||
QList<QWidget *> CompileOutputWindow::toolBarWidgets() const
|
||||
{
|
||||
return QList<QWidget *>() << m_cancelBuildButton;
|
||||
}
|
||||
|
||||
static QColor mix_colors(QColor a, QColor b)
|
||||
{
|
||||
return QColor((a.red() + 2 * b.red()) / 3, (a.green() + 2 * b.green()) / 3,
|
||||
|
||||
Reference in New Issue
Block a user