forked from qt-creator/qt-creator
Add option to clear the "Application Output" on a new run.
Reviewed-by: Thorbjorn Lindeijer
This commit is contained in:
@@ -29,6 +29,8 @@
|
|||||||
|
|
||||||
#include "outputwindow.h"
|
#include "outputwindow.h"
|
||||||
#include "projectexplorerconstants.h"
|
#include "projectexplorerconstants.h"
|
||||||
|
#include "projectexplorer.h"
|
||||||
|
#include "projectexplorersettings.h"
|
||||||
#include "runconfiguration.h"
|
#include "runconfiguration.h"
|
||||||
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
@@ -235,7 +237,10 @@ void OutputPane::reRunRunControl()
|
|||||||
int index = m_tabWidget->currentIndex();
|
int index = m_tabWidget->currentIndex();
|
||||||
RunControl *rc = runControlForTab(index);
|
RunControl *rc = runControlForTab(index);
|
||||||
OutputWindow *ow = static_cast<OutputWindow *>(m_tabWidget->widget(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());
|
ow->verticalScrollBar()->setValue(ow->verticalScrollBar()->maximum());
|
||||||
rc->start();
|
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.buildBeforeRun = s->value("ProjectExplorer/Settings/BuildBeforeRun", true).toBool();
|
||||||
d->m_projectExplorerSettings.saveBeforeBuild = s->value("ProjectExplorer/Settings/SaveBeforeBuild", false).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.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();
|
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/BuildBeforeRun", d->m_projectExplorerSettings.buildBeforeRun);
|
||||||
s->setValue("ProjectExplorer/Settings/SaveBeforeBuild", d->m_projectExplorerSettings.saveBeforeBuild);
|
s->setValue("ProjectExplorer/Settings/SaveBeforeBuild", d->m_projectExplorerSettings.saveBeforeBuild);
|
||||||
s->setValue("ProjectExplorer/Settings/ShowCompilerOutput", d->m_projectExplorerSettings.showCompilerOutput);
|
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);
|
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)
|
if (runMode == ProjectExplorer::Constants::RUNMODE)
|
||||||
d->m_outputPane->popup(false);
|
d->m_outputPane->popup(false);
|
||||||
d->m_outputPane->showTabFor(runControl);
|
d->m_outputPane->showTabFor(runControl);
|
||||||
|
if (projectExplorerSettings().cleanOldAppOutput)
|
||||||
|
d->m_outputPane->clearContents();
|
||||||
|
|
||||||
connect(runControl, SIGNAL(addToOutputWindow(RunControl *, const QString &)),
|
connect(runControl, SIGNAL(addToOutputWindow(RunControl *, const QString &)),
|
||||||
this, SLOT(addToApplicationOutputWindow(RunControl *, const QString &)));
|
this, SLOT(addToApplicationOutputWindow(RunControl *, const QString &)));
|
||||||
|
@@ -36,11 +36,13 @@ namespace Internal {
|
|||||||
struct ProjectExplorerSettings
|
struct ProjectExplorerSettings
|
||||||
{
|
{
|
||||||
ProjectExplorerSettings() : buildBeforeRun(true), saveBeforeBuild(false),
|
ProjectExplorerSettings() : buildBeforeRun(true), saveBeforeBuild(false),
|
||||||
showCompilerOutput(false), useJom(true) {}
|
showCompilerOutput(false),
|
||||||
|
cleanOldAppOutput(false), useJom(true) {}
|
||||||
|
|
||||||
bool buildBeforeRun;
|
bool buildBeforeRun;
|
||||||
bool saveBeforeBuild;
|
bool saveBeforeBuild;
|
||||||
bool showCompilerOutput;
|
bool showCompilerOutput;
|
||||||
|
bool cleanOldAppOutput;
|
||||||
bool useJom;
|
bool useJom;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -49,6 +51,7 @@ inline bool operator==(const ProjectExplorerSettings &p1, const ProjectExplorerS
|
|||||||
return p1.buildBeforeRun == p2.buildBeforeRun
|
return p1.buildBeforeRun == p2.buildBeforeRun
|
||||||
&& p1.saveBeforeBuild == p2.saveBeforeBuild
|
&& p1.saveBeforeBuild == p2.saveBeforeBuild
|
||||||
&& p1.showCompilerOutput == p2.showCompilerOutput
|
&& p1.showCompilerOutput == p2.showCompilerOutput
|
||||||
|
&& p1.cleanOldAppOutput == p2.cleanOldAppOutput
|
||||||
&& p1.useJom == p2.useJom;
|
&& p1.useJom == p2.useJom;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -67,6 +67,7 @@ ProjectExplorerSettings ProjectExplorerSettingsWidget::settings() const
|
|||||||
pes.buildBeforeRun = m_ui.buildProjectBeforeRunCheckBox->isChecked();
|
pes.buildBeforeRun = m_ui.buildProjectBeforeRunCheckBox->isChecked();
|
||||||
pes.saveBeforeBuild = m_ui.saveAllFilesCheckBox->isChecked();
|
pes.saveBeforeBuild = m_ui.saveAllFilesCheckBox->isChecked();
|
||||||
pes.showCompilerOutput = m_ui.showCompileOutputCheckBox->isChecked();
|
pes.showCompilerOutput = m_ui.showCompileOutputCheckBox->isChecked();
|
||||||
|
pes.cleanOldAppOutput = m_ui.cleanOldAppOutputCheckBox->isChecked();
|
||||||
pes.useJom = m_ui.jomCheckbox->isChecked();
|
pes.useJom = m_ui.jomCheckbox->isChecked();
|
||||||
return pes;
|
return pes;
|
||||||
}
|
}
|
||||||
@@ -76,6 +77,7 @@ void ProjectExplorerSettingsWidget::setSettings(const ProjectExplorerSettings &
|
|||||||
m_ui.buildProjectBeforeRunCheckBox->setChecked(pes.buildBeforeRun);
|
m_ui.buildProjectBeforeRunCheckBox->setChecked(pes.buildBeforeRun);
|
||||||
m_ui.saveAllFilesCheckBox->setChecked(pes.saveBeforeBuild);
|
m_ui.saveAllFilesCheckBox->setChecked(pes.saveBeforeBuild);
|
||||||
m_ui.showCompileOutputCheckBox->setChecked(pes.showCompilerOutput);
|
m_ui.showCompileOutputCheckBox->setChecked(pes.showCompilerOutput);
|
||||||
|
m_ui.cleanOldAppOutputCheckBox->setChecked(pes.cleanOldAppOutput);
|
||||||
m_ui.jomCheckbox->setChecked(pes.useJom);
|
m_ui.jomCheckbox->setChecked(pes.useJom);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -21,7 +21,7 @@
|
|||||||
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
||||||
</property>
|
</property>
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="Utils::PathChooser" name="projectsDirectoryPathChooser"/>
|
<widget class="Utils::PathChooser" name="projectsDirectoryPathChooser" native="true"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0" colspan="2">
|
<item row="0" column="0" colspan="2">
|
||||||
<widget class="QRadioButton" name="currentDirectoryRadioButton">
|
<widget class="QRadioButton" name="currentDirectoryRadioButton">
|
||||||
@@ -58,21 +58,28 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="saveAllFilesCheckBox">
|
<widget class="QCheckBox" name="saveAllFilesCheckBox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Save all files before Build</string>
|
<string>Save all files before build</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="buildProjectBeforeRunCheckBox">
|
<widget class="QCheckBox" name="buildProjectBeforeRunCheckBox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Always build Project before Running</string>
|
<string>Always build project before running</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="showCompileOutputCheckBox">
|
<widget class="QCheckBox" name="showCompileOutputCheckBox">
|
||||||
<property name="text">
|
<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>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Reference in New Issue
Block a user