Commit b2d69946 authored by Leandro Melo's avatar Leandro Melo
Browse files

Make the output window code a bit better.

Reviewed-by: dt
parent f7532a02
......@@ -254,7 +254,7 @@ void OutputPane::createNewOutputWindow(RunControl *rc)
// Reuse this tab
delete tab.runControl;
tab.runControl = rc;
tab.window->grayOutOldContent();
tab.window->handleOldOutput();
tab.window->scrollToBottom();
tab.window->setFormatter(rc->outputFormatter());
if (debug)
......@@ -311,11 +311,8 @@ void OutputPane::reRunRunControl()
QTC_ASSERT(index != -1 && !m_runControlTabs.at(index).runControl->isRunning(), return;)
RunControlTab &tab = m_runControlTabs[index];
if (ProjectExplorerPlugin::instance()->projectExplorerSettings().cleanOldAppOutput) {
tab.window->clear();
} else {
tab.window->grayOutOldContent();
}
tab.window->handleOldOutput();
tab.window->scrollToBottom();
tab.runControl->start();
}
......@@ -693,6 +690,20 @@ bool OutputWindow::isScrollbarAtBottom() const
// return verticalScrollBar()->value() == verticalScrollBar()->maximum();
}
void OutputWindow::clear()
{
m_enforceNewline = false;
QPlainTextEdit::clear();
}
void OutputWindow::handleOldOutput()
{
if (ProjectExplorerPlugin::instance()->projectExplorerSettings().cleanOldAppOutput)
clear();
else
grayOutOldContent();
}
void OutputWindow::scrollToBottom()
{
verticalScrollBar()->setValue(verticalScrollBar()->maximum());
......
......@@ -164,11 +164,8 @@ public:
void showEvent(QShowEvent *);
void clear()
{
m_enforceNewline = false;
QPlainTextEdit::clear();
}
void clear();
void handleOldOutput();
void scrollToBottom();
......
......@@ -1317,8 +1317,6 @@ void ProjectExplorerPlugin::startRunControl(RunControl *runControl, const QStrin
if (runMode == ProjectExplorer::Constants::RUNMODE)
d->m_outputPane->popup(false);
d->m_outputPane->showTabFor(runControl);
if (projectExplorerSettings().cleanOldAppOutput)
d->m_outputPane->clearContents();
connect(runControl, SIGNAL(addToOutputWindow(ProjectExplorer::RunControl*,QString,bool)),
d->m_outputPane, SLOT(appendApplicationOutput(ProjectExplorer::RunControl*,QString, bool)));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment