Additional change for r940.

This commit is contained in:
Birunthan Mohanathas 2011-09-08 15:37:33 +00:00
parent 8b605c8fc5
commit 2e9f063cef
2 changed files with 11 additions and 9 deletions

View File

@ -95,7 +95,15 @@ void CDialogAbout::Open(int tab)
void CDialogAbout::AddLogItem(int level, LPCWSTR time, LPCWSTR message)
{
if (c_Dialog && c_Dialog->m_TabLog && c_Dialog->m_TabLog->IsInitialized())
if (!c_Dialog)
{
if (level == LOG_ERROR)
{
// Open About Log window for errors
CDialogAbout::Open();
}
}
else if (c_Dialog->m_TabLog && c_Dialog->m_TabLog->IsInitialized())
{
c_Dialog->m_TabLog->AddItem(level, time, message);
}

View File

@ -3079,8 +3079,8 @@ BOOL CRainmeter::ExecuteBang(const std::wstring& bang, const std::wstring& arg,
}
else
{
std::wstring error = L"Unknown !bang: " + bang;
MessageBox(NULL, error.c_str(), APPNAME, MB_OK | MB_TOPMOST | MB_ICONEXCLAMATION);
std::wstring error = L"Unknown bang: " + bang;
Log(LOG_ERROR, error.c_str());
return FALSE;
}
@ -4350,12 +4350,6 @@ void CRainmeter::DeleteLogFile()
void CRainmeter::AddAboutLogInfo(int level, LPCWSTR time, LPCWSTR message)
{
if (level == LOG_ERROR)
{
// Open About Log window for errors
CDialogAbout::Open();
}
// Store 20 last items
LOG_INFO logInfo = {level, time, message};
m_LogData.push_back(logInfo);