Commit 92d05ed8 authored by Erik Verbruggen's avatar Erik Verbruggen

Add option to clear the "Application Output" on a new run.

Reviewed-by: Thorbjorn Lindeijer
parent 44c02264
......@@ -29,6 +29,8 @@
#include "outputwindow.h"
#include "projectexplorerconstants.h"
#include "projectexplorer.h"
#include "projectexplorersettings.h"
#include "runconfiguration.h"
#include <coreplugin/actionmanager/actionmanager.h>
......@@ -235,7 +237,10 @@ void OutputPane::reRunRunControl()
int index = m_tabWidget->currentIndex();
RunControl *rc = runControlForTab(index);
OutputWindow *ow = static_cast<OutputWindow *>(m_tabWidget->widget(index));
ow->grayOutOldContent();
if (ProjectExplorerPlugin::instance()->projectExplorerSettings().cleanOldAppOutput)
ow->clear();
else
ow->grayOutOldContent();
ow->verticalScrollBar()->setValue(ow->verticalScrollBar()->maximum());
rc->start();
}
......
......@@ -746,6 +746,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
d->m_projectExplorerSettings.buildBeforeRun = s->value("ProjectExplorer/Settings/BuildBeforeRun", true).toBool();
d->m_projectExplorerSettings.saveBeforeBuild = s->value("ProjectExplorer/Settings/SaveBeforeBuild", false).toBool();
d->m_projectExplorerSettings.showCompilerOutput = s->value("ProjectExplorer/Settings/ShowCompilerOutput", false).toBool();
d->m_projectExplorerSettings.cleanOldAppOutput = s->value("ProjectExplorer/Settings/CleanOldAppOutput", false).toBool();
d->m_projectExplorerSettings.useJom = s->value("ProjectExplorer/Settings/UseJom", true).toBool();
}
......@@ -990,6 +991,7 @@ void ProjectExplorerPlugin::savePersistentSettings()
s->setValue("ProjectExplorer/Settings/BuildBeforeRun", d->m_projectExplorerSettings.buildBeforeRun);
s->setValue("ProjectExplorer/Settings/SaveBeforeBuild", d->m_projectExplorerSettings.saveBeforeBuild);
s->setValue("ProjectExplorer/Settings/ShowCompilerOutput", d->m_projectExplorerSettings.showCompilerOutput);
s->setValue("ProjectExplorer/Settings/CleanOldAppOutput", d->m_projectExplorerSettings.cleanOldAppOutput);
s->setValue("ProjectExplorer/Settings/UseJom", d->m_projectExplorerSettings.useJom);
}
}
......@@ -1268,6 +1270,8 @@ 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(RunControl *, const QString &)),
this, SLOT(addToApplicationOutputWindow(RunControl *, const QString &)));
......
......@@ -36,11 +36,13 @@ namespace Internal {
struct ProjectExplorerSettings
{
ProjectExplorerSettings() : buildBeforeRun(true), saveBeforeBuild(false),
showCompilerOutput(false), useJom(true) {}
showCompilerOutput(false),
cleanOldAppOutput(false), useJom(true) {}
bool buildBeforeRun;
bool saveBeforeBuild;
bool showCompilerOutput;
bool cleanOldAppOutput;
bool useJom;
};
......@@ -49,6 +51,7 @@ inline bool operator==(const ProjectExplorerSettings &p1, const ProjectExplorerS
return p1.buildBeforeRun == p2.buildBeforeRun
&& p1.saveBeforeBuild == p2.saveBeforeBuild
&& p1.showCompilerOutput == p2.showCompilerOutput
&& p1.cleanOldAppOutput == p2.cleanOldAppOutput
&& p1.useJom == p2.useJom;
}
......
......@@ -67,6 +67,7 @@ ProjectExplorerSettings ProjectExplorerSettingsWidget::settings() const
pes.buildBeforeRun = m_ui.buildProjectBeforeRunCheckBox->isChecked();
pes.saveBeforeBuild = m_ui.saveAllFilesCheckBox->isChecked();
pes.showCompilerOutput = m_ui.showCompileOutputCheckBox->isChecked();
pes.cleanOldAppOutput = m_ui.cleanOldAppOutputCheckBox->isChecked();
pes.useJom = m_ui.jomCheckbox->isChecked();
return pes;
}
......@@ -76,6 +77,7 @@ void ProjectExplorerSettingsWidget::setSettings(const ProjectExplorerSettings &
m_ui.buildProjectBeforeRunCheckBox->setChecked(pes.buildBeforeRun);
m_ui.saveAllFilesCheckBox->setChecked(pes.saveBeforeBuild);
m_ui.showCompileOutputCheckBox->setChecked(pes.showCompilerOutput);
m_ui.cleanOldAppOutputCheckBox->setChecked(pes.cleanOldAppOutput);
m_ui.jomCheckbox->setChecked(pes.useJom);
}
......
......@@ -21,7 +21,7 @@
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<item row="1" column="1">
<widget class="Utils::PathChooser" name="projectsDirectoryPathChooser"/>
<widget class="Utils::PathChooser" name="projectsDirectoryPathChooser" native="true"/>
</item>
<item row="0" column="0" colspan="2">
<widget class="QRadioButton" name="currentDirectoryRadioButton">
......@@ -58,21 +58,28 @@
<item>
<widget class="QCheckBox" name="saveAllFilesCheckBox">
<property name="text">
<string>Save all files before Build</string>
<string>Save all files before build</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="buildProjectBeforeRunCheckBox">
<property name="text">
<string>Always build Project before Running</string>
<string>Always build project before running</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="showCompileOutputCheckBox">
<property name="text">
<string>Show Compiler Output on building</string>
<string>Show compiler output on building</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cleanOldAppOutputCheckBox">
<property name="text">
<string>Clear old appliction output</string>
</property>
</widget>
</item>
......
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