Error messages now display meter/measure in question.

This commit is contained in:
Birunthan Mohanathas 2010-09-21 16:45:29 +00:00
parent 77ac096f2c
commit 11588043de
12 changed files with 82 additions and 75 deletions

View File

@ -680,7 +680,7 @@ CMeasure* CMeasure::Create(const WCHAR* measure, CMeterWindow* meterWindow)
}
// Error
throw CError(std::wstring(L"No such measure: ") + measure, __LINE__, __FILE__);
throw CError(std::wstring(L"Measure=") + measure + L" is not valid.", __LINE__, __FILE__);
return NULL;
}

View File

@ -150,7 +150,7 @@ void CMeasureRegistry::ReadConfig(CConfigParser& parser, const WCHAR* section)
}
else
{
throw CError(std::wstring(L"No such HKEY: ") + keyname, __LINE__, __FILE__);
throw CError(std::wstring(L"HKEY=") + keyname + L" is not valid in measure [" + section + L"].", __LINE__, __FILE__);
}
m_RegKeyName = parser.ReadString(section, L"RegKey", L"");

View File

@ -62,7 +62,7 @@ CMeasureTime::CMeasureTime(CMeterWindow* meterWindow) : CMeasure(meterWindow)
* the operating system is queried to obtain the default value
* for the variable.
*/
_tzset();
tzset();
m_DeltaTime.QuadPart = 0;
m_Time.QuadPart = 0;

View File

@ -471,7 +471,7 @@ CMeter* CMeter::Create(const WCHAR* meter, CMeterWindow* meterWindow)
}
// Error
throw CError(std::wstring(L"No such meter: ") + meter, __LINE__, __FILE__);
throw CError(std::wstring(L"Meter=") + meter + L" is not valid.", __LINE__, __FILE__);
return NULL;
}

View File

@ -133,7 +133,7 @@ void CMeterBar::ReadConfig(const WCHAR* section)
}
else
{
throw CError(std::wstring(L"No such BarOrientation: ") + orientation, __LINE__, __FILE__);
throw CError(std::wstring(L"BarOrientation=") + orientation + L" is not valid in meter [" + m_Name + L"].", __LINE__, __FILE__);
}
if (m_Initialized)

View File

@ -214,7 +214,7 @@ void CMeterBitmap::ReadConfig(const WCHAR* section)
}
else
{
throw CError(std::wstring(L"No such BitmapAlign: ") + align, __LINE__, __FILE__);
throw CError(std::wstring(L"BitmapAlign=") + align + L" is not valid in meter [" + m_Name + L"].", __LINE__, __FILE__);
}
if (m_Initialized)

View File

@ -541,7 +541,7 @@ void CMeterImage::ReadConfig(const WCHAR* section)
}
else
{
throw CError(std::wstring(L"No such ImageFlip: ") + flip, __LINE__, __FILE__);
throw CError(std::wstring(L"ImageFlip=") + flip + L" is not valid in meter [" + m_Name + L"].", __LINE__, __FILE__);
}
m_Rotate = (REAL)parser.ReadFloat(section, L"ImageRotate", 0.0);

View File

@ -301,7 +301,7 @@ void CMeterString::ReadConfig(const WCHAR* section)
}
else
{
throw CError(std::wstring(L"No such StringAlign: ") + align, __LINE__, __FILE__);
throw CError(std::wstring(L"StringAlign=") + align + L" is not valid in meter [" + m_Name + L"].", __LINE__, __FILE__);
}
std::wstring stringCase;
@ -323,8 +323,10 @@ void CMeterString::ReadConfig(const WCHAR* section)
{
m_textCase = TEXTCASE_PROPER;
}
else
{
throw CError(std::wstring(L"StringCase=") + stringCase + L" is not valid in meter [" + m_Name + L"].", __LINE__, __FILE__);
}
std::wstring style;
style = parser.ReadString(section, L"StringStyle", L"NORMAL");
@ -347,7 +349,7 @@ void CMeterString::ReadConfig(const WCHAR* section)
}
else
{
throw CError(std::wstring(L"No such StringStyle: ") + style, __LINE__, __FILE__);
throw CError(std::wstring(L"StringStyle=") + style + L" is not valid in meter [" + m_Name + L"].", __LINE__, __FILE__);
}
std::wstring effect;
@ -367,7 +369,7 @@ void CMeterString::ReadConfig(const WCHAR* section)
}
else
{
throw CError(std::wstring(L"No such StringEffect: ") + effect, __LINE__, __FILE__);
throw CError(std::wstring(L"StringEffect=") + effect + L" is not valid in meter [" + m_Name + L"].", __LINE__, __FILE__);
}
if (-1 != (int)parser.ReadFormula(section, L"W", -1) && -1 != (int)parser.ReadFormula(section, L"H", -1))

View File

@ -100,8 +100,9 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
}
else
{
std::wstring error = L"No such RecycleType: ";
std::wstring error = L"RecycleType=";
error += type;
error += L" is not valid in measure [" + section + L"].";
MessageBox(NULL, error.c_str(), L"Rainmeter", MB_OK | MB_TOPMOST | MB_ICONEXCLAMATION);
}
}

View File

@ -113,8 +113,9 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
}
else
{
std::wstring error = L"No such GDICountType: ";
std::wstring error = L"GDICountType=";
error += type;
error += L" is not valid in measure [" + section + L"].";
MessageBox(NULL, error.c_str(), L"Rainmeter", MB_OK | MB_TOPMOST | MB_ICONEXCLAMATION);
}
}

View File

@ -111,8 +111,9 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
}
else
{
std::wstring error = L"No such SpeedFanScale: ";
std::wstring error = L"SpeedFanScale=";
error += scale;
error += L" is not valid in measure [" + section + L"]." ;
MessageBox(NULL, error.c_str(), L"Rainmeter", MB_OK | MB_TOPMOST | MB_ICONEXCLAMATION);
}
}
@ -127,8 +128,9 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
}
else
{
std::wstring error = L"No such SpeedFanType: ";
std::wstring error = L"SpeedFanType=";
error += type;
error += L" is not valid in measure [" + section + L"]." ;
MessageBox(NULL, error.c_str(), L"Rainmeter", MB_OK | MB_TOPMOST | MB_ICONEXCLAMATION);
}
}

View File

@ -207,8 +207,9 @@ UINT Initialize(HMODULE instance, LPCTSTR iniFile, LPCTSTR section, UINT id)
}
else
{
std::wstring error = L"No such SysInfoType: ";
std::wstring error = L"SysInfoType=";
error += type;
error += L" is not valid in measure [" + section + L"]." ;
MessageBox(NULL, error.c_str(), L"Rainmeter", MB_OK | MB_TOPMOST | MB_ICONEXCLAMATION);
}
}