forked from qt-creator/qt-creator
Vcs: Fix output pane
Amends c0c2df203d
.
Change-Id: I77d022f2b3a4d3cab4713d9cbd2bc66102ee58a3
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -221,6 +221,11 @@ void OutputWindow::setLineParsers(const QList<OutputLineParser *> &parsers)
|
|||||||
d->formatter.setLineParsers(parsers);
|
d->formatter.setLineParsers(parsers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OutputFormatter *OutputWindow::outputFormatter() const
|
||||||
|
{
|
||||||
|
return &d->formatter;
|
||||||
|
}
|
||||||
|
|
||||||
void OutputWindow::showEvent(QShowEvent *e)
|
void OutputWindow::showEvent(QShowEvent *e)
|
||||||
{
|
{
|
||||||
QPlainTextEdit::showEvent(e);
|
QPlainTextEdit::showEvent(e);
|
||||||
|
@@ -34,7 +34,10 @@
|
|||||||
#include <QPlainTextEdit>
|
#include <QPlainTextEdit>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
namespace Utils { class OutputLineParser; }
|
namespace Utils {
|
||||||
|
class OutputFormatter;
|
||||||
|
class OutputLineParser;
|
||||||
|
}
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
|
||||||
@@ -57,6 +60,7 @@ public:
|
|||||||
~OutputWindow() override;
|
~OutputWindow() override;
|
||||||
|
|
||||||
void setLineParsers(const QList<Utils::OutputLineParser *> &parsers);
|
void setLineParsers(const QList<Utils::OutputLineParser *> &parsers);
|
||||||
|
Utils::OutputFormatter *outputFormatter() const;
|
||||||
|
|
||||||
void appendMessage(const QString &out, Utils::OutputFormat format);
|
void appendMessage(const QString &out, Utils::OutputFormat format);
|
||||||
|
|
||||||
|
@@ -31,7 +31,6 @@
|
|||||||
#include <coreplugin/find/basetextfind.h>
|
#include <coreplugin/find/basetextfind.h>
|
||||||
#include <coreplugin/outputwindow.h>
|
#include <coreplugin/outputwindow.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
#include <utils/outputformatter.h>
|
|
||||||
#include <utils/qtcprocess.h>
|
#include <utils/qtcprocess.h>
|
||||||
#include <texteditor/behaviorsettings.h>
|
#include <texteditor/behaviorsettings.h>
|
||||||
#include <texteditor/fontsettings.h>
|
#include <texteditor/fontsettings.h>
|
||||||
@@ -111,7 +110,6 @@ private:
|
|||||||
QString identifierUnderCursor(const QPoint &pos, QString *repository = nullptr) const;
|
QString identifierUnderCursor(const QPoint &pos, QString *repository = nullptr) const;
|
||||||
|
|
||||||
Utils::OutputFormat m_format;
|
Utils::OutputFormat m_format;
|
||||||
Utils::OutputFormatter m_formatter;
|
|
||||||
VcsOutputLineParser *m_parser = nullptr;
|
VcsOutputLineParser *m_parser = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -121,7 +119,7 @@ OutputWindowPlainTextEdit::OutputWindowPlainTextEdit(QWidget *parent) :
|
|||||||
setReadOnly(true);
|
setReadOnly(true);
|
||||||
setUndoRedoEnabled(false);
|
setUndoRedoEnabled(false);
|
||||||
setFrameStyle(QFrame::NoFrame);
|
setFrameStyle(QFrame::NoFrame);
|
||||||
m_formatter.setBoldFontEnabled(false);
|
outputFormatter()->setBoldFontEnabled(false);
|
||||||
m_parser = new VcsOutputLineParser;
|
m_parser = new VcsOutputLineParser;
|
||||||
setLineParsers({m_parser});
|
setLineParsers({m_parser});
|
||||||
auto agg = new Aggregation::Aggregate;
|
auto agg = new Aggregation::Aggregate;
|
||||||
@@ -223,7 +221,7 @@ void OutputWindowPlainTextEdit::appendLines(const QString &s, const QString &rep
|
|||||||
|
|
||||||
const int previousLineCount = document()->lineCount();
|
const int previousLineCount = document()->lineCount();
|
||||||
|
|
||||||
m_formatter.appendMessage(s, m_format);
|
outputFormatter()->appendMessage(s, m_format);
|
||||||
|
|
||||||
// Scroll down
|
// Scroll down
|
||||||
moveCursor(QTextCursor::End);
|
moveCursor(QTextCursor::End);
|
||||||
@@ -257,7 +255,7 @@ VcsOutputLineParser *OutputWindowPlainTextEdit::parser()
|
|||||||
|
|
||||||
void OutputWindowPlainTextEdit::setFormat(VcsOutputWindow::MessageStyle style)
|
void OutputWindowPlainTextEdit::setFormat(VcsOutputWindow::MessageStyle style)
|
||||||
{
|
{
|
||||||
m_formatter.setBoldFontEnabled(style == VcsOutputWindow::Command);
|
outputFormatter()->setBoldFontEnabled(style == VcsOutputWindow::Command);
|
||||||
|
|
||||||
switch (style) {
|
switch (style) {
|
||||||
case VcsOutputWindow::Warning:
|
case VcsOutputWindow::Warning:
|
||||||
|
Reference in New Issue
Block a user