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;
|
d->m_maxProgress += enabledCount;
|
||||||
for (const BuildItem &item : items)
|
for (const BuildItem &item : items)
|
||||||
incrementActiveBuildSteps(item.buildStep);
|
incrementActiveBuildSteps(item.buildStep);
|
||||||
if (CompileOutputSettings::instance().popUp())
|
if (compileOutputSettings().popUp())
|
||||||
d->m_outputWindow->popup(IOutputPane::NoModeSwitch);
|
d->m_outputWindow->popup(IOutputPane::NoModeSwitch);
|
||||||
startBuildQueue();
|
startBuildQueue();
|
||||||
return true;
|
return true;
|
||||||
|
@@ -11,9 +11,12 @@
|
|||||||
#include "showoutputtaskhandler.h"
|
#include "showoutputtaskhandler.h"
|
||||||
|
|
||||||
#include <coreplugin/outputwindow.h>
|
#include <coreplugin/outputwindow.h>
|
||||||
|
#include <coreplugin/dialogs/ioptionspage.h>
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/coreconstants.h>
|
#include <coreplugin/coreconstants.h>
|
||||||
|
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
|
||||||
#include <texteditor/texteditorsettings.h>
|
#include <texteditor/texteditorsettings.h>
|
||||||
#include <texteditor/fontsettings.h>
|
#include <texteditor/fontsettings.h>
|
||||||
#include <texteditor/behaviorsettings.h>
|
#include <texteditor/behaviorsettings.h>
|
||||||
@@ -37,11 +40,7 @@
|
|||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer::Internal {
|
||||||
|
|
||||||
class Task;
|
|
||||||
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
const char SETTINGS_KEY[] = "ProjectExplorer/CompileOutput/Zoom";
|
const char SETTINGS_KEY[] = "ProjectExplorer/CompileOutput/Zoom";
|
||||||
const char C_COMPILE_OUTPUT[] = "ProjectExplorer.CompileOutput";
|
const char C_COMPILE_OUTPUT[] = "ProjectExplorer.CompileOutput";
|
||||||
@@ -102,14 +101,15 @@ CompileOutputWindow::CompileOutputWindow(QAction *cancelBuildAction) :
|
|||||||
setupContext(C_COMPILE_OUTPUT, m_outputWindow);
|
setupContext(C_COMPILE_OUTPUT, m_outputWindow);
|
||||||
updateFromSettings();
|
updateFromSettings();
|
||||||
|
|
||||||
m_outputWindow->setWordWrapEnabled(m_settings.wrapOutput());
|
CompileOutputSettings &s = compileOutputSettings();
|
||||||
m_outputWindow->setMaxCharCount(m_settings.maxCharCount());
|
m_outputWindow->setWordWrapEnabled(s.wrapOutput());
|
||||||
|
m_outputWindow->setMaxCharCount(s.maxCharCount());
|
||||||
|
|
||||||
connect(&m_settings.wrapOutput, &Utils::BaseAspect::changed, m_outputWindow, [this] {
|
connect(&s.wrapOutput, &Utils::BaseAspect::changed, m_outputWindow, [this] {
|
||||||
m_outputWindow->setWordWrapEnabled(m_settings.wrapOutput());
|
m_outputWindow->setWordWrapEnabled(compileOutputSettings().wrapOutput());
|
||||||
});
|
});
|
||||||
connect(&m_settings.maxCharCount, &Utils::BaseAspect::changed, m_outputWindow, [this] {
|
connect(&s.maxCharCount, &Utils::BaseAspect::changed, m_outputWindow, [this] {
|
||||||
m_outputWindow->setMaxCharCount(m_settings.maxCharCount());
|
m_outputWindow->setMaxCharCount(compileOutputSettings().maxCharCount());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -231,20 +231,15 @@ void CompileOutputWindow::updateFilter()
|
|||||||
|
|
||||||
// CompileOutputSettings
|
// CompileOutputSettings
|
||||||
|
|
||||||
static CompileOutputSettings *s_compileOutputSettings;
|
CompileOutputSettings &compileOutputSettings()
|
||||||
|
|
||||||
CompileOutputSettings &CompileOutputSettings::instance()
|
|
||||||
{
|
{
|
||||||
return *s_compileOutputSettings;
|
static CompileOutputSettings theSettings;
|
||||||
|
return theSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
CompileOutputSettings::CompileOutputSettings()
|
CompileOutputSettings::CompileOutputSettings()
|
||||||
{
|
{
|
||||||
s_compileOutputSettings = this;
|
setAutoApply(false);
|
||||||
|
|
||||||
setId(OPTIONS_PAGE_ID);
|
|
||||||
setDisplayName(Tr::tr("Compile Output"));
|
|
||||||
setCategory(Constants::BUILD_AND_RUN_SETTINGS_CATEGORY);
|
|
||||||
|
|
||||||
wrapOutput.setSettingsKey("ProjectExplorer/Settings/WrapBuildOutput");
|
wrapOutput.setSettingsKey("ProjectExplorer/Settings/WrapBuildOutput");
|
||||||
wrapOutput.setDefaultValue(true);
|
wrapOutput.setDefaultValue(true);
|
||||||
@@ -274,5 +269,20 @@ CompileOutputSettings::CompileOutputSettings()
|
|||||||
readSettings();
|
readSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // Internal
|
// CompileOutputSettingsPage
|
||||||
} // ProjectExplorer
|
|
||||||
|
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 ShowOutputTaskHandler;
|
||||||
class CompileOutputTextEdit;
|
class CompileOutputTextEdit;
|
||||||
|
|
||||||
class CompileOutputSettings final : public Core::PagedSettings
|
class CompileOutputSettings final : public Utils::AspectContainer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CompileOutputSettings();
|
CompileOutputSettings();
|
||||||
|
|
||||||
static CompileOutputSettings &instance();
|
|
||||||
|
|
||||||
Utils::BoolAspect popUp{this};
|
Utils::BoolAspect popUp{this};
|
||||||
Utils::BoolAspect wrapOutput{this};
|
Utils::BoolAspect wrapOutput{this};
|
||||||
Utils::IntegerAspect maxCharCount{this};
|
Utils::IntegerAspect maxCharCount{this};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
CompileOutputSettings &compileOutputSettings();
|
||||||
|
|
||||||
class CompileOutputWindow final : public Core::IOutputPane
|
class CompileOutputWindow final : public Core::IOutputPane
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -80,7 +80,6 @@ private:
|
|||||||
ShowOutputTaskHandler *m_handler;
|
ShowOutputTaskHandler *m_handler;
|
||||||
QToolButton *m_cancelBuildButton;
|
QToolButton *m_cancelBuildButton;
|
||||||
QToolButton * const m_settingsButton;
|
QToolButton * const m_settingsButton;
|
||||||
CompileOutputSettings m_settings;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
Reference in New Issue
Block a user