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:
@@ -66,6 +66,9 @@ static Q_LOGGING_CATEGORY(appOutputLog, "qtc.projectexplorer.appoutput", QtWarni
|
||||
using namespace ProjectExplorer;
|
||||
using namespace ProjectExplorer::Internal;
|
||||
|
||||
const char OPTIONS_PAGE_ID[] = "B.ProjectExplorer.AppOutputOptions";
|
||||
|
||||
|
||||
static QObject *debuggerPlugin()
|
||||
{
|
||||
return ExtensionSystem::PluginManager::getObjectByName("DebuggerPlugin");
|
||||
@@ -176,6 +179,7 @@ AppOutputPane::AppOutputPane() :
|
||||
m_attachButton(new QToolButton),
|
||||
m_zoomInButton(new QToolButton),
|
||||
m_zoomOutButton(new QToolButton),
|
||||
m_settingsButton(new QToolButton),
|
||||
m_formatterWidget(new QWidget)
|
||||
{
|
||||
setObjectName("AppOutputPane"); // Used in valgrind engine
|
||||
@@ -226,6 +230,13 @@ AppOutputPane::AppOutputPane() :
|
||||
connect(m_zoomOutButton, &QToolButton::clicked,
|
||||
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;
|
||||
formatterWidgetsLayout->setContentsMargins(QMargins());
|
||||
m_formatterWidget->setLayout(formatterWidgetsLayout);
|
||||
@@ -343,7 +354,7 @@ QWidget *AppOutputPane::outputWidget(QWidget *)
|
||||
QList<QWidget*> AppOutputPane::toolBarWidgets() const
|
||||
{
|
||||
return { m_reRunButton, m_stopButton, m_attachButton, m_zoomInButton,
|
||||
m_zoomOutButton, m_formatterWidget };
|
||||
m_zoomOutButton, m_settingsButton, m_formatterWidget };
|
||||
}
|
||||
|
||||
QString AppOutputPane::displayName() const
|
||||
@@ -864,7 +875,7 @@ private:
|
||||
|
||||
AppOutputSettingsPage::AppOutputSettingsPage()
|
||||
{
|
||||
setId("B.ProjectExplorer.AppOutputOptions");
|
||||
setId(OPTIONS_PAGE_ID);
|
||||
setDisplayName(tr("Application Output"));
|
||||
setCategory(Constants::BUILD_AND_RUN_SETTINGS_CATEGORY);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user