Log level for is now adjusted to allow display of Updater progress for release builds too

This commit is contained in:
Simon Rozman 2016-05-24 23:17:09 +02:00
parent de98129893
commit 5570a73895
2 changed files with 5 additions and 0 deletions

View File

@ -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);

View File

@ -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
};