From ff283ff912fab0f7a6abfd0f98256e112e8dba88 Mon Sep 17 00:00:00 2001 From: spycrab Date: Tue, 19 Sep 2017 14:14:45 +0200 Subject: [PATCH] Qt/Settings: Add debug mode flag --- Source/Core/DolphinQt2/Main.cpp | 1 + Source/Core/DolphinQt2/Settings.cpp | 14 ++++++++++++++ Source/Core/DolphinQt2/Settings.h | 7 ++++++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Source/Core/DolphinQt2/Main.cpp b/Source/Core/DolphinQt2/Main.cpp index 8b29f6590c..b1616a30ab 100644 --- a/Source/Core/DolphinQt2/Main.cpp +++ b/Source/Core/DolphinQt2/Main.cpp @@ -73,6 +73,7 @@ int main(int argc, char* argv[]) UICommon::CreateDirectories(); UICommon::Init(); Resources::Init(); + Settings::Instance().SetDebugModeEnabled(options.is_set("debugger")); // Hook up alerts from core RegisterMsgAlertHandler(QtMsgAlertHandler); diff --git a/Source/Core/DolphinQt2/Settings.cpp b/Source/Core/DolphinQt2/Settings.cpp index 53178baa16..30dbde00d8 100644 --- a/Source/Core/DolphinQt2/Settings.cpp +++ b/Source/Core/DolphinQt2/Settings.cpp @@ -196,3 +196,17 @@ void Settings::SetCheatsEnabled(bool enabled) emit EnableCheatsChanged(enabled); } } + +void Settings::SetDebugModeEnabled(bool enabled) +{ + if (IsDebugModeEnabled() != enabled) + { + SConfig::GetInstance().bEnableDebugging = enabled; + emit DebugModeToggled(enabled); + } +} + +bool Settings::IsDebugModeEnabled() const +{ + return SConfig::GetInstance().bEnableDebugging; +} diff --git a/Source/Core/DolphinQt2/Settings.h b/Source/Core/DolphinQt2/Settings.h index 4177fe6b77..4ab31ad2cc 100644 --- a/Source/Core/DolphinQt2/Settings.h +++ b/Source/Core/DolphinQt2/Settings.h @@ -78,9 +78,12 @@ public: bool GetCheatsEnabled() const; void SetCheatsEnabled(bool enabled); + // Debug + void SetDebugModeEnabled(bool enabled); + bool IsDebugModeEnabled() const; + // Other GameListModel* GetGameListModel() const; - signals: void ConfigChanged(); void EmulationStateChanged(Core::State new_state); @@ -93,8 +96,10 @@ signals: void LogVisibilityChanged(bool visible); void LogConfigVisibilityChanged(bool visible); void EnableCheatsChanged(bool enabled); + void DebugModeToggled(bool enabled); private: + bool m_registers_visible = false; std::unique_ptr m_client; std::unique_ptr m_server; Settings();