forked from qt-creator/qt-creator
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 <alessandro.portale@qt.io>
This commit is contained in:
@@ -320,10 +320,10 @@
|
|||||||
|
|
||||||
To specify settings for displaying application output, select
|
To specify settings for displaying application output, select
|
||||||
\uicontrol Tools > \uicontrol Options > \uicontrol {Build & Run} >
|
\uicontrol Tools > \uicontrol Options > \uicontrol {Build & Run} >
|
||||||
\uicontrol Application Output. You can select whether to open the
|
\uicontrol Application Output, or click the \uicontrol {Open Settings Page}
|
||||||
\uicontrol{Application Output} pane on output when running or debugging
|
button. You can select whether to open the \uicontrol{Application Output} pane
|
||||||
applications, to clear old output on a new run, to word-wrap output, and to
|
on output when running or debugging applications, to clear old output on a new run,
|
||||||
limit output to the specified number of lines.
|
to word-wrap output, and to limit output to the specified number of lines.
|
||||||
|
|
||||||
\section2 Compile Output
|
\section2 Compile Output
|
||||||
|
|
||||||
@@ -345,6 +345,9 @@
|
|||||||
In the \uicontrol {Limit output to} field, you can specify the maximum
|
In the \uicontrol {Limit output to} field, you can specify the maximum
|
||||||
amount of build output lines to display in the pane.
|
amount of build output lines to display in the pane.
|
||||||
|
|
||||||
|
You can also reach the options page by clicking the \uicontrol {Open Settings Page}
|
||||||
|
button.
|
||||||
|
|
||||||
\if defined(qtcreator)
|
\if defined(qtcreator)
|
||||||
\section2 To-Do Entries
|
\section2 To-Do Entries
|
||||||
|
|
||||||
|
@@ -66,6 +66,9 @@ static Q_LOGGING_CATEGORY(appOutputLog, "qtc.projectexplorer.appoutput", QtWarni
|
|||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
using namespace ProjectExplorer::Internal;
|
using namespace ProjectExplorer::Internal;
|
||||||
|
|
||||||
|
const char OPTIONS_PAGE_ID[] = "B.ProjectExplorer.AppOutputOptions";
|
||||||
|
|
||||||
|
|
||||||
static QObject *debuggerPlugin()
|
static QObject *debuggerPlugin()
|
||||||
{
|
{
|
||||||
return ExtensionSystem::PluginManager::getObjectByName("DebuggerPlugin");
|
return ExtensionSystem::PluginManager::getObjectByName("DebuggerPlugin");
|
||||||
@@ -176,6 +179,7 @@ AppOutputPane::AppOutputPane() :
|
|||||||
m_attachButton(new QToolButton),
|
m_attachButton(new QToolButton),
|
||||||
m_zoomInButton(new QToolButton),
|
m_zoomInButton(new QToolButton),
|
||||||
m_zoomOutButton(new QToolButton),
|
m_zoomOutButton(new QToolButton),
|
||||||
|
m_settingsButton(new QToolButton),
|
||||||
m_formatterWidget(new QWidget)
|
m_formatterWidget(new QWidget)
|
||||||
{
|
{
|
||||||
setObjectName("AppOutputPane"); // Used in valgrind engine
|
setObjectName("AppOutputPane"); // Used in valgrind engine
|
||||||
@@ -226,6 +230,13 @@ AppOutputPane::AppOutputPane() :
|
|||||||
connect(m_zoomOutButton, &QToolButton::clicked,
|
connect(m_zoomOutButton, &QToolButton::clicked,
|
||||||
this, &AppOutputPane::zoomOut);
|
this, &AppOutputPane::zoomOut);
|
||||||
|
|
||||||
|
m_settingsButton->setToolTip(tr("Open Settings Page"));
|
||||||
|
m_settingsButton->setIcon(Utils::Icons::SETTINGS_TOOLBAR.icon());
|
||||||
|
m_settingsButton->setAutoRaise(true);
|
||||||
|
connect(m_settingsButton, &QToolButton::clicked, this, [] {
|
||||||
|
Core::ICore::showOptionsDialog(OPTIONS_PAGE_ID);
|
||||||
|
});
|
||||||
|
|
||||||
auto formatterWidgetsLayout = new QHBoxLayout;
|
auto formatterWidgetsLayout = new QHBoxLayout;
|
||||||
formatterWidgetsLayout->setContentsMargins(QMargins());
|
formatterWidgetsLayout->setContentsMargins(QMargins());
|
||||||
m_formatterWidget->setLayout(formatterWidgetsLayout);
|
m_formatterWidget->setLayout(formatterWidgetsLayout);
|
||||||
@@ -343,7 +354,7 @@ QWidget *AppOutputPane::outputWidget(QWidget *)
|
|||||||
QList<QWidget*> AppOutputPane::toolBarWidgets() const
|
QList<QWidget*> AppOutputPane::toolBarWidgets() const
|
||||||
{
|
{
|
||||||
return { m_reRunButton, m_stopButton, m_attachButton, m_zoomInButton,
|
return { m_reRunButton, m_stopButton, m_attachButton, m_zoomInButton,
|
||||||
m_zoomOutButton, m_formatterWidget };
|
m_zoomOutButton, m_settingsButton, m_formatterWidget };
|
||||||
}
|
}
|
||||||
|
|
||||||
QString AppOutputPane::displayName() const
|
QString AppOutputPane::displayName() const
|
||||||
@@ -864,7 +875,7 @@ private:
|
|||||||
|
|
||||||
AppOutputSettingsPage::AppOutputSettingsPage()
|
AppOutputSettingsPage::AppOutputSettingsPage()
|
||||||
{
|
{
|
||||||
setId("B.ProjectExplorer.AppOutputOptions");
|
setId(OPTIONS_PAGE_ID);
|
||||||
setDisplayName(tr("Application Output"));
|
setDisplayName(tr("Application Output"));
|
||||||
setCategory(Constants::BUILD_AND_RUN_SETTINGS_CATEGORY);
|
setCategory(Constants::BUILD_AND_RUN_SETTINGS_CATEGORY);
|
||||||
}
|
}
|
||||||
|
@@ -162,6 +162,7 @@ private:
|
|||||||
QToolButton *m_attachButton;
|
QToolButton *m_attachButton;
|
||||||
QToolButton *m_zoomInButton;
|
QToolButton *m_zoomInButton;
|
||||||
QToolButton *m_zoomOutButton;
|
QToolButton *m_zoomOutButton;
|
||||||
|
QToolButton * const m_settingsButton;
|
||||||
QWidget *m_formatterWidget;
|
QWidget *m_formatterWidget;
|
||||||
float m_zoom;
|
float m_zoom;
|
||||||
AppOutputSettings m_settings;
|
AppOutputSettings m_settings;
|
||||||
|
@@ -66,6 +66,7 @@ const char C_COMPILE_OUTPUT[] = "ProjectExplorer.CompileOutput";
|
|||||||
const char POP_UP_KEY[] = "ProjectExplorer/Settings/ShowCompilerOutput";
|
const char POP_UP_KEY[] = "ProjectExplorer/Settings/ShowCompilerOutput";
|
||||||
const char WRAP_OUTPUT_KEY[] = "ProjectExplorer/Settings/WrapBuildOutput";
|
const char WRAP_OUTPUT_KEY[] = "ProjectExplorer/Settings/WrapBuildOutput";
|
||||||
const char MAX_LINES_KEY[] = "ProjectExplorer/Settings/MaxBuildOutputLines";
|
const char MAX_LINES_KEY[] = "ProjectExplorer/Settings/MaxBuildOutputLines";
|
||||||
|
const char OPTIONS_PAGE_ID[] = "C.ProjectExplorer.CompileOutputOptions";
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
namespace ProjectExplorer {
|
||||||
@@ -159,6 +160,7 @@ CompileOutputWindow::CompileOutputWindow(QAction *cancelBuildAction) :
|
|||||||
m_cancelBuildButton(new QToolButton),
|
m_cancelBuildButton(new QToolButton),
|
||||||
m_zoomInButton(new QToolButton),
|
m_zoomInButton(new QToolButton),
|
||||||
m_zoomOutButton(new QToolButton),
|
m_zoomOutButton(new QToolButton),
|
||||||
|
m_settingsButton(new QToolButton),
|
||||||
m_formatter(new Utils::OutputFormatter)
|
m_formatter(new Utils::OutputFormatter)
|
||||||
{
|
{
|
||||||
Core::Context context(C_COMPILE_OUTPUT);
|
Core::Context context(C_COMPILE_OUTPUT);
|
||||||
@@ -187,6 +189,8 @@ CompileOutputWindow::CompileOutputWindow(QAction *cancelBuildAction) :
|
|||||||
m_zoomInButton->setIcon(Utils::Icons::PLUS_TOOLBAR.icon());
|
m_zoomInButton->setIcon(Utils::Icons::PLUS_TOOLBAR.icon());
|
||||||
m_zoomOutButton->setToolTip(tr("Decrease Font Size"));
|
m_zoomOutButton->setToolTip(tr("Decrease Font Size"));
|
||||||
m_zoomOutButton->setIcon(Utils::Icons::MINUS.icon());
|
m_zoomOutButton->setIcon(Utils::Icons::MINUS.icon());
|
||||||
|
m_settingsButton->setToolTip(tr("Open Settings Page"));
|
||||||
|
m_settingsButton->setIcon(Utils::Icons::SETTINGS_TOOLBAR.icon());
|
||||||
|
|
||||||
updateZoomEnabled();
|
updateZoomEnabled();
|
||||||
|
|
||||||
@@ -198,6 +202,9 @@ CompileOutputWindow::CompileOutputWindow(QAction *cancelBuildAction) :
|
|||||||
this, [this]() { m_outputWindow->zoomIn(1); });
|
this, [this]() { m_outputWindow->zoomIn(1); });
|
||||||
connect(m_zoomOutButton, &QToolButton::clicked,
|
connect(m_zoomOutButton, &QToolButton::clicked,
|
||||||
this, [this]() { m_outputWindow->zoomOut(1); });
|
this, [this]() { m_outputWindow->zoomOut(1); });
|
||||||
|
connect(m_settingsButton, &QToolButton::clicked, this, [] {
|
||||||
|
Core::ICore::showOptionsDialog(OPTIONS_PAGE_ID);
|
||||||
|
});
|
||||||
|
|
||||||
auto agg = new Aggregation::Aggregate;
|
auto agg = new Aggregation::Aggregate;
|
||||||
agg->add(m_outputWindow);
|
agg->add(m_outputWindow);
|
||||||
@@ -218,6 +225,7 @@ CompileOutputWindow::~CompileOutputWindow()
|
|||||||
delete m_cancelBuildButton;
|
delete m_cancelBuildButton;
|
||||||
delete m_zoomInButton;
|
delete m_zoomInButton;
|
||||||
delete m_zoomOutButton;
|
delete m_zoomOutButton;
|
||||||
|
delete m_settingsButton;
|
||||||
delete m_formatter;
|
delete m_formatter;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -259,7 +267,7 @@ QWidget *CompileOutputWindow::outputWidget(QWidget *)
|
|||||||
|
|
||||||
QList<QWidget *> CompileOutputWindow::toolBarWidgets() const
|
QList<QWidget *> 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)
|
void CompileOutputWindow::appendText(const QString &text, BuildStep::OutputFormat format)
|
||||||
@@ -432,7 +440,7 @@ private:
|
|||||||
|
|
||||||
CompileOutputSettingsPage::CompileOutputSettingsPage()
|
CompileOutputSettingsPage::CompileOutputSettingsPage()
|
||||||
{
|
{
|
||||||
setId("C.ProjectExplorer.CompileOutputOptions");
|
setId(OPTIONS_PAGE_ID);
|
||||||
setDisplayName(tr("Compile Output"));
|
setDisplayName(tr("Compile Output"));
|
||||||
setCategory(Constants::BUILD_AND_RUN_SETTINGS_CATEGORY);
|
setCategory(Constants::BUILD_AND_RUN_SETTINGS_CATEGORY);
|
||||||
}
|
}
|
||||||
|
@@ -99,6 +99,7 @@ private:
|
|||||||
QToolButton *m_cancelBuildButton;
|
QToolButton *m_cancelBuildButton;
|
||||||
QToolButton *m_zoomInButton;
|
QToolButton *m_zoomInButton;
|
||||||
QToolButton *m_zoomOutButton;
|
QToolButton *m_zoomOutButton;
|
||||||
|
QToolButton * const m_settingsButton;
|
||||||
Utils::OutputFormatter *m_formatter;
|
Utils::OutputFormatter *m_formatter;
|
||||||
CompileOutputSettings m_settings;
|
CompileOutputSettings m_settings;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user