Log level for is now adjusted to allow display of Updater progress for release builds too
This commit is contained in:
parent
de98129893
commit
5570a73895
@ -25,12 +25,15 @@
|
|||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
wxZRColaUpdater::wxZRColaUpdater(wxWindow* parent) :
|
wxZRColaUpdater::wxZRColaUpdater(wxWindow* parent) :
|
||||||
|
m_logLevelOrig(wxLOG_Warning),
|
||||||
m_logOrig(NULL),
|
m_logOrig(NULL),
|
||||||
m_updater(NULL),
|
m_updater(NULL),
|
||||||
wxZRColaUpdaterBase(parent)
|
wxZRColaUpdaterBase(parent)
|
||||||
{
|
{
|
||||||
// Setup logging.
|
// Setup logging.
|
||||||
m_logOrig = wxLog::SetActiveTarget(new wxLogTextCtrl(m_log));
|
m_logOrig = wxLog::SetActiveTarget(new wxLogTextCtrl(m_log));
|
||||||
|
m_logLevelOrig = wxLog::GetLogLevel();
|
||||||
|
wxLog::SetLogLevel(wxLOG_Info);
|
||||||
|
|
||||||
// Connect events.
|
// Connect events.
|
||||||
Connect(wxID_ANY, wxEVT_UPDATER_CHECK_COMPLETE, wxThreadEventHandler(wxZRColaUpdater::OnCheckComplete), NULL, this);
|
Connect(wxID_ANY, wxEVT_UPDATER_CHECK_COMPLETE, wxThreadEventHandler(wxZRColaUpdater::OnCheckComplete), NULL, this);
|
||||||
@ -56,6 +59,7 @@ wxZRColaUpdater::~wxZRColaUpdater()
|
|||||||
// Disconnect events.
|
// Disconnect events.
|
||||||
Disconnect(wxID_ANY, wxEVT_UPDATER_CHECK_COMPLETE, wxThreadEventHandler(wxZRColaUpdater::OnCheckComplete), NULL, this);
|
Disconnect(wxID_ANY, wxEVT_UPDATER_CHECK_COMPLETE, wxThreadEventHandler(wxZRColaUpdater::OnCheckComplete), NULL, this);
|
||||||
|
|
||||||
|
wxLog::SetLogLevel(m_logLevelOrig);
|
||||||
if (m_logOrig) {
|
if (m_logOrig) {
|
||||||
// Return logging to previous state.
|
// Return logging to previous state.
|
||||||
delete wxLog::SetActiveTarget(m_logOrig);
|
delete wxLog::SetActiveTarget(m_logOrig);
|
||||||
|
@ -46,6 +46,7 @@ protected:
|
|||||||
virtual void OnUpdate(wxCommandEvent& event);
|
virtual void OnUpdate(wxCommandEvent& event);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
wxLogLevel m_logLevelOrig; ///< Original log level
|
||||||
wxLog *m_logOrig; ///< Original log
|
wxLog *m_logOrig; ///< Original log
|
||||||
wxUpdCheckThread *m_updater; ///< Updater thread
|
wxUpdCheckThread *m_updater; ///< Updater thread
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user