From e618ad1777e675765aee5f299bd16f5aa67326b5 Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Tue, 21 Sep 2010 11:09:36 +0000 Subject: [PATCH] Cosmetic changes here and there. --- Application/Application.cpp | 4 +-- Library/ConfigParser.cpp | 2 +- Library/Measure.cpp | 2 +- Library/MeasurePlugin.cpp | 2 +- Library/MeterWindow.cpp | 18 ++++++------- Library/Rainmeter.cpp | 26 +++++++++---------- Plugins/PluginPerfMon/PerfData.cpp | 2 +- Plugins/PluginPing/Ping.cpp | 2 +- .../PluginRecycleManager/RecycleManager.cpp | 2 +- Plugins/PluginResMon/ResMon.cpp | 2 +- Plugins/PluginSpeedFan/SpeedFanPlugin.cpp | 4 +-- Plugins/PluginSysInfo/SysInfo.cpp | 6 ++--- Plugins/PluginWifiStatus/WifiStatus.cpp | 1 + 13 files changed, 37 insertions(+), 36 deletions(-) diff --git a/Application/Application.cpp b/Application/Application.cpp index 60cf9cd0..11e89e1c 100644 --- a/Application/Application.cpp +++ b/Application/Application.cpp @@ -122,7 +122,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmd HMODULE module = GetModuleHandle(L"Rainmeter.dll"); if(module == NULL) { - MessageBox(NULL, L"Unable to load Rainmeter.dll", L"Rainmeter", MB_OK); + MessageBox(NULL, L"Unable to load Rainmeter.dll", L"Rainmeter", MB_OK | MB_TOPMOST | MB_ICONERROR); return 0; } @@ -222,7 +222,7 @@ void Bang(const WCHAR* command) { if (_wcsicmp(L"!rainmeterquit", command) != 0) { - MessageBox(NULL, L"Rainmeter is not running.\nUnable to send the !bang to it.", L"Rainmeter", MB_OK); + MessageBox(NULL, L"Rainmeter is not running.\nUnable to send the !bang to it.", L"Rainmeter", MB_OK | MB_TOPMOST | MB_ICONERROR); } } } diff --git a/Library/ConfigParser.cpp b/Library/ConfigParser.cpp index 0599e9d7..7f92a5e4 100644 --- a/Library/ConfigParser.cpp +++ b/Library/ConfigParser.cpp @@ -924,7 +924,7 @@ void CConfigParser::ReadIniFile(const std::vector& iniFileMappings { if (depth > 100) // Is 100 enough to assume the include loop never ends? { - MessageBox(NULL, L"It looks like you've made an infinite\nloop with the @include statements.\nPlease check your skin.", L"Rainmeter", MB_OK | MB_ICONERROR); + MessageBox(NULL, L"It looks like you've made an infinite\nloop with the @include statements.\nPlease check your skin.", L"Rainmeter", MB_OK | MB_TOPMOST | MB_ICONERROR); return; } diff --git a/Library/Measure.cpp b/Library/Measure.cpp index c914713e..0f9963b0 100644 --- a/Library/Measure.cpp +++ b/Library/Measure.cpp @@ -692,5 +692,5 @@ CMeasure* CMeasure::Create(const WCHAR* measure, CMeterWindow* meterWindow) */ void CMeasure::ExecuteBang(const WCHAR* args) { - DebugLog(L"[%s] Doesn't support this bang: %s", m_Name.c_str(), args); + DebugLog(L"[%s] doesn't support this bang: %s", m_Name.c_str(), args); } diff --git a/Library/MeasurePlugin.cpp b/Library/MeasurePlugin.cpp index 39c06be9..e6fc3709 100644 --- a/Library/MeasurePlugin.cpp +++ b/Library/MeasurePlugin.cpp @@ -230,6 +230,6 @@ void CMeasurePlugin::ExecuteBang(const WCHAR* args) } else { - DebugLog(L"[%s] Doesn't support bangs.", m_Name.c_str()); + DebugLog(L"[%s] doesn't support bangs.", m_Name.c_str()); } } \ No newline at end of file diff --git a/Library/MeterWindow.cpp b/Library/MeterWindow.cpp index 3214c662..16ddac22 100644 --- a/Library/MeterWindow.cpp +++ b/Library/MeterWindow.cpp @@ -308,9 +308,9 @@ void CMeterWindow::Refresh(bool init, bool all) m_Rainmeter->SetCurrentParser(&m_Parser); - std::wstring dbg = L"Refreshing (Name: \"" + m_SkinName; - dbg += L"\" Ini: \"" + m_SkinIniFile; - dbg += L"\")"; + std::wstring dbg = L"Refreshing skin \"" + m_SkinName; + dbg += L"\\" + m_SkinIniFile; + dbg += L"\""; LSLog(LOG_DEBUG, L"Rainmeter", dbg.c_str()); m_Refreshing = true; @@ -765,7 +765,7 @@ void CMeterWindow::RunBang(BANGCOMMAND bang, const WCHAR* arg) } else { - DebugLog(L"Cannot parse parameters for !RainmeterMove"); + DebugLog(L"Unable to parse parameters for !RainmeterMove"); } break; @@ -861,7 +861,7 @@ void CMeterWindow::RunBang(BANGCOMMAND bang, const WCHAR* arg) } else { - DebugLog(L"Cannot parse parameters for !RainmeterLsBoxHook (%s)", arg); + DebugLog(L"Unable to parse parameters for !RainmeterLsBoxHook (%s)", arg); } } break; @@ -877,12 +877,12 @@ void CMeterWindow::RunBang(BANGCOMMAND bang, const WCHAR* arg) } else { - DebugLog(L"Cannot parse the for !RainmeterMoveMeter"); + DebugLog(L"Unable to parse coordinates for !RainmeterMoveMeter"); } } else { - DebugLog(L"Cannot parse the coordinates for !RainmeterMoveMeter"); + DebugLog(L"Unable to parse parameters for !RainmeterMoveMeter"); } break; @@ -924,7 +924,7 @@ void CMeterWindow::RunBang(BANGCOMMAND bang, const WCHAR* arg) } else { - DebugLog(L"Cannot parse the !RainmeterPluginBang"); + DebugLog(L"Unable to parse parameters for !RainmeterPluginBang"); } } break; @@ -955,7 +955,7 @@ void CMeterWindow::RunBang(BANGCOMMAND bang, const WCHAR* arg) } else { - DebugLog(L"Cannot parse parameters for !RainmeterSetVariable"); + DebugLog(L"Unable to parse parameters for !RainmeterSetVariable"); } break; } diff --git a/Library/Rainmeter.cpp b/Library/Rainmeter.cpp index 919d9f1f..e7af6f94 100644 --- a/Library/Rainmeter.cpp +++ b/Library/Rainmeter.cpp @@ -1493,7 +1493,7 @@ int CRainmeter::Initialize(HWND Parent, HINSTANCE Instance, LPCSTR szPath) if (c_Debug) { - LSLog(LOG_DEBUG, APPNAME, L"Enumerating installed font families ..."); + LSLog(LOG_DEBUG, APPNAME, L"Enumerating installed font families..."); CMeterString::EnumerateInstalledFontFamilies(); } @@ -1506,7 +1506,7 @@ int CRainmeter::Initialize(HWND Parent, HINSTANCE Instance, LPCSTR szPath) if(m_ConfigStrings.empty()) { std::wstring error = L"There are no available skins at:\n" + m_SkinPath; - MessageBox(NULL, error.c_str(), APPNAME, MB_OK | MB_ICONERROR); + MessageBox(NULL, error.c_str(), APPNAME, MB_OK | MB_TOPMOST | MB_ICONERROR); } ReadGeneralSettings(m_IniFile); @@ -1708,13 +1708,13 @@ void CRainmeter::CheckSkinVersions() else { std::wstring strMessage = L"Failed to upgrade the config.\nUnable to backup the current config."; - MessageBox(NULL, strMessage.c_str(), APPNAME, MB_OK | MB_ICONERROR); + MessageBox(NULL, strMessage.c_str(), APPNAME, MB_OK | MB_TOPMOST | MB_ICONERROR); } } else { std::wstring strMessage = L"Failed to upgrade the config.\nThe version number contains illegal characters."; - MessageBox(NULL, strMessage.c_str(), APPNAME, MB_OK | MB_ICONERROR); + MessageBox(NULL, strMessage.c_str(), APPNAME, MB_OK | MB_TOPMOST | MB_ICONERROR); } } } @@ -1846,11 +1846,11 @@ void CRainmeter::ActivateConfig(int configIndex, int iniIndex) if (_waccess(skinIniPath.c_str(), 0) == -1) { - std::wstring message = L"Unable to activate config \""; + std::wstring message = L"Unable to activate skin \""; message += skinConfig.c_str(); - message += L"\": Ini-file not found: \""; + message += L"\\"; message += skinIniFile.c_str(); - message += L"\""; + message += L"\": Ini-file not found."; LSLog(LOG_DEBUG, APPNAME, message.c_str()); MessageBox(NULL, message.c_str(), APPNAME, MB_OK | MB_TOPMOST | MB_ICONEXCLAMATION); return; @@ -2573,7 +2573,7 @@ BOOL CRainmeter::ExecuteBang(const std::wstring& bang, const std::wstring& arg, { std::wstring error = L"Unknown !bang: "; error += bang; - MessageBox(NULL, error.c_str(), APPNAME, MB_OK); + MessageBox(NULL, error.c_str(), APPNAME, MB_OK | MB_TOPMOST | MB_ICONEXCLAMATION); return FALSE; } @@ -2868,8 +2868,8 @@ void CRainmeter::ReadGeneralSettings(std::wstring& iniFile) if (!SetActiveConfig(skinName, skinIni)) { std::wstring error; - error = L"The selected config (L" + skinName + L"\\" + skinIni + L") cannot be found."; - MessageBox(NULL, error.c_str(), APPNAME, MB_OK); + error = L"The selected skin (L" + skinName + L"\\" + skinIni + L") cannot be found."; + MessageBox(NULL, error.c_str(), APPNAME, MB_OK | MB_TOPMOST | MB_ICONEXCLAMATION); } return; } @@ -3692,7 +3692,7 @@ void CRainmeter::StartLogging() std::wstring message = L"Log file created at: "; message += m_LogFile; - MessageBox(NULL, message.c_str(), APPNAME, MB_OK | MB_ICONINFORMATION); + MessageBox(NULL, message.c_str(), APPNAME, MB_OK | MB_TOPMOST | MB_ICONINFORMATION); } else { @@ -3702,7 +3702,7 @@ void CRainmeter::StartLogging() std::wstring message = L"Unable to create log file: "; message += m_LogFile; - MessageBox(NULL, message.c_str(), APPNAME, MB_OK | MB_ICONERROR); + MessageBox(NULL, message.c_str(), APPNAME, MB_OK | MB_TOPMOST | MB_ICONERROR); } } else @@ -3723,7 +3723,7 @@ void CRainmeter::DeleteLogFile() { std::wstring message = L"Do you want to delete the following log file?\n"; message += m_LogFile; - int res = MessageBox(NULL, message.c_str(), L"Rainmeter", MB_YESNO | MB_ICONQUESTION); + int res = MessageBox(NULL, message.c_str(), L"Rainmeter", MB_YESNO | MB_TOPMOST | MB_ICONQUESTION); if (res == IDYES) { // Disable logging diff --git a/Plugins/PluginPerfMon/PerfData.cpp b/Plugins/PluginPerfMon/PerfData.cpp index 977f6721..d4633a2d 100644 --- a/Plugins/PluginPerfMon/PerfData.cpp +++ b/Plugins/PluginPerfMon/PerfData.cpp @@ -139,7 +139,7 @@ double Update2(UINT id) } else { - LSLog(LOG_DEBUG, L"Rainmeter", L"PerfMon plugin works only in Win2K/XP."); + LSLog(LOG_DEBUG, L"Rainmeter", L"PerfMon plugin works only in Win2K and later."); } } } diff --git a/Plugins/PluginPing/Ping.cpp b/Plugins/PluginPing/Ping.cpp index b49a40ca..ada7cf7c 100644 --- a/Plugins/PluginPing/Ping.cpp +++ b/Plugins/PluginPing/Ping.cpp @@ -162,7 +162,7 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id) } else { - LSLog(LOG_DEBUG, L"Rainmeter", L"Unable to initialize Windows Sockets"); + LSLog(LOG_DEBUG, L"Rainmeter", L"Unable to initialize Windows Sockets."); } } valid = true; diff --git a/Plugins/PluginRecycleManager/RecycleManager.cpp b/Plugins/PluginRecycleManager/RecycleManager.cpp index 84c2148e..0d6b2096 100644 --- a/Plugins/PluginRecycleManager/RecycleManager.cpp +++ b/Plugins/PluginRecycleManager/RecycleManager.cpp @@ -102,7 +102,7 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id) { std::wstring error = L"No such RecycleType: "; error += type; - MessageBox(NULL, error.c_str(), L"Rainmeter", MB_OK); + MessageBox(NULL, error.c_str(), L"Rainmeter", MB_OK | MB_TOPMOST | MB_ICONEXCLAMATION); } } diff --git a/Plugins/PluginResMon/ResMon.cpp b/Plugins/PluginResMon/ResMon.cpp index 40ef552a..86f09d56 100644 --- a/Plugins/PluginResMon/ResMon.cpp +++ b/Plugins/PluginResMon/ResMon.cpp @@ -115,7 +115,7 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id) { std::wstring error = L"No such GDICountType: "; error += type; - MessageBox(NULL, error.c_str(), L"Rainmeter", MB_OK); + MessageBox(NULL, error.c_str(), L"Rainmeter", MB_OK | MB_TOPMOST | MB_ICONEXCLAMATION); } } diff --git a/Plugins/PluginSpeedFan/SpeedFanPlugin.cpp b/Plugins/PluginSpeedFan/SpeedFanPlugin.cpp index 142e8ad5..9c4c7a62 100644 --- a/Plugins/PluginSpeedFan/SpeedFanPlugin.cpp +++ b/Plugins/PluginSpeedFan/SpeedFanPlugin.cpp @@ -113,7 +113,7 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id) { std::wstring error = L"No such SpeedFanScale: "; error += scale; - MessageBox(NULL, error.c_str(), L"Rainmeter", MB_OK); + MessageBox(NULL, error.c_str(), L"Rainmeter", MB_OK | MB_TOPMOST | MB_ICONEXCLAMATION); } } } @@ -129,7 +129,7 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id) { std::wstring error = L"No such SpeedFanType: "; error += type; - MessageBox(NULL, error.c_str(), L"Rainmeter", MB_OK); + MessageBox(NULL, error.c_str(), L"Rainmeter", MB_OK | MB_TOPMOST | MB_ICONEXCLAMATION); } } diff --git a/Plugins/PluginSysInfo/SysInfo.cpp b/Plugins/PluginSysInfo/SysInfo.cpp index 72d655d2..27412bb0 100644 --- a/Plugins/PluginSysInfo/SysInfo.cpp +++ b/Plugins/PluginSysInfo/SysInfo.cpp @@ -209,7 +209,7 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id) { std::wstring error = L"No such SysInfoType: "; error += type; - MessageBox(NULL, error.c_str(), L"Rainmeter", MB_OK); + MessageBox(NULL, error.c_str(), L"Rainmeter", MB_OK | MB_TOPMOST | MB_ICONEXCLAMATION); } } @@ -435,8 +435,8 @@ double Update2(UINT id) { if(GetSystemMetrics(SM_CMONITORS)>32) { - std::wstring error = L"That's alot of monitors! 32 is the max. "; - MessageBox(NULL, error.c_str(), L"Rainmeter", MB_OK); + std::wstring error = L"That's alot of monitors! 32 is the max."; + MessageBox(NULL, error.c_str(), L"Rainmeter", MB_OK | MB_TOPMOST | MB_ICONERROR); exit(-1); } m_Monitors.count = 0; diff --git a/Plugins/PluginWifiStatus/WifiStatus.cpp b/Plugins/PluginWifiStatus/WifiStatus.cpp index 3574231b..ee13dbfd 100644 --- a/Plugins/PluginWifiStatus/WifiStatus.cpp +++ b/Plugins/PluginWifiStatus/WifiStatus.cpp @@ -106,6 +106,7 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id) if(( ERROR_SUCCESS != dwErr) || (&pIntfList->dwNumberOfItems <= 0)){ WCHAR buffer[256]; wsprintf(buffer, L"WifiStatus.dll: Unable to find any WLAN interfaces/adapters. Error code %d",(int) dwErr); + Log(buffer); return 0; } }