ProjectExplorer: Dis-ambiguate issues pane's "show output" action

Amends 08a86169db.

Fixes: QTCREATORBUG-27031
Change-Id: Ie6d214673f6c1c52aab1a035c84a7381f9965588
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2022-02-09 18:00:59 +01:00
parent 2eef90e86f
commit 400ada2daa
4 changed files with 24 additions and 8 deletions

View File

@@ -30,15 +30,19 @@
#include <coreplugin/ioutputpane.h>
#include <coreplugin/outputwindow.h>
#include <utils/algorithm.h>
#include <utils/qtcassert.h>
#include <QAction>
namespace ProjectExplorer {
namespace Internal {
ShowOutputTaskHandler::ShowOutputTaskHandler(Core::IOutputPane *window) : m_window(window)
ShowOutputTaskHandler::ShowOutputTaskHandler(Core::IOutputPane *window, const QString &text,
const QString &tooltip, const QString &shortcut)
: m_window(window), m_text(text), m_tooltip(tooltip), m_shortcut(shortcut)
{
Q_ASSERT(m_window);
QTC_CHECK(m_window);
QTC_CHECK(!m_text.isEmpty());
}
bool ShowOutputTaskHandler::canHandle(const Task &task) const
@@ -64,9 +68,11 @@ void ShowOutputTaskHandler::handle(const Task &task)
QAction *ShowOutputTaskHandler::createAction(QObject *parent) const
{
QAction *outputAction = new QAction(tr("Show &Output"), parent);
outputAction->setToolTip(tr("Show output generating this issue."));
outputAction->setShortcut(QKeySequence(tr("O")));
QAction * const outputAction = new QAction(m_text, parent);
if (!m_tooltip.isEmpty())
outputAction->setToolTip(m_tooltip);
if (!m_shortcut.isEmpty())
outputAction->setShortcut(QKeySequence(m_shortcut));
outputAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
return outputAction;
}