forked from qt-creator/qt-creator
ProjectExplorer: Add "link back from issues" functionality
... to the app output pane. Change-Id: I3e11f63a42fb30ae4e40da50d5ba8143ce99cd65 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -56,6 +56,7 @@ public:
|
|||||||
virtual QList<QWidget *> toolBarWidgets() const;
|
virtual QList<QWidget *> toolBarWidgets() const;
|
||||||
virtual QString displayName() const = 0;
|
virtual QString displayName() const = 0;
|
||||||
virtual const QList<OutputWindow *> outputWindows() const { return {}; }
|
virtual const QList<OutputWindow *> outputWindows() const { return {}; }
|
||||||
|
virtual void ensureWindowVisible(OutputWindow *) { }
|
||||||
|
|
||||||
virtual int priorityInStatusBar() const = 0;
|
virtual int priorityInStatusBar() const = 0;
|
||||||
|
|
||||||
|
@@ -30,6 +30,7 @@
|
|||||||
#include "projectexplorericons.h"
|
#include "projectexplorericons.h"
|
||||||
#include "runcontrol.h"
|
#include "runcontrol.h"
|
||||||
#include "session.h"
|
#include "session.h"
|
||||||
|
#include "showoutputtaskhandler.h"
|
||||||
#include "windebuginterface.h"
|
#include "windebuginterface.h"
|
||||||
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
@@ -170,8 +171,11 @@ AppOutputPane::AppOutputPane() :
|
|||||||
m_stopButton(new QToolButton),
|
m_stopButton(new QToolButton),
|
||||||
m_attachButton(new QToolButton),
|
m_attachButton(new QToolButton),
|
||||||
m_settingsButton(new QToolButton),
|
m_settingsButton(new QToolButton),
|
||||||
m_formatterWidget(new QWidget)
|
m_formatterWidget(new QWidget),
|
||||||
|
m_handler(new ShowOutputTaskHandler(this))
|
||||||
{
|
{
|
||||||
|
ExtensionSystem::PluginManager::addObject(m_handler);
|
||||||
|
|
||||||
setObjectName("AppOutputPane"); // Used in valgrind engine
|
setObjectName("AppOutputPane"); // Used in valgrind engine
|
||||||
loadSettings();
|
loadSettings();
|
||||||
|
|
||||||
@@ -252,6 +256,8 @@ AppOutputPane::~AppOutputPane()
|
|||||||
delete rt.runControl;
|
delete rt.runControl;
|
||||||
}
|
}
|
||||||
delete m_mainWidget;
|
delete m_mainWidget;
|
||||||
|
ExtensionSystem::PluginManager::removeObject(m_handler);
|
||||||
|
delete m_handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
int AppOutputPane::currentIndex() const
|
int AppOutputPane::currentIndex() const
|
||||||
@@ -368,6 +374,21 @@ void AppOutputPane::updateFilter()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const QList<Core::OutputWindow *> AppOutputPane::outputWindows() const
|
||||||
|
{
|
||||||
|
QList<Core::OutputWindow *> windows;
|
||||||
|
for (const RunControlTab &tab : qAsConst(m_runControlTabs)) {
|
||||||
|
if (tab.window)
|
||||||
|
windows << tab.window;
|
||||||
|
}
|
||||||
|
return windows;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AppOutputPane::ensureWindowVisible(Core::OutputWindow *ow)
|
||||||
|
{
|
||||||
|
m_tabWidget->setCurrentWidget(ow);
|
||||||
|
}
|
||||||
|
|
||||||
void AppOutputPane::createNewOutputWindow(RunControl *rc)
|
void AppOutputPane::createNewOutputWindow(RunControl *rc)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(rc, return);
|
QTC_ASSERT(rc, return);
|
||||||
|
@@ -51,7 +51,9 @@ class Project;
|
|||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
|
class ShowOutputTaskHandler;
|
||||||
class TabWidget;
|
class TabWidget;
|
||||||
|
|
||||||
class AppOutputPane : public Core::IOutputPane
|
class AppOutputPane : public Core::IOutputPane
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -138,6 +140,8 @@ private:
|
|||||||
void handleOldOutput(Core::OutputWindow *window) const;
|
void handleOldOutput(Core::OutputWindow *window) const;
|
||||||
void updateCloseActions();
|
void updateCloseActions();
|
||||||
void updateFilter() override;
|
void updateFilter() override;
|
||||||
|
const QList<Core::OutputWindow *> outputWindows() const override;
|
||||||
|
void ensureWindowVisible(Core::OutputWindow *ow) override;
|
||||||
|
|
||||||
void loadSettings();
|
void loadSettings();
|
||||||
void storeSettings() const;
|
void storeSettings() const;
|
||||||
@@ -155,6 +159,7 @@ private:
|
|||||||
QToolButton *m_attachButton;
|
QToolButton *m_attachButton;
|
||||||
QToolButton * const m_settingsButton;
|
QToolButton * const m_settingsButton;
|
||||||
QWidget *m_formatterWidget;
|
QWidget *m_formatterWidget;
|
||||||
|
ShowOutputTaskHandler * const m_handler;
|
||||||
AppOutputSettings m_settings;
|
AppOutputSettings m_settings;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -55,6 +55,7 @@ void ShowOutputTaskHandler::handle(const Task &task)
|
|||||||
m_window->popup(Core::IOutputPane::Flags(Core::IOutputPane::ModeSwitch | Core::IOutputPane::WithFocus));
|
m_window->popup(Core::IOutputPane::Flags(Core::IOutputPane::ModeSwitch | Core::IOutputPane::WithFocus));
|
||||||
for (Core::OutputWindow * const ow : m_window->outputWindows()) {
|
for (Core::OutputWindow * const ow : m_window->outputWindows()) {
|
||||||
if (ow->knowsPositionOf(task.taskId)) {
|
if (ow->knowsPositionOf(task.taskId)) {
|
||||||
|
m_window->ensureWindowVisible(ow);
|
||||||
ow->showPositionOf(task.taskId);
|
ow->showPositionOf(task.taskId);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user