forked from qt-creator/qt-creator
ProjectExplorer: Move AppOutputPaneSettings closer to AppOutputPane
And make CloseTabMode private. Change-Id: Ia53fb6d06da59e8fe66020194b6b670868ef83e4 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "projectexplorer.h"
|
||||
#include "projectexplorerconstants.h"
|
||||
#include "projectexplorericons.h"
|
||||
#include "projectexplorersettings.h"
|
||||
#include "projectexplorertr.h"
|
||||
#include "projectmanager.h"
|
||||
#include "runcontrol.h"
|
||||
@@ -542,6 +543,11 @@ void AppOutputPane::showOutputPaneForRunControl(RunControl *runControl)
|
||||
popup(IOutputPane::NoModeSwitch | IOutputPane::WithFocus);
|
||||
}
|
||||
|
||||
void AppOutputPane::closeTabsWithoutPrompt()
|
||||
{
|
||||
closeTabs(CloseTabNoPrompt);
|
||||
}
|
||||
|
||||
const AppOutputPaneMode kRunOutputModeDefault = AppOutputPaneMode::PopupOnFirstOutput;
|
||||
const AppOutputPaneMode kDebugOutputModeDefault = AppOutputPaneMode::FlashOnOutput;
|
||||
const bool kCleanOldOutputDefault = false;
|
||||
|
@@ -3,10 +3,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "projectexplorersettings.h"
|
||||
|
||||
#include <coreplugin/ioutputpane.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/dialogs/ioptionspage.h>
|
||||
#include <coreplugin/ioutputpane.h>
|
||||
|
||||
#include <utils/outputformat.h>
|
||||
|
||||
@@ -30,19 +29,26 @@ namespace Internal {
|
||||
class ShowOutputTaskHandler;
|
||||
class TabWidget;
|
||||
|
||||
enum class AppOutputPaneMode { FlashOnOutput, PopupOnOutput, PopupOnFirstOutput };
|
||||
|
||||
class AppOutputSettings
|
||||
{
|
||||
public:
|
||||
AppOutputPaneMode runOutputMode = AppOutputPaneMode::PopupOnFirstOutput;
|
||||
AppOutputPaneMode debugOutputMode = AppOutputPaneMode::FlashOnOutput;
|
||||
bool cleanOldOutput = false;
|
||||
bool mergeChannels = false;
|
||||
bool wrapOutput = false;
|
||||
int maxCharCount = Core::Constants::DEFAULT_MAX_CHAR_COUNT;
|
||||
};
|
||||
|
||||
class AppOutputPane final : public Core::IOutputPane
|
||||
{
|
||||
public:
|
||||
enum CloseTabMode {
|
||||
CloseTabNoPrompt,
|
||||
CloseTabWithPrompt
|
||||
};
|
||||
|
||||
AppOutputPane();
|
||||
~AppOutputPane() final;
|
||||
|
||||
bool aboutToClose() const;
|
||||
void closeTabs(CloseTabMode mode);
|
||||
|
||||
QList<RunControl *> allRunControls() const;
|
||||
|
||||
@@ -52,7 +58,15 @@ public:
|
||||
void prepareRunControlStart(RunControl *runControl);
|
||||
void showOutputPaneForRunControl(RunControl *runControl);
|
||||
|
||||
void closeTabsWithoutPrompt();
|
||||
|
||||
private:
|
||||
enum CloseTabMode {
|
||||
CloseTabNoPrompt,
|
||||
CloseTabWithPrompt
|
||||
};
|
||||
|
||||
void closeTabs(CloseTabMode mode);
|
||||
void showTabFor(RunControl *rc);
|
||||
|
||||
void setBehaviorOnOutput(RunControl *rc, AppOutputPaneMode mode);
|
||||
|
@@ -2155,7 +2155,7 @@ IPlugin::ShutdownFlag ProjectExplorerPlugin::aboutToShutdown()
|
||||
if (dd->m_activeRunControlCount == 0)
|
||||
return SynchronousShutdown;
|
||||
|
||||
dd->m_outputPane.closeTabs(AppOutputPane::CloseTabNoPrompt /* No prompt any more */);
|
||||
dd->m_outputPane.closeTabsWithoutPrompt();
|
||||
dd->m_shutdownWatchDogId = dd->startTimer(10 * 1000); // Make sure we shutdown *somehow*
|
||||
return AsynchronousShutdown;
|
||||
}
|
||||
|
@@ -55,19 +55,6 @@ namespace Internal {
|
||||
void setPromptToStopSettings(bool promptToStop); // FIXME: Remove.
|
||||
void setSaveBeforeBuildSettings(bool saveBeforeBuild); // FIXME: Remove.
|
||||
|
||||
enum class AppOutputPaneMode { FlashOnOutput, PopupOnOutput, PopupOnFirstOutput };
|
||||
|
||||
class AppOutputSettings
|
||||
{
|
||||
public:
|
||||
AppOutputPaneMode runOutputMode = AppOutputPaneMode::PopupOnFirstOutput;
|
||||
AppOutputPaneMode debugOutputMode = AppOutputPaneMode::FlashOnOutput;
|
||||
bool cleanOldOutput = false;
|
||||
bool mergeChannels = false;
|
||||
bool wrapOutput = false;
|
||||
int maxCharCount = Core::Constants::DEFAULT_MAX_CHAR_COUNT;
|
||||
};
|
||||
|
||||
void setupProjectExplorerSettings();
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "runcontrol.h"
|
||||
|
||||
#include "appoutputpane.h"
|
||||
#include "buildconfiguration.h"
|
||||
#include "customparser.h"
|
||||
#include "devicesupport/devicemanager.h"
|
||||
|
Reference in New Issue
Block a user