From 14bffd2c88eecfd9539468f7ffdd0baf03206887 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 12 Mar 2019 10:18:14 +0100 Subject: ProjectExplorer: Add settings icon to app and compile output panes This provides a natural shortcut to the respective options page. Change-Id: I1e57c64d1541540cb1c0c44c6fb8eaad69fc2e32 Reviewed-by: Alessandro Portale --- src/plugins/projectexplorer/compileoutputwindow.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/plugins/projectexplorer/compileoutputwindow.cpp') diff --git a/src/plugins/projectexplorer/compileoutputwindow.cpp b/src/plugins/projectexplorer/compileoutputwindow.cpp index 305d6ca6e2..cd633054c7 100644 --- a/src/plugins/projectexplorer/compileoutputwindow.cpp +++ b/src/plugins/projectexplorer/compileoutputwindow.cpp @@ -66,6 +66,7 @@ const char C_COMPILE_OUTPUT[] = "ProjectExplorer.CompileOutput"; const char POP_UP_KEY[] = "ProjectExplorer/Settings/ShowCompilerOutput"; const char WRAP_OUTPUT_KEY[] = "ProjectExplorer/Settings/WrapBuildOutput"; const char MAX_LINES_KEY[] = "ProjectExplorer/Settings/MaxBuildOutputLines"; +const char OPTIONS_PAGE_ID[] = "C.ProjectExplorer.CompileOutputOptions"; } namespace ProjectExplorer { @@ -159,6 +160,7 @@ CompileOutputWindow::CompileOutputWindow(QAction *cancelBuildAction) : m_cancelBuildButton(new QToolButton), m_zoomInButton(new QToolButton), m_zoomOutButton(new QToolButton), + m_settingsButton(new QToolButton), m_formatter(new Utils::OutputFormatter) { Core::Context context(C_COMPILE_OUTPUT); @@ -187,6 +189,8 @@ CompileOutputWindow::CompileOutputWindow(QAction *cancelBuildAction) : m_zoomInButton->setIcon(Utils::Icons::PLUS_TOOLBAR.icon()); m_zoomOutButton->setToolTip(tr("Decrease Font Size")); m_zoomOutButton->setIcon(Utils::Icons::MINUS.icon()); + m_settingsButton->setToolTip(tr("Open Settings Page")); + m_settingsButton->setIcon(Utils::Icons::SETTINGS_TOOLBAR.icon()); updateZoomEnabled(); @@ -198,6 +202,9 @@ CompileOutputWindow::CompileOutputWindow(QAction *cancelBuildAction) : this, [this]() { m_outputWindow->zoomIn(1); }); connect(m_zoomOutButton, &QToolButton::clicked, this, [this]() { m_outputWindow->zoomOut(1); }); + connect(m_settingsButton, &QToolButton::clicked, this, [] { + Core::ICore::showOptionsDialog(OPTIONS_PAGE_ID); + }); auto agg = new Aggregation::Aggregate; agg->add(m_outputWindow); @@ -218,6 +225,7 @@ CompileOutputWindow::~CompileOutputWindow() delete m_cancelBuildButton; delete m_zoomInButton; delete m_zoomOutButton; + delete m_settingsButton; delete m_formatter; } @@ -259,7 +267,7 @@ QWidget *CompileOutputWindow::outputWidget(QWidget *) QList CompileOutputWindow::toolBarWidgets() const { - return {m_cancelBuildButton, m_zoomInButton, m_zoomOutButton}; + return {m_cancelBuildButton, m_zoomInButton, m_zoomOutButton, m_settingsButton}; } void CompileOutputWindow::appendText(const QString &text, BuildStep::OutputFormat format) @@ -432,7 +440,7 @@ private: CompileOutputSettingsPage::CompileOutputSettingsPage() { - setId("C.ProjectExplorer.CompileOutputOptions"); + setId(OPTIONS_PAGE_ID); setDisplayName(tr("Compile Output")); setCategory(Constants::BUILD_AND_RUN_SETTINGS_CATEGORY); } -- cgit v1.2.1