From bbf320ecfeb798edac97b226c92af1487a942428 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Sun, 15 Jun 2014 16:38:51 -0400 Subject: [PATCH] Debugger: UserInterface enhancements. Add hook to UserInterface to query if Debugger is currently being run interactively or not. Add corresponding implementations in {CommandLine,Graphical}UserInterface. --- src/apps/debugger/user_interface/UserInterface.h | 2 ++ .../user_interface/cli/CommandLineUserInterface.cpp | 9 +++++++++ .../user_interface/cli/CommandLineUserInterface.h | 2 ++ .../user_interface/gui/GraphicalUserInterface.cpp | 7 +++++++ .../debugger/user_interface/gui/GraphicalUserInterface.h | 2 ++ 5 files changed, 22 insertions(+) diff --git a/src/apps/debugger/user_interface/UserInterface.h b/src/apps/debugger/user_interface/UserInterface.h index 67fa804b8f..5eb9c2be49 100644 --- a/src/apps/debugger/user_interface/UserInterface.h +++ b/src/apps/debugger/user_interface/UserInterface.h @@ -53,6 +53,8 @@ public: // shut down the UI *now* -- no more user // feedback + virtual bool IsInteractive() const = 0; + virtual status_t LoadSettings(const TeamUiSettings* settings) = 0; virtual status_t SaveSettings(TeamUiSettings*& settings) diff --git a/src/apps/debugger/user_interface/cli/CommandLineUserInterface.cpp b/src/apps/debugger/user_interface/cli/CommandLineUserInterface.cpp index 33a467fdb1..5494b24b12 100644 --- a/src/apps/debugger/user_interface/cli/CommandLineUserInterface.cpp +++ b/src/apps/debugger/user_interface/cli/CommandLineUserInterface.cpp @@ -171,6 +171,15 @@ CommandLineUserInterface::Terminate() } +bool +CommandLineUserInterface::IsInteractive() const +{ + // if we were invoked solely for the purpose of saving a crash report, + // then we're not taking user input into account. + return !fSaveReport; +} + + status_t CommandLineUserInterface::LoadSettings(const TeamUiSettings* settings) { diff --git a/src/apps/debugger/user_interface/cli/CommandLineUserInterface.h b/src/apps/debugger/user_interface/cli/CommandLineUserInterface.h index b89e634047..85dffcd3a7 100644 --- a/src/apps/debugger/user_interface/cli/CommandLineUserInterface.h +++ b/src/apps/debugger/user_interface/cli/CommandLineUserInterface.h @@ -34,6 +34,8 @@ public: // shut down the UI *now* -- no more user // feedback + virtual bool IsInteractive() const; + virtual status_t LoadSettings(const TeamUiSettings* settings); virtual status_t SaveSettings(TeamUiSettings*& settings) const; diff --git a/src/apps/debugger/user_interface/gui/GraphicalUserInterface.cpp b/src/apps/debugger/user_interface/gui/GraphicalUserInterface.cpp index 854c60e1b8..8daac7f774 100644 --- a/src/apps/debugger/user_interface/gui/GraphicalUserInterface.cpp +++ b/src/apps/debugger/user_interface/gui/GraphicalUserInterface.cpp @@ -191,6 +191,13 @@ GraphicalUserInterface::Terminate() } +bool +GraphicalUserInterface::IsInteractive() const +{ + return true; +} + + status_t GraphicalUserInterface::LoadSettings(const TeamUiSettings* settings) { diff --git a/src/apps/debugger/user_interface/gui/GraphicalUserInterface.h b/src/apps/debugger/user_interface/gui/GraphicalUserInterface.h index ef79cfd160..59ec0292a3 100644 --- a/src/apps/debugger/user_interface/gui/GraphicalUserInterface.h +++ b/src/apps/debugger/user_interface/gui/GraphicalUserInterface.h @@ -30,6 +30,8 @@ public: // shut down the UI *now* -- no more user // feedback + virtual bool IsInteractive() const; + virtual status_t LoadSettings(const TeamUiSettings* settings); virtual status_t SaveSettings(TeamUiSettings*& settings) const;