From ff83b13344b81f4015267c1d41145a12ac07a8a0 Mon Sep 17 00:00:00 2001 From: Michael Maltese Date: Sun, 9 Jul 2017 18:35:40 -0700 Subject: [PATCH 1/2] LogConfigWindow: fix verbosity --- Source/Core/DolphinWX/LogConfigWindow.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/Core/DolphinWX/LogConfigWindow.cpp b/Source/Core/DolphinWX/LogConfigWindow.cpp index b11c3abefa..c6a733a2a0 100644 --- a/Source/Core/DolphinWX/LogConfigWindow.cpp +++ b/Source/Core/DolphinWX/LogConfigWindow.cpp @@ -89,7 +89,7 @@ void LogConfigWindow::CreateGUIControls() void LogConfigWindow::LoadSettings() { - m_verbosity->SetSelection(m_LogManager->GetLogLevel()); + m_verbosity->SetSelection(m_LogManager->GetLogLevel() - 1); // Get the logger output settings from the config ini file. m_writeFileCB->SetValue(m_LogManager->IsListenerEnabled(LogListener::FILE_LISTENER)); @@ -117,8 +117,7 @@ void LogConfigWindow::SaveSettings() // If the verbosity changes while logging void LogConfigWindow::OnVerbosityChange(wxCommandEvent& event) { - int v = m_verbosity->GetSelection() + 1; - m_LogManager->SetLogLevel(static_cast(v)); + m_LogManager->SetLogLevel(static_cast(m_verbosity->GetSelection() + 1)); event.Skip(); } From 06f1761f9ff5a1deabfe744b78eb13e9760b178a Mon Sep 17 00:00:00 2001 From: Michael Maltese Date: Sun, 9 Jul 2017 18:36:22 -0700 Subject: [PATCH 2/2] LogWindow: don't unconfigure logger on destruction This was causing Dolphin to always save "WriteToWindow = False". Instead of disabling logging to the window (a config value), tell LogManager that there's no window to log to (a runtime state). --- Source/Core/DolphinWX/LogWindow.cpp | 6 +----- Source/Core/DolphinWX/LogWindow.h | 1 - 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/Source/Core/DolphinWX/LogWindow.cpp b/Source/Core/DolphinWX/LogWindow.cpp index 3de0469f30..7a716ebc21 100644 --- a/Source/Core/DolphinWX/LogWindow.cpp +++ b/Source/Core/DolphinWX/LogWindow.cpp @@ -129,11 +129,7 @@ CLogWindow::~CLogWindow() void CLogWindow::RemoveAllListeners() { - if (!m_has_listeners) - return; - m_has_listeners = false; - - m_LogManager->EnableListener(LogListener::LOG_WINDOW_LISTENER, false); + m_LogManager->RegisterListener(LogListener::LOG_WINDOW_LISTENER, nullptr); } void CLogWindow::SaveSettings() diff --git a/Source/Core/DolphinWX/LogWindow.h b/Source/Core/DolphinWX/LogWindow.h index 65b98a8b2b..9157288b66 100644 --- a/Source/Core/DolphinWX/LogWindow.h +++ b/Source/Core/DolphinWX/LogWindow.h @@ -46,7 +46,6 @@ private: LogManager* m_LogManager; std::queue> msgQueue; bool m_LogAccess; - bool m_has_listeners = true; // Controls wxBoxSizer* sBottom;