Cosmetic changes here and there.

This commit is contained in:
Birunthan Mohanathas 2010-09-21 11:09:36 +00:00
parent e812e079ec
commit e618ad1777
13 changed files with 37 additions and 36 deletions

View File

@ -122,7 +122,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmd
HMODULE module = GetModuleHandle(L"Rainmeter.dll"); HMODULE module = GetModuleHandle(L"Rainmeter.dll");
if(module == NULL) 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; return 0;
} }
@ -222,7 +222,7 @@ void Bang(const WCHAR* command)
{ {
if (_wcsicmp(L"!rainmeterquit", command) != 0) 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);
} }
} }
} }

View File

@ -924,7 +924,7 @@ void CConfigParser::ReadIniFile(const std::vector<std::wstring>& iniFileMappings
{ {
if (depth > 100) // Is 100 enough to assume the include loop never ends? 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; return;
} }

View File

@ -692,5 +692,5 @@ CMeasure* CMeasure::Create(const WCHAR* measure, CMeterWindow* meterWindow)
*/ */
void CMeasure::ExecuteBang(const WCHAR* args) 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);
} }

View File

@ -230,6 +230,6 @@ void CMeasurePlugin::ExecuteBang(const WCHAR* args)
} }
else else
{ {
DebugLog(L"[%s] Doesn't support bangs.", m_Name.c_str()); DebugLog(L"[%s] doesn't support bangs.", m_Name.c_str());
} }
} }

View File

@ -308,9 +308,9 @@ void CMeterWindow::Refresh(bool init, bool all)
m_Rainmeter->SetCurrentParser(&m_Parser); m_Rainmeter->SetCurrentParser(&m_Parser);
std::wstring dbg = L"Refreshing (Name: \"" + m_SkinName; std::wstring dbg = L"Refreshing skin \"" + m_SkinName;
dbg += L"\" Ini: \"" + m_SkinIniFile; dbg += L"\\" + m_SkinIniFile;
dbg += L"\")"; dbg += L"\"";
LSLog(LOG_DEBUG, L"Rainmeter", dbg.c_str()); LSLog(LOG_DEBUG, L"Rainmeter", dbg.c_str());
m_Refreshing = true; m_Refreshing = true;
@ -765,7 +765,7 @@ void CMeterWindow::RunBang(BANGCOMMAND bang, const WCHAR* arg)
} }
else else
{ {
DebugLog(L"Cannot parse parameters for !RainmeterMove"); DebugLog(L"Unable to parse parameters for !RainmeterMove");
} }
break; break;
@ -861,7 +861,7 @@ void CMeterWindow::RunBang(BANGCOMMAND bang, const WCHAR* arg)
} }
else else
{ {
DebugLog(L"Cannot parse parameters for !RainmeterLsBoxHook (%s)", arg); DebugLog(L"Unable to parse parameters for !RainmeterLsBoxHook (%s)", arg);
} }
} }
break; break;
@ -877,12 +877,12 @@ void CMeterWindow::RunBang(BANGCOMMAND bang, const WCHAR* arg)
} }
else else
{ {
DebugLog(L"Cannot parse the for !RainmeterMoveMeter"); DebugLog(L"Unable to parse coordinates for !RainmeterMoveMeter");
} }
} }
else else
{ {
DebugLog(L"Cannot parse the coordinates for !RainmeterMoveMeter"); DebugLog(L"Unable to parse parameters for !RainmeterMoveMeter");
} }
break; break;
@ -924,7 +924,7 @@ void CMeterWindow::RunBang(BANGCOMMAND bang, const WCHAR* arg)
} }
else else
{ {
DebugLog(L"Cannot parse the !RainmeterPluginBang"); DebugLog(L"Unable to parse parameters for !RainmeterPluginBang");
} }
} }
break; break;
@ -955,7 +955,7 @@ void CMeterWindow::RunBang(BANGCOMMAND bang, const WCHAR* arg)
} }
else else
{ {
DebugLog(L"Cannot parse parameters for !RainmeterSetVariable"); DebugLog(L"Unable to parse parameters for !RainmeterSetVariable");
} }
break; break;
} }

View File

@ -1493,7 +1493,7 @@ int CRainmeter::Initialize(HWND Parent, HINSTANCE Instance, LPCSTR szPath)
if (c_Debug) if (c_Debug)
{ {
LSLog(LOG_DEBUG, APPNAME, L"Enumerating installed font families ..."); LSLog(LOG_DEBUG, APPNAME, L"Enumerating installed font families...");
CMeterString::EnumerateInstalledFontFamilies(); CMeterString::EnumerateInstalledFontFamilies();
} }
@ -1506,7 +1506,7 @@ int CRainmeter::Initialize(HWND Parent, HINSTANCE Instance, LPCSTR szPath)
if(m_ConfigStrings.empty()) if(m_ConfigStrings.empty())
{ {
std::wstring error = L"There are no available skins at:\n" + m_SkinPath; 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); ReadGeneralSettings(m_IniFile);
@ -1708,13 +1708,13 @@ void CRainmeter::CheckSkinVersions()
else else
{ {
std::wstring strMessage = L"Failed to upgrade the config.\nUnable to backup the current config."; 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 else
{ {
std::wstring strMessage = L"Failed to upgrade the config.\nThe version number contains illegal characters."; 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) 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 += skinConfig.c_str();
message += L"\": Ini-file not found: \""; message += L"\\";
message += skinIniFile.c_str(); message += skinIniFile.c_str();
message += L"\""; message += L"\": Ini-file not found.";
LSLog(LOG_DEBUG, APPNAME, message.c_str()); LSLog(LOG_DEBUG, APPNAME, message.c_str());
MessageBox(NULL, message.c_str(), APPNAME, MB_OK | MB_TOPMOST | MB_ICONEXCLAMATION); MessageBox(NULL, message.c_str(), APPNAME, MB_OK | MB_TOPMOST | MB_ICONEXCLAMATION);
return; return;
@ -2573,7 +2573,7 @@ BOOL CRainmeter::ExecuteBang(const std::wstring& bang, const std::wstring& arg,
{ {
std::wstring error = L"Unknown !bang: "; std::wstring error = L"Unknown !bang: ";
error += 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; return FALSE;
} }
@ -2868,8 +2868,8 @@ void CRainmeter::ReadGeneralSettings(std::wstring& iniFile)
if (!SetActiveConfig(skinName, skinIni)) if (!SetActiveConfig(skinName, skinIni))
{ {
std::wstring error; std::wstring error;
error = L"The selected config (L" + skinName + L"\\" + skinIni + L") cannot be found."; error = L"The selected skin (L" + skinName + L"\\" + skinIni + L") cannot be found.";
MessageBox(NULL, error.c_str(), APPNAME, MB_OK); MessageBox(NULL, error.c_str(), APPNAME, MB_OK | MB_TOPMOST | MB_ICONEXCLAMATION);
} }
return; return;
} }
@ -3692,7 +3692,7 @@ void CRainmeter::StartLogging()
std::wstring message = L"Log file created at: "; std::wstring message = L"Log file created at: ";
message += m_LogFile; 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 else
{ {
@ -3702,7 +3702,7 @@ void CRainmeter::StartLogging()
std::wstring message = L"Unable to create log file: "; std::wstring message = L"Unable to create log file: ";
message += m_LogFile; 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 else
@ -3723,7 +3723,7 @@ void CRainmeter::DeleteLogFile()
{ {
std::wstring message = L"Do you want to delete the following log file?\n"; std::wstring message = L"Do you want to delete the following log file?\n";
message += m_LogFile; 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) if (res == IDYES)
{ {
// Disable logging // Disable logging

View File

@ -139,7 +139,7 @@ double Update2(UINT id)
} }
else 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.");
} }
} }
} }

View File

@ -162,7 +162,7 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
} }
else 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; valid = true;

View File

@ -102,7 +102,7 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
{ {
std::wstring error = L"No such RecycleType: "; std::wstring error = L"No such RecycleType: ";
error += type; error += type;
MessageBox(NULL, error.c_str(), L"Rainmeter", MB_OK); MessageBox(NULL, error.c_str(), L"Rainmeter", MB_OK | MB_TOPMOST | MB_ICONEXCLAMATION);
} }
} }

View File

@ -115,7 +115,7 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
{ {
std::wstring error = L"No such GDICountType: "; std::wstring error = L"No such GDICountType: ";
error += type; error += type;
MessageBox(NULL, error.c_str(), L"Rainmeter", MB_OK); MessageBox(NULL, error.c_str(), L"Rainmeter", MB_OK | MB_TOPMOST | MB_ICONEXCLAMATION);
} }
} }

View File

@ -113,7 +113,7 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
{ {
std::wstring error = L"No such SpeedFanScale: "; std::wstring error = L"No such SpeedFanScale: ";
error += scale; 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: "; std::wstring error = L"No such SpeedFanType: ";
error += type; error += type;
MessageBox(NULL, error.c_str(), L"Rainmeter", MB_OK); MessageBox(NULL, error.c_str(), L"Rainmeter", MB_OK | MB_TOPMOST | MB_ICONEXCLAMATION);
} }
} }

View File

@ -209,7 +209,7 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
{ {
std::wstring error = L"No such SysInfoType: "; std::wstring error = L"No such SysInfoType: ";
error += type; 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) if(GetSystemMetrics(SM_CMONITORS)>32)
{ {
std::wstring error = L"That's alot of monitors! 32 is the max. "; std::wstring error = L"That's alot of monitors! 32 is the max.";
MessageBox(NULL, error.c_str(), L"Rainmeter", MB_OK); MessageBox(NULL, error.c_str(), L"Rainmeter", MB_OK | MB_TOPMOST | MB_ICONERROR);
exit(-1); exit(-1);
} }
m_Monitors.count = 0; m_Monitors.count = 0;

View File

@ -106,6 +106,7 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
if(( ERROR_SUCCESS != dwErr) || (&pIntfList->dwNumberOfItems <= 0)){ if(( ERROR_SUCCESS != dwErr) || (&pIntfList->dwNumberOfItems <= 0)){
WCHAR buffer[256]; WCHAR buffer[256];
wsprintf(buffer, L"WifiStatus.dll: Unable to find any WLAN interfaces/adapters. Error code %d",(int) dwErr); wsprintf(buffer, L"WifiStatus.dll: Unable to find any WLAN interfaces/adapters. Error code %d",(int) dwErr);
Log(buffer);
return 0; return 0;
} }
} }