forked from qt-creator/qt-creator
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:
@@ -172,7 +172,10 @@ AppOutputPane::AppOutputPane() :
|
||||
m_attachButton(new QToolButton),
|
||||
m_settingsButton(new QToolButton),
|
||||
m_formatterWidget(new QWidget),
|
||||
m_handler(new ShowOutputTaskHandler(this))
|
||||
m_handler(new ShowOutputTaskHandler(this,
|
||||
tr("Show &App Output"),
|
||||
tr("Show the output that generated this issue in the application output window"),
|
||||
tr("A")))
|
||||
{
|
||||
ExtensionSystem::PluginManager::addObject(m_handler);
|
||||
|
||||
|
@@ -116,7 +116,10 @@ CompileOutputWindow::CompileOutputWindow(QAction *cancelBuildAction) :
|
||||
|
||||
qRegisterMetaType<QTextCharFormat>("QTextCharFormat");
|
||||
|
||||
m_handler = new ShowOutputTaskHandler(this);
|
||||
m_handler = new ShowOutputTaskHandler(this,
|
||||
tr("Show Compile &Output"),
|
||||
tr("Show the output that generated this issue in the compile output window"),
|
||||
tr("O"));
|
||||
ExtensionSystem::PluginManager::addObject(m_handler);
|
||||
setupContext(C_COMPILE_OUTPUT, m_outputWindow);
|
||||
loadSettings();
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -37,7 +37,8 @@ class ShowOutputTaskHandler : public ITaskHandler
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit ShowOutputTaskHandler(Core::IOutputPane *window);
|
||||
explicit ShowOutputTaskHandler(Core::IOutputPane *window, const QString &text,
|
||||
const QString &tooltip, const QString &shortcut);
|
||||
|
||||
bool canHandle(const Task &) const override;
|
||||
void handle(const Task &task) override;
|
||||
@@ -45,6 +46,9 @@ public:
|
||||
|
||||
private:
|
||||
Core::IOutputPane * const m_window;
|
||||
const QString m_text;
|
||||
const QString m_tooltip;
|
||||
const QString m_shortcut;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
Reference in New Issue
Block a user