diff --git a/Library/DialogAbout.cpp b/Library/DialogAbout.cpp index 627f46b9..5208ba9d 100644 --- a/Library/DialogAbout.cpp +++ b/Library/DialogAbout.cpp @@ -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); } diff --git a/Library/Rainmeter.cpp b/Library/Rainmeter.cpp index 7c7cbeb3..bba3724c 100644 --- a/Library/Rainmeter.cpp +++ b/Library/Rainmeter.cpp @@ -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);