forked from qt-creator/qt-creator
ProjectExplorer: Use latest settings style for compile output window
Change-Id: I6b4c8bf3ed7b9589a4b7e7ee77cd0fc5011954c3 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -844,7 +844,7 @@ bool BuildManager::buildQueueAppend(const QList<BuildItem> &items, const QString
|
||||
d->m_maxProgress += enabledCount;
|
||||
for (const BuildItem &item : items)
|
||||
incrementActiveBuildSteps(item.buildStep);
|
||||
if (CompileOutputSettings::instance().popUp())
|
||||
if (compileOutputSettings().popUp())
|
||||
d->m_outputWindow->popup(IOutputPane::NoModeSwitch);
|
||||
startBuildQueue();
|
||||
return true;
|
||||
|
@@ -11,9 +11,12 @@
|
||||
#include "showoutputtaskhandler.h"
|
||||
|
||||
#include <coreplugin/outputwindow.h>
|
||||
#include <coreplugin/dialogs/ioptionspage.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
|
||||
#include <extensionsystem/pluginmanager.h>
|
||||
|
||||
#include <texteditor/texteditorsettings.h>
|
||||
#include <texteditor/fontsettings.h>
|
||||
#include <texteditor/behaviorsettings.h>
|
||||
@@ -37,11 +40,7 @@
|
||||
#include <QToolButton>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
class Task;
|
||||
|
||||
namespace Internal {
|
||||
namespace ProjectExplorer::Internal {
|
||||
|
||||
const char SETTINGS_KEY[] = "ProjectExplorer/CompileOutput/Zoom";
|
||||
const char C_COMPILE_OUTPUT[] = "ProjectExplorer.CompileOutput";
|
||||
@@ -102,14 +101,15 @@ CompileOutputWindow::CompileOutputWindow(QAction *cancelBuildAction) :
|
||||
setupContext(C_COMPILE_OUTPUT, m_outputWindow);
|
||||
updateFromSettings();
|
||||
|
||||
m_outputWindow->setWordWrapEnabled(m_settings.wrapOutput());
|
||||
m_outputWindow->setMaxCharCount(m_settings.maxCharCount());
|
||||
CompileOutputSettings &s = compileOutputSettings();
|
||||
m_outputWindow->setWordWrapEnabled(s.wrapOutput());
|
||||
m_outputWindow->setMaxCharCount(s.maxCharCount());
|
||||
|
||||
connect(&m_settings.wrapOutput, &Utils::BaseAspect::changed, m_outputWindow, [this] {
|
||||
m_outputWindow->setWordWrapEnabled(m_settings.wrapOutput());
|
||||
connect(&s.wrapOutput, &Utils::BaseAspect::changed, m_outputWindow, [this] {
|
||||
m_outputWindow->setWordWrapEnabled(compileOutputSettings().wrapOutput());
|
||||
});
|
||||
connect(&m_settings.maxCharCount, &Utils::BaseAspect::changed, m_outputWindow, [this] {
|
||||
m_outputWindow->setMaxCharCount(m_settings.maxCharCount());
|
||||
connect(&s.maxCharCount, &Utils::BaseAspect::changed, m_outputWindow, [this] {
|
||||
m_outputWindow->setMaxCharCount(compileOutputSettings().maxCharCount());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -231,20 +231,15 @@ void CompileOutputWindow::updateFilter()
|
||||
|
||||
// CompileOutputSettings
|
||||
|
||||
static CompileOutputSettings *s_compileOutputSettings;
|
||||
|
||||
CompileOutputSettings &CompileOutputSettings::instance()
|
||||
CompileOutputSettings &compileOutputSettings()
|
||||
{
|
||||
return *s_compileOutputSettings;
|
||||
static CompileOutputSettings theSettings;
|
||||
return theSettings;
|
||||
}
|
||||
|
||||
CompileOutputSettings::CompileOutputSettings()
|
||||
{
|
||||
s_compileOutputSettings = this;
|
||||
|
||||
setId(OPTIONS_PAGE_ID);
|
||||
setDisplayName(Tr::tr("Compile Output"));
|
||||
setCategory(Constants::BUILD_AND_RUN_SETTINGS_CATEGORY);
|
||||
setAutoApply(false);
|
||||
|
||||
wrapOutput.setSettingsKey("ProjectExplorer/Settings/WrapBuildOutput");
|
||||
wrapOutput.setDefaultValue(true);
|
||||
@@ -274,5 +269,20 @@ CompileOutputSettings::CompileOutputSettings()
|
||||
readSettings();
|
||||
}
|
||||
|
||||
} // Internal
|
||||
} // ProjectExplorer
|
||||
// CompileOutputSettingsPage
|
||||
|
||||
class CompileOutputSettingsPage final : public Core::IOptionsPage
|
||||
{
|
||||
public:
|
||||
CompileOutputSettingsPage()
|
||||
{
|
||||
setId(OPTIONS_PAGE_ID);
|
||||
setDisplayName(Tr::tr("Compile Output"));
|
||||
setCategory(Constants::BUILD_AND_RUN_SETTINGS_CATEGORY);
|
||||
setSettingsProvider([] { return &compileOutputSettings(); });
|
||||
}
|
||||
};
|
||||
|
||||
const CompileOutputSettingsPage settingsPage;
|
||||
|
||||
} // ProjectExplorer::Internal
|
||||
|
@@ -26,18 +26,18 @@ namespace Internal {
|
||||
class ShowOutputTaskHandler;
|
||||
class CompileOutputTextEdit;
|
||||
|
||||
class CompileOutputSettings final : public Core::PagedSettings
|
||||
class CompileOutputSettings final : public Utils::AspectContainer
|
||||
{
|
||||
public:
|
||||
CompileOutputSettings();
|
||||
|
||||
static CompileOutputSettings &instance();
|
||||
|
||||
Utils::BoolAspect popUp{this};
|
||||
Utils::BoolAspect wrapOutput{this};
|
||||
Utils::IntegerAspect maxCharCount{this};
|
||||
};
|
||||
|
||||
CompileOutputSettings &compileOutputSettings();
|
||||
|
||||
class CompileOutputWindow final : public Core::IOutputPane
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -80,7 +80,6 @@ private:
|
||||
ShowOutputTaskHandler *m_handler;
|
||||
QToolButton *m_cancelBuildButton;
|
||||
QToolButton * const m_settingsButton;
|
||||
CompileOutputSettings m_settings;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
Reference in New Issue
Block a user