From 5570a738956ac8b0cea2b3cd90eebcbe9b823bd1 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 24 May 2016 23:17:09 +0200 Subject: [PATCH] Log level for is now adjusted to allow display of Updater progress for release builds too --- ZRCola/zrcolaupdater.cpp | 4 ++++ ZRCola/zrcolaupdater.h | 1 + 2 files changed, 5 insertions(+) diff --git a/ZRCola/zrcolaupdater.cpp b/ZRCola/zrcolaupdater.cpp index b9a757a..cb38947 100644 --- a/ZRCola/zrcolaupdater.cpp +++ b/ZRCola/zrcolaupdater.cpp @@ -25,12 +25,15 @@ ////////////////////////////////////////////////////////////////////////// wxZRColaUpdater::wxZRColaUpdater(wxWindow* parent) : + m_logLevelOrig(wxLOG_Warning), m_logOrig(NULL), m_updater(NULL), wxZRColaUpdaterBase(parent) { // Setup logging. m_logOrig = wxLog::SetActiveTarget(new wxLogTextCtrl(m_log)); + m_logLevelOrig = wxLog::GetLogLevel(); + wxLog::SetLogLevel(wxLOG_Info); // Connect events. Connect(wxID_ANY, wxEVT_UPDATER_CHECK_COMPLETE, wxThreadEventHandler(wxZRColaUpdater::OnCheckComplete), NULL, this); @@ -56,6 +59,7 @@ wxZRColaUpdater::~wxZRColaUpdater() // Disconnect events. Disconnect(wxID_ANY, wxEVT_UPDATER_CHECK_COMPLETE, wxThreadEventHandler(wxZRColaUpdater::OnCheckComplete), NULL, this); + wxLog::SetLogLevel(m_logLevelOrig); if (m_logOrig) { // Return logging to previous state. delete wxLog::SetActiveTarget(m_logOrig); diff --git a/ZRCola/zrcolaupdater.h b/ZRCola/zrcolaupdater.h index 946b165..9a180e0 100644 --- a/ZRCola/zrcolaupdater.h +++ b/ZRCola/zrcolaupdater.h @@ -46,6 +46,7 @@ protected: virtual void OnUpdate(wxCommandEvent& event); protected: + wxLogLevel m_logLevelOrig; ///< Original log level wxLog *m_logOrig; ///< Original log wxUpdCheckThread *m_updater; ///< Updater thread };