forked from qt-creator/qt-creator
ProjectExplorer: Move some AppOutputPane related stuff
... closer to AppOutputPane. Change-Id: I6b6d6d8d7522e380b7c69efd6ec5d816ae0fb324 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
#include "projectexplorerconstants.h"
|
#include "projectexplorerconstants.h"
|
||||||
#include "projectexplorericons.h"
|
#include "projectexplorericons.h"
|
||||||
#include "projectexplorertr.h"
|
#include "projectexplorertr.h"
|
||||||
|
#include "projectmanager.h"
|
||||||
#include "runcontrol.h"
|
#include "runcontrol.h"
|
||||||
#include "showoutputtaskhandler.h"
|
#include "showoutputtaskhandler.h"
|
||||||
#include "windebuginterface.h"
|
#include "windebuginterface.h"
|
||||||
@@ -218,6 +219,8 @@ AppOutputPane::AppOutputPane() :
|
|||||||
|
|
||||||
connect(SessionManager::instance(), &SessionManager::aboutToUnloadSession,
|
connect(SessionManager::instance(), &SessionManager::aboutToUnloadSession,
|
||||||
this, &AppOutputPane::aboutToUnloadSession);
|
this, &AppOutputPane::aboutToUnloadSession);
|
||||||
|
connect(ProjectManager::instance(), &ProjectManager::projectRemoved,
|
||||||
|
this, &AppOutputPane::projectRemoved);
|
||||||
|
|
||||||
setupFilterUi("AppOutputPane.Filter");
|
setupFilterUi("AppOutputPane.Filter");
|
||||||
setFilteringEnabled(false);
|
setFilteringEnabled(false);
|
||||||
@@ -519,6 +522,26 @@ void AppOutputPane::setSettings(const AppOutputSettings &settings)
|
|||||||
updateFromSettings();
|
updateFromSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AppOutputPane::prepareRunControlStart(RunControl *runControl)
|
||||||
|
{
|
||||||
|
createNewOutputWindow(runControl);
|
||||||
|
flash(); // one flash for starting
|
||||||
|
showTabFor(runControl);
|
||||||
|
Id runMode = runControl->runMode();
|
||||||
|
const auto popupMode = runMode == Constants::NORMAL_RUN_MODE
|
||||||
|
? settings().runOutputMode
|
||||||
|
: runMode == Constants::DEBUG_RUN_MODE
|
||||||
|
? settings().debugOutputMode
|
||||||
|
: AppOutputPaneMode::FlashOnOutput;
|
||||||
|
setBehaviorOnOutput(runControl, popupMode);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AppOutputPane::showOutputPaneForRunControl(RunControl *runControl)
|
||||||
|
{
|
||||||
|
showTabFor(runControl);
|
||||||
|
popup(IOutputPane::NoModeSwitch | IOutputPane::WithFocus);
|
||||||
|
}
|
||||||
|
|
||||||
const AppOutputPaneMode kRunOutputModeDefault = AppOutputPaneMode::PopupOnFirstOutput;
|
const AppOutputPaneMode kRunOutputModeDefault = AppOutputPaneMode::PopupOnFirstOutput;
|
||||||
const AppOutputPaneMode kDebugOutputModeDefault = AppOutputPaneMode::FlashOnOutput;
|
const AppOutputPaneMode kDebugOutputModeDefault = AppOutputPaneMode::FlashOnOutput;
|
||||||
const bool kCleanOldOutputDefault = false;
|
const bool kCleanOldOutputDefault = false;
|
||||||
|
@@ -59,9 +59,7 @@ public:
|
|||||||
|
|
||||||
bool hasFilterContext() const override;
|
bool hasFilterContext() const override;
|
||||||
|
|
||||||
void createNewOutputWindow(RunControl *rc);
|
|
||||||
void showTabFor(RunControl *rc);
|
void showTabFor(RunControl *rc);
|
||||||
void setBehaviorOnOutput(RunControl *rc, AppOutputPaneMode mode);
|
|
||||||
|
|
||||||
bool aboutToClose() const;
|
bool aboutToClose() const;
|
||||||
void closeTabs(CloseTabMode mode);
|
void closeTabs(CloseTabMode mode);
|
||||||
@@ -69,12 +67,17 @@ public:
|
|||||||
QList<RunControl *> allRunControls() const;
|
QList<RunControl *> allRunControls() const;
|
||||||
|
|
||||||
// ApplicationOutput specifics
|
// ApplicationOutput specifics
|
||||||
void projectRemoved();
|
|
||||||
|
|
||||||
const AppOutputSettings &settings() const { return m_settings; }
|
const AppOutputSettings &settings() const { return m_settings; }
|
||||||
void setSettings(const AppOutputSettings &settings);
|
void setSettings(const AppOutputSettings &settings);
|
||||||
|
|
||||||
|
void prepareRunControlStart(RunControl *runControl);
|
||||||
|
void showOutputPaneForRunControl(RunControl *runControl);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void setBehaviorOnOutput(RunControl *rc, AppOutputPaneMode mode);
|
||||||
|
void projectRemoved();
|
||||||
|
|
||||||
|
void createNewOutputWindow(RunControl *rc);
|
||||||
void appendMessage(ProjectExplorer::RunControl *rc, const QString &out,
|
void appendMessage(ProjectExplorer::RunControl *rc, const QString &out,
|
||||||
Utils::OutputFormat format);
|
Utils::OutputFormat format);
|
||||||
void reRunRunControl();
|
void reRunRunControl();
|
||||||
|
@@ -470,7 +470,6 @@ public:
|
|||||||
|
|
||||||
void addToRecentProjects(const FilePath &filePath, const QString &displayName);
|
void addToRecentProjects(const FilePath &filePath, const QString &displayName);
|
||||||
void startRunControl(RunControl *runControl);
|
void startRunControl(RunControl *runControl);
|
||||||
void showOutputPaneForRunControl(RunControl *runControl);
|
|
||||||
|
|
||||||
void updateActions();
|
void updateActions();
|
||||||
void updateContext();
|
void updateContext();
|
||||||
@@ -920,9 +919,6 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
|
|||||||
|
|
||||||
ICore::addPreCloseListener([]() -> bool { return coreAboutToClose(); });
|
ICore::addPreCloseListener([]() -> bool { return coreAboutToClose(); });
|
||||||
|
|
||||||
connect(ProjectManager::instance(), &ProjectManager::projectRemoved,
|
|
||||||
&dd->m_outputPane, &AppOutputPane::projectRemoved);
|
|
||||||
|
|
||||||
// ProjectPanelFactories
|
// ProjectPanelFactories
|
||||||
|
|
||||||
setupEditorSettingsProjectPanel();
|
setupEditorSettingsProjectPanel();
|
||||||
@@ -2463,7 +2459,7 @@ void ProjectExplorerPlugin::startRunControl(RunControl *runControl)
|
|||||||
|
|
||||||
void ProjectExplorerPlugin::showOutputPaneForRunControl(RunControl *runControl)
|
void ProjectExplorerPlugin::showOutputPaneForRunControl(RunControl *runControl)
|
||||||
{
|
{
|
||||||
dd->showOutputPaneForRunControl(runControl);
|
dd->m_outputPane.showOutputPaneForRunControl(runControl);
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<std::pair<FilePath, FilePath>> ProjectExplorerPlugin::renameFiles(
|
QList<std::pair<FilePath, FilePath>> ProjectExplorerPlugin::renameFiles(
|
||||||
@@ -2498,16 +2494,7 @@ bool ProjectExplorerPlugin::renameFile(const Utils::FilePath &source, const Util
|
|||||||
|
|
||||||
void ProjectExplorerPluginPrivate::startRunControl(RunControl *runControl)
|
void ProjectExplorerPluginPrivate::startRunControl(RunControl *runControl)
|
||||||
{
|
{
|
||||||
m_outputPane.createNewOutputWindow(runControl);
|
m_outputPane.prepareRunControlStart(runControl);
|
||||||
m_outputPane.flash(); // one flash for starting
|
|
||||||
m_outputPane.showTabFor(runControl);
|
|
||||||
Id runMode = runControl->runMode();
|
|
||||||
const auto popupMode = runMode == Constants::NORMAL_RUN_MODE
|
|
||||||
? m_outputPane.settings().runOutputMode
|
|
||||||
: runMode == Constants::DEBUG_RUN_MODE
|
|
||||||
? m_outputPane.settings().debugOutputMode
|
|
||||||
: AppOutputPaneMode::FlashOnOutput;
|
|
||||||
m_outputPane.setBehaviorOnOutput(runControl, popupMode);
|
|
||||||
connect(runControl, &QObject::destroyed, this, &ProjectExplorerPluginPrivate::checkForShutdown,
|
connect(runControl, &QObject::destroyed, this, &ProjectExplorerPluginPrivate::checkForShutdown,
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
++m_activeRunControlCount;
|
++m_activeRunControlCount;
|
||||||
@@ -2521,12 +2508,6 @@ void ProjectExplorerPluginPrivate::startRunControl(RunControl *runControl)
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProjectExplorerPluginPrivate::showOutputPaneForRunControl(RunControl *runControl)
|
|
||||||
{
|
|
||||||
m_outputPane.showTabFor(runControl);
|
|
||||||
m_outputPane.popup(IOutputPane::NoModeSwitch | IOutputPane::WithFocus);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ProjectExplorerPluginPrivate::checkForShutdown()
|
void ProjectExplorerPluginPrivate::checkForShutdown()
|
||||||
{
|
{
|
||||||
--m_activeRunControlCount;
|
--m_activeRunControlCount;
|
||||||
|
Reference in New Issue
Block a user