forked from qt-creator/qt-creator
Terminal: Add enable setting
Change-Id: I13cca8b2d4c55df7db29807c1252718e2819ea0b Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -37,7 +37,7 @@ private:
|
||||
};
|
||||
|
||||
namespace Terminal {
|
||||
struct HooksPrivate;
|
||||
class HooksPrivate;
|
||||
|
||||
enum class ExitBehavior { Close, Restart, Keep };
|
||||
|
||||
@@ -61,18 +61,29 @@ QTCREATOR_UTILS_EXPORT FilePath defaultShellForDevice(const FilePath &deviceRoot
|
||||
class QTCREATOR_UTILS_EXPORT Hooks
|
||||
{
|
||||
public:
|
||||
using OpenTerminalHook = Hook<void, const OpenTerminalParameters &>;
|
||||
using CreateTerminalProcessInterfaceHook = Hook<ProcessInterface *>;
|
||||
using OpenTerminal = std::function<void(const OpenTerminalParameters &)>;
|
||||
using CreateTerminalProcessInterface = std::function<ProcessInterface *()>;
|
||||
|
||||
struct CallbackSet
|
||||
{
|
||||
OpenTerminal openTerminal;
|
||||
CreateTerminalProcessInterface createTerminalProcessInterface;
|
||||
};
|
||||
|
||||
using GetTerminalCommandsForDevicesHook = Hook<QList<NameAndCommandLine>>;
|
||||
|
||||
public:
|
||||
static Hooks &instance();
|
||||
~Hooks();
|
||||
|
||||
OpenTerminalHook &openTerminalHook();
|
||||
CreateTerminalProcessInterfaceHook &createTerminalProcessInterfaceHook();
|
||||
GetTerminalCommandsForDevicesHook &getTerminalCommandsForDevicesHook();
|
||||
|
||||
void openTerminal(const OpenTerminalParameters ¶meters) const;
|
||||
ProcessInterface *createTerminalProcessInterface() const;
|
||||
|
||||
void addCallbackSet(const QString &name, const CallbackSet &callbackSet);
|
||||
void removeCallbackSet(const QString &name);
|
||||
|
||||
private:
|
||||
Hooks();
|
||||
std::unique_ptr<HooksPrivate> d;
|
||||
|
||||
Reference in New Issue
Block a user