mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Tweak f4429ad
This commit is contained in:
parent
05a9d9188d
commit
a3d8f73f6c
@ -722,7 +722,7 @@ const std::wstring& CConfigParser::ReadString(LPCTSTR section, LPCTSTR key, LPCT
|
|||||||
{
|
{
|
||||||
const std::wstring& strStyleValue = GetValue((*iter), strKey, strDefault);
|
const std::wstring& strStyleValue = GetValue((*iter), strKey, strDefault);
|
||||||
|
|
||||||
//CLogger_DebugF(L"StyleTemplate: [%s] %s (from [%s]) : strDefault=%s (0x%p), strStyleValue=%s (0x%p)",
|
//LogDebugF(L"StyleTemplate: [%s] %s (from [%s]) : strDefault=%s (0x%p), strStyleValue=%s (0x%p)",
|
||||||
// section, key, (*iter).c_str(), strDefault.c_str(), &strDefault, strStyleValue.c_str(), &strStyleValue);
|
// section, key, (*iter).c_str(), strDefault.c_str(), &strDefault, strStyleValue.c_str(), &strStyleValue);
|
||||||
|
|
||||||
if (&strStyleValue != &strDefault)
|
if (&strStyleValue != &strDefault)
|
||||||
@ -850,7 +850,7 @@ int CConfigParser::ReadInt(LPCTSTR section, LPCTSTR key, int defValue)
|
|||||||
return (int)dblValue;
|
return (int)dblValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
CLogger_ErrorF(L"Formula: %s in key \"%s\" in [%s]", errMsg, key, section);
|
LogErrorF(L"Formula: %s in key \"%s\" in [%s]", errMsg, key, section);
|
||||||
}
|
}
|
||||||
else if (*string)
|
else if (*string)
|
||||||
{
|
{
|
||||||
@ -882,7 +882,7 @@ uint32_t CConfigParser::ReadUInt(LPCTSTR section, LPCTSTR key, uint32_t defValue
|
|||||||
return (uint32_t)dblValue;
|
return (uint32_t)dblValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
CLogger_ErrorF(L"Formula: %s in key \"%s\" in [%s]", errMsg, key, section);
|
LogErrorF(L"Formula: %s in key \"%s\" in [%s]", errMsg, key, section);
|
||||||
}
|
}
|
||||||
else if (*string)
|
else if (*string)
|
||||||
{
|
{
|
||||||
@ -914,7 +914,7 @@ uint64_t CConfigParser::ReadUInt64(LPCTSTR section, LPCTSTR key, uint64_t defVal
|
|||||||
return (uint64_t)dblValue;
|
return (uint64_t)dblValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
CLogger_ErrorF(L"Formula: %s in key \"%s\" in [%s]", errMsg, key, section);
|
LogErrorF(L"Formula: %s in key \"%s\" in [%s]", errMsg, key, section);
|
||||||
}
|
}
|
||||||
else if (*string)
|
else if (*string)
|
||||||
{
|
{
|
||||||
@ -946,7 +946,7 @@ double CConfigParser::ReadFloat(LPCTSTR section, LPCTSTR key, double defValue)
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
CLogger_ErrorF(L"Formula: %s in key \"%s\" in [%s]", errMsg, key, section);
|
LogErrorF(L"Formula: %s in key \"%s\" in [%s]", errMsg, key, section);
|
||||||
}
|
}
|
||||||
else if (*string)
|
else if (*string)
|
||||||
{
|
{
|
||||||
@ -972,7 +972,7 @@ bool CConfigParser::ParseFormula(const std::wstring& formula, double* resultValu
|
|||||||
const WCHAR* errMsg = MathParser::CheckedParse(string, resultValue);
|
const WCHAR* errMsg = MathParser::CheckedParse(string, resultValue);
|
||||||
if (errMsg != NULL)
|
if (errMsg != NULL)
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"Formula: %s: %s", errMsg, string);
|
LogErrorF(L"Formula: %s: %s", errMsg, string);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1069,7 +1069,7 @@ double CConfigParser::ParseDouble(LPCTSTR string, double defValue)
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
CLogger_ErrorF(L"Formula: %s: %s", errMsg, string);
|
LogErrorF(L"Formula: %s: %s", errMsg, string);
|
||||||
}
|
}
|
||||||
else if (*string)
|
else if (*string)
|
||||||
{
|
{
|
||||||
@ -1102,7 +1102,7 @@ int CConfigParser::ParseInt(LPCTSTR string, int defValue)
|
|||||||
return (int)dblValue;
|
return (int)dblValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
CLogger_ErrorF(L"Formula: %s: %s", errMsg, string);
|
LogErrorF(L"Formula: %s: %s", errMsg, string);
|
||||||
}
|
}
|
||||||
else if (*string)
|
else if (*string)
|
||||||
{
|
{
|
||||||
@ -1135,7 +1135,7 @@ uint32_t CConfigParser::ParseUInt(LPCTSTR string, uint32_t defValue)
|
|||||||
return (uint32_t)dblValue;
|
return (uint32_t)dblValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
CLogger_ErrorF(L"Formula: %s: %s", errMsg, string);
|
LogErrorF(L"Formula: %s: %s", errMsg, string);
|
||||||
}
|
}
|
||||||
else if (*string)
|
else if (*string)
|
||||||
{
|
{
|
||||||
@ -1168,7 +1168,7 @@ uint64_t CConfigParser::ParseUInt64(LPCTSTR string, uint64_t defValue)
|
|||||||
return (uint64_t)dblValue;
|
return (uint64_t)dblValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
CLogger_ErrorF(L"Formula: %s: %s", errMsg, string);
|
LogErrorF(L"Formula: %s: %s", errMsg, string);
|
||||||
}
|
}
|
||||||
else if (*string)
|
else if (*string)
|
||||||
{
|
{
|
||||||
@ -1295,7 +1295,7 @@ void CConfigParser::ReadIniFile(const std::wstring& iniFile, LPCTSTR skinSection
|
|||||||
// Verify whether the file exists
|
// Verify whether the file exists
|
||||||
if (_waccess(iniFile.c_str(), 0) == -1)
|
if (_waccess(iniFile.c_str(), 0) == -1)
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"Unable to read file: %s", iniFile.c_str());
|
LogErrorF(L"Unable to read file: %s", iniFile.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1305,11 +1305,11 @@ void CConfigParser::ReadIniFile(const std::wstring& iniFile, LPCTSTR skinSection
|
|||||||
|
|
||||||
if (temporary)
|
if (temporary)
|
||||||
{
|
{
|
||||||
if (Rainmeter->GetDebug()) CLogger_DebugF(L"Reading file: %s (Temp: %s)", iniFile.c_str(), iniRead.c_str());
|
if (Rainmeter->GetDebug()) LogDebugF(L"Reading file: %s (Temp: %s)", iniFile.c_str(), iniRead.c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (Rainmeter->GetDebug()) CLogger_DebugF(L"Reading file: %s", iniFile.c_str());
|
if (Rainmeter->GetDebug()) LogDebugF(L"Reading file: %s", iniFile.c_str());
|
||||||
iniRead = iniFile;
|
iniRead = iniFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1513,7 +1513,7 @@ void CConfigParser::ReadIniFile(const std::wstring& iniFile, LPCTSTR skinSection
|
|||||||
*/
|
*/
|
||||||
void CConfigParser::SetValue(const std::wstring& strSection, const std::wstring& strKey, const std::wstring& strValue)
|
void CConfigParser::SetValue(const std::wstring& strSection, const std::wstring& strKey, const std::wstring& strValue)
|
||||||
{
|
{
|
||||||
// CLogger_DebugF(L"[%s] %s=%s (size: %i)", strSection.c_str(), strKey.c_str(), strValue.c_str(), (int)m_Values.size());
|
// LogDebugF(L"[%s] %s=%s (size: %i)", strSection.c_str(), strKey.c_str(), strValue.c_str(), (int)m_Values.size());
|
||||||
|
|
||||||
std::wstring strTmp;
|
std::wstring strTmp;
|
||||||
strTmp.reserve(strSection.size() + 1 + strKey.size());
|
strTmp.reserve(strSection.size() + 1 + strKey.size());
|
||||||
|
@ -1083,7 +1083,7 @@ void CDialogAbout::CTabPlugins::Initialize()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"Unable to load plugin: %s (%u)", tmpSz.c_str(), err);
|
LogErrorF(L"Unable to load plugin: %s (%u)", tmpSz.c_str(), err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (FindNextFile(hSearch, &fd));
|
while (FindNextFile(hSearch, &fd));
|
||||||
|
@ -56,27 +56,6 @@ public:
|
|||||||
void Log(Level level, const WCHAR* msg);
|
void Log(Level level, const WCHAR* msg);
|
||||||
void LogF(Level level, const WCHAR* format, ...);
|
void LogF(Level level, const WCHAR* format, ...);
|
||||||
|
|
||||||
// Convenience functions.
|
|
||||||
static void Error(const WCHAR* msg) { GetInstance().Log(Level::Error, msg); }
|
|
||||||
static void Warning(const WCHAR* msg) { GetInstance().Log(Level::Warning, msg); }
|
|
||||||
static void Notice(const WCHAR* msg) { GetInstance().Log(Level::Notice, msg); }
|
|
||||||
static void Debug(const WCHAR* msg) { GetInstance().Log(Level::Debug, msg); }
|
|
||||||
|
|
||||||
// TODO: Uncomment when VS supports variadic templates.
|
|
||||||
/*
|
|
||||||
template<typename... Args>
|
|
||||||
static void ErrorF(const WCHAR* format, Args... args) { GetInstance().LogF(Level::Error, args...); }
|
|
||||||
|
|
||||||
template<typename... Args>
|
|
||||||
static void WarningF(const WCHAR* format, Args... args) { GetInstance().LogF(Level::Warning, args...); }
|
|
||||||
|
|
||||||
template<typename... Args>
|
|
||||||
static void NoticeF(const WCHAR* format, Args... args) { GetInstance().LogF(Level::Notice, args...); }
|
|
||||||
|
|
||||||
template<typename... Args>
|
|
||||||
static void DebugF(const WCHAR* format, Args... args) { GetInstance().LogF(Level::Debug, args...); }
|
|
||||||
*/
|
|
||||||
|
|
||||||
const std::wstring& GetLogFilePath() { return m_LogFilePath; }
|
const std::wstring& GetLogFilePath() { return m_LogFilePath; }
|
||||||
|
|
||||||
const std::list<Entry>& GetEntries() { return m_Entries; }
|
const std::list<Entry>& GetEntries() { return m_Entries; }
|
||||||
@ -99,12 +78,31 @@ private:
|
|||||||
CRITICAL_SECTION m_CsLogDelay;
|
CRITICAL_SECTION m_CsLogDelay;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Convenience functions.
|
||||||
|
#define RM_LOGGER_DEFINE_LOG_FUNCTION(name) \
|
||||||
|
inline void Log ## name(const WCHAR* msg) \
|
||||||
|
{ \
|
||||||
|
CLogger::GetInstance().Log(CLogger::Level::name, msg); \
|
||||||
|
} \
|
||||||
|
/* \
|
||||||
|
template<typename... Args> \
|
||||||
|
inline void Log ## name ## F(const WCHAR* format, Args... args) \
|
||||||
|
{ \
|
||||||
|
GetInstance().LogF(CLogger::Level::name, args...); \
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
RM_LOGGER_DEFINE_LOG_FUNCTION(Error)
|
||||||
|
RM_LOGGER_DEFINE_LOG_FUNCTION(Warning)
|
||||||
|
RM_LOGGER_DEFINE_LOG_FUNCTION(Notice)
|
||||||
|
RM_LOGGER_DEFINE_LOG_FUNCTION(Debug)
|
||||||
|
|
||||||
// FIXME: Temporary solution until VS support variadic macros.
|
// FIXME: Temporary solution until VS support variadic macros.
|
||||||
#define RM_LOGGER_LOGF_HELPER(name, format, ...) \
|
#define RM_LOGGER_LOGF_HELPER(name, format, ...) \
|
||||||
CLogger::GetInstance().LogF(CLogger::Level::name, format, __VA_ARGS__);
|
CLogger::GetInstance().LogF(CLogger::Level::name, format, __VA_ARGS__);
|
||||||
#define CLogger_ErrorF(format, ...) RM_LOGGER_LOGF_HELPER(Error, format, __VA_ARGS__)
|
#define LogErrorF(format, ...) RM_LOGGER_LOGF_HELPER(Error, format, __VA_ARGS__)
|
||||||
#define CLogger_WarningF(format, ...) RM_LOGGER_LOGF_HELPER(Warning, format, __VA_ARGS__)
|
#define LogWarningF(format, ...) RM_LOGGER_LOGF_HELPER(Warning, format, __VA_ARGS__)
|
||||||
#define CLogger_NoticeF(format, ...) RM_LOGGER_LOGF_HELPER(Notice, format, __VA_ARGS__)
|
#define LogNoticeF(format, ...) RM_LOGGER_LOGF_HELPER(Notice, format, __VA_ARGS__)
|
||||||
#define CLogger_DebugF(format, ...) RM_LOGGER_LOGF_HELPER(Debug, format, __VA_ARGS__)
|
#define LogDebugF(format, ...) RM_LOGGER_LOGF_HELPER(Debug, format, __VA_ARGS__)
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -162,7 +162,7 @@ void CMeasure::ReadOptions(CConfigParser& parser, const WCHAR* section)
|
|||||||
}
|
}
|
||||||
if (!ParseSubstitute(subs))
|
if (!ParseSubstitute(subs))
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"Measure: Invalid Substitute=%s", subs.c_str());
|
LogErrorF(L"Measure: Invalid Substitute=%s", subs.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -260,7 +260,7 @@ const WCHAR* CMeasure::CheckSubstitute(const WCHAR* buffer)
|
|||||||
if (re == NULL)
|
if (re == NULL)
|
||||||
{
|
{
|
||||||
MakePlainSubstitute(str, i);
|
MakePlainSubstitute(str, i);
|
||||||
CLogger_NoticeF(L"Substitute: %S", error);
|
LogNoticeF(L"Substitute: %S", error);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -847,7 +847,7 @@ CMeasure* CMeasure::Create(const WCHAR* measure, CMeterWindow* meterWindow, cons
|
|||||||
return new CMeasureScript(meterWindow, name);
|
return new CMeasureScript(meterWindow, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
CLogger_ErrorF(L"Measure=%s is not valid in [%s]", measure, name);
|
LogErrorF(L"Measure=%s is not valid in [%s]", measure, name);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -858,5 +858,5 @@ CMeasure* CMeasure::Create(const WCHAR* measure, CMeterWindow* meterWindow, cons
|
|||||||
*/
|
*/
|
||||||
void CMeasure::Command(const std::wstring& command)
|
void CMeasure::Command(const std::wstring& command)
|
||||||
{
|
{
|
||||||
CLogger_WarningF(L"!CommandMeasure: Not supported by [%s]", m_Name.c_str());
|
LogWarningF(L"!CommandMeasure: Not supported by [%s]", m_Name.c_str());
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ void CMeasureCPU::ReadOptions(CConfigParser& parser, const WCHAR* section)
|
|||||||
|
|
||||||
if (processor < 0 || processor > c_NumOfProcessors)
|
if (processor < 0 || processor > c_NumOfProcessors)
|
||||||
{
|
{
|
||||||
CLogger_WarningF(L"CPU: Processor=%i invalid in [%s]", processor, section);
|
LogWarningF(L"CPU: Processor=%i invalid in [%s]", processor, section);
|
||||||
processor = 0;
|
processor = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ void CMeasureCalc::UpdateValue()
|
|||||||
{
|
{
|
||||||
if (!m_ParseError)
|
if (!m_ParseError)
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"Calc: %s in [%s]", errMsg, m_Name.c_str());
|
LogErrorF(L"Calc: %s in [%s]", errMsg, m_Name.c_str());
|
||||||
m_ParseError = true;
|
m_ParseError = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -105,7 +105,7 @@ void CMeasureCalc::ReadOptions(CConfigParser& parser, const WCHAR* section)
|
|||||||
const WCHAR* errMsg = MathParser::Check(m_Formula.c_str());
|
const WCHAR* errMsg = MathParser::Check(m_Formula.c_str());
|
||||||
if (errMsg != NULL)
|
if (errMsg != NULL)
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"Calc: %s in [%s]", errMsg, m_Name.c_str());
|
LogErrorF(L"Calc: %s in [%s]", errMsg, m_Name.c_str());
|
||||||
m_Formula.clear();
|
m_Formula.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -182,7 +182,7 @@ void CMeasureDiskSpace::ReadOptions(CConfigParser& parser, const WCHAR* section)
|
|||||||
m_Drive = parser.ReadString(section, L"Drive", L"C:\\");
|
m_Drive = parser.ReadString(section, L"Drive", L"C:\\");
|
||||||
if (m_Drive.empty())
|
if (m_Drive.empty())
|
||||||
{
|
{
|
||||||
CLogger::Warning(L"FreeDiskSpace: Drive= empty");
|
LogWarning(L"FreeDiskSpace: Drive= empty");
|
||||||
m_Value = 0.0;
|
m_Value = 0.0;
|
||||||
m_MaxValue = 0.0;
|
m_MaxValue = 0.0;
|
||||||
m_OldTotalBytes = 0;
|
m_OldTotalBytes = 0;
|
||||||
|
@ -80,8 +80,8 @@ void CMeasureNet::UpdateIFTable()
|
|||||||
|
|
||||||
if (Rainmeter->GetDebug() && logging)
|
if (Rainmeter->GetDebug() && logging)
|
||||||
{
|
{
|
||||||
CLogger::Debug(L"------------------------------");
|
LogDebug(L"------------------------------");
|
||||||
CLogger_DebugF(L"* NETWORK-INTERFACE: Count=%i", c_NumOfTables);
|
LogDebugF(L"* NETWORK-INTERFACE: Count=%i", c_NumOfTables);
|
||||||
|
|
||||||
for (size_t i = 0; i < c_NumOfTables; ++i)
|
for (size_t i = 0; i < c_NumOfTables; ++i)
|
||||||
{
|
{
|
||||||
@ -108,14 +108,14 @@ void CMeasureNet::UpdateIFTable()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
CLogger_DebugF(L"%i: %s", (int)i + 1, ifTable->Table[i].Description);
|
LogDebugF(L"%i: %s", (int)i + 1, ifTable->Table[i].Description);
|
||||||
CLogger_DebugF(L" Alias: %s", ifTable->Table[i].Alias);
|
LogDebugF(L" Alias: %s", ifTable->Table[i].Alias);
|
||||||
CLogger_DebugF(L" Type=%s(%i), Hardware=%s, Filter=%s",
|
LogDebugF(L" Type=%s(%i), Hardware=%s, Filter=%s",
|
||||||
type, ifTable->Table[i].Type,
|
type, ifTable->Table[i].Type,
|
||||||
(ifTable->Table[i].InterfaceAndOperStatusFlags.HardwareInterface == 1) ? L"Yes" : L"No",
|
(ifTable->Table[i].InterfaceAndOperStatusFlags.HardwareInterface == 1) ? L"Yes" : L"No",
|
||||||
(ifTable->Table[i].InterfaceAndOperStatusFlags.FilterInterface == 1) ? L"Yes" : L"No");
|
(ifTable->Table[i].InterfaceAndOperStatusFlags.FilterInterface == 1) ? L"Yes" : L"No");
|
||||||
}
|
}
|
||||||
CLogger::Debug(L"------------------------------");
|
LogDebug(L"------------------------------");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -173,8 +173,8 @@ void CMeasureNet::UpdateIFTable()
|
|||||||
|
|
||||||
if (Rainmeter->GetDebug() && logging)
|
if (Rainmeter->GetDebug() && logging)
|
||||||
{
|
{
|
||||||
CLogger::Debug(L"------------------------------");
|
LogDebug(L"------------------------------");
|
||||||
CLogger_DebugF(L"* NETWORK-INTERFACE: Count=%i", c_NumOfTables);
|
LogDebugF(L"* NETWORK-INTERFACE: Count=%i", c_NumOfTables);
|
||||||
|
|
||||||
for (size_t i = 0; i < c_NumOfTables; ++i)
|
for (size_t i = 0; i < c_NumOfTables; ++i)
|
||||||
{
|
{
|
||||||
@ -204,10 +204,10 @@ void CMeasureNet::UpdateIFTable()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
CLogger_DebugF(L"%i: %.*S", (int)i + 1, ifTable->table[i].dwDescrLen, (char*)ifTable->table[i].bDescr);
|
LogDebugF(L"%i: %.*S", (int)i + 1, ifTable->table[i].dwDescrLen, (char*)ifTable->table[i].bDescr);
|
||||||
CLogger_DebugF(L" Type=%s(%i)", type, ifTable->table[i].dwType);
|
LogDebugF(L" Type=%s(%i)", type, ifTable->table[i].dwType);
|
||||||
}
|
}
|
||||||
CLogger::Debug(L"------------------------------");
|
LogDebug(L"------------------------------");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -143,7 +143,7 @@ void CMeasurePlugin::ReadOptions(CConfigParser& parser, const WCHAR* section)
|
|||||||
}
|
}
|
||||||
if (!m_Plugin)
|
if (!m_Plugin)
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"Plugin: \"%s\" not found", pluginName.c_str());
|
LogErrorF(L"Plugin: \"%s\" not found", pluginName.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -135,7 +135,7 @@ void CMeasureRegistry::ReadOptions(CConfigParser& parser, const WCHAR* section)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"RegHKey=%s is not valid in [%s]", keyname, m_Name.c_str());
|
LogErrorF(L"RegHKey=%s is not valid in [%s]", keyname, m_Name.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
m_RegKeyName = parser.ReadString(section, L"RegKey", L"");
|
m_RegKeyName = parser.ReadString(section, L"RegKey", L"");
|
||||||
|
@ -111,7 +111,7 @@ void CMeasureScript::ReadOptions(CConfigParser& parser, const WCHAR* section)
|
|||||||
|
|
||||||
if (m_HasGetStringFunction)
|
if (m_HasGetStringFunction)
|
||||||
{
|
{
|
||||||
CLogger_WarningF(L"Script: Using deprecated GetStringValue() in [%s]", m_Name.c_str());
|
LogWarningF(L"Script: Using deprecated GetStringValue() in [%s]", m_Name.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
lua_rawgeti(L, LUA_GLOBALSINDEX, m_LuaScript.GetRef());
|
lua_rawgeti(L, LUA_GLOBALSINDEX, m_LuaScript.GetRef());
|
||||||
@ -171,7 +171,7 @@ void CMeasureScript::ReadOptions(CConfigParser& parser, const WCHAR* section)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CLogger_ErrorF(L"Script: File not valid in [%s]", m_Name.c_str());
|
LogErrorF(L"Script: File not valid in [%s]", m_Name.c_str());
|
||||||
UninitializeLuaScript();
|
UninitializeLuaScript();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ void CMeasureTime::TimeToString(WCHAR* buf, size_t bufLen, const WCHAR* format,
|
|||||||
wcsftime(buf, bufLen, format, time);
|
wcsftime(buf, bufLen, format, time);
|
||||||
if (errno == EINVAL)
|
if (errno == EINVAL)
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"Time: \"Format=%s\" invalid in [%s]", format, m_Name.c_str());
|
LogErrorF(L"Time: \"Format=%s\" invalid in [%s]", format, m_Name.c_str());
|
||||||
buf[0] = 0;
|
buf[0] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ const WCHAR* CMeasureUptime::GetStringValue()
|
|||||||
}
|
}
|
||||||
__except (EXCEPTION_EXECUTE_HANDLER)
|
__except (EXCEPTION_EXECUTE_HANDLER)
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"Uptime: \"Format=%s\" invalid in [%s]", m_Format.c_str(), m_Name.c_str());
|
LogErrorF(L"Uptime: \"Format=%s\" invalid in [%s]", m_Format.c_str(), m_Name.c_str());
|
||||||
buffer[0] = 0;
|
buffer[0] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -351,7 +351,7 @@ void CMeter::ReadOptions(CConfigParser& parser, const WCHAR* section)
|
|||||||
delete m_Transformation;
|
delete m_Transformation;
|
||||||
m_Transformation = NULL;
|
m_Transformation = NULL;
|
||||||
|
|
||||||
CLogger_ErrorF(L"Meter: Incorrect number of values in TransformationMatrix=%s", parser.ReadString(section, L"TransformationMatrix", L"").c_str());
|
LogErrorF(L"Meter: Incorrect number of values in TransformationMatrix=%s", parser.ReadString(section, L"TransformationMatrix", L"").c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -409,7 +409,7 @@ CMeter* CMeter::Create(const WCHAR* meter, CMeterWindow* meterWindow, const WCHA
|
|||||||
return new CMeterButton(meterWindow, name);
|
return new CMeterButton(meterWindow, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
CLogger_ErrorF(L"Meter=%s is not valid in [%s]", meter, name);
|
LogErrorF(L"Meter=%s is not valid in [%s]", meter, name);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -443,7 +443,7 @@ bool CMeter::BindPrimaryMeasure(CConfigParser& parser, const WCHAR* section, boo
|
|||||||
}
|
}
|
||||||
else if (!optional)
|
else if (!optional)
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"MeasureName=%s is not valid in [%s]", measureName.c_str(), section);
|
LogErrorF(L"MeasureName=%s is not valid in [%s]", measureName.c_str(), section);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -473,7 +473,7 @@ void CMeter::BindSecondaryMeasures(CConfigParser& parser, const WCHAR* section)
|
|||||||
{
|
{
|
||||||
if (!measureName.empty())
|
if (!measureName.empty())
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"MeasureName%i=%s is not valid in [%s]", i, measureName.c_str(), section);
|
LogErrorF(L"MeasureName%i=%s is not valid in [%s]", i, measureName.c_str(), section);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -122,7 +122,7 @@ void CMeterBar::ReadOptions(CConfigParser& parser, const WCHAR* section)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"BarOrientation=%s is not valid in [%s]", orientation, m_Name.c_str());
|
LogErrorF(L"BarOrientation=%s is not valid in [%s]", orientation, m_Name.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_Initialized)
|
if (m_Initialized)
|
||||||
|
@ -201,7 +201,7 @@ void CMeterBitmap::ReadOptions(CConfigParser& parser, const WCHAR* section)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"BitmapAlign=%s is not valid in [%s]", align, m_Name.c_str());
|
LogErrorF(L"BitmapAlign=%s is not valid in [%s]", align, m_Name.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_Initialized)
|
if (m_Initialized)
|
||||||
@ -363,7 +363,7 @@ bool CMeterBitmap::Draw(Gfx::Canvas& canvas)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// CLogger_DebugF(L"[%u] Value: %f Frame: %i (Transition = %s)", GetTickCount(), m_Value, frame, m_TransitionStartTicks > 0 ? L"true" : L"false");
|
// LogDebugF(L"[%u] Value: %f Frame: %i (Transition = %s)", GetTickCount(), m_Value, frame, m_TransitionStartTicks > 0 ? L"true" : L"false");
|
||||||
|
|
||||||
if (bitmap->GetHeight() > bitmap->GetWidth())
|
if (bitmap->GetHeight() > bitmap->GetWidth())
|
||||||
{
|
{
|
||||||
@ -432,7 +432,7 @@ bool CMeterBitmap::Draw(Gfx::Canvas& canvas)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// CLogger_DebugF(L"[%u] Value: %f Frame: %i (Transition = %s)", GetTickCount(), m_Value, frame, m_TransitionStartTicks > 0 ? L"true" : L"false");
|
// LogDebugF(L"[%u] Value: %f Frame: %i (Transition = %s)", GetTickCount(), m_Value, frame, m_TransitionStartTicks > 0 ? L"true" : L"false");
|
||||||
|
|
||||||
if (bitmap->GetHeight() > bitmap->GetWidth())
|
if (bitmap->GetHeight() > bitmap->GetWidth())
|
||||||
{
|
{
|
||||||
|
@ -120,7 +120,7 @@ void CMeterHistogram::Initialize()
|
|||||||
// A sanity check
|
// A sanity check
|
||||||
if (secondaryMeasure && !m_PrimaryImageName.empty() && (m_OverlapImageName.empty() || m_SecondaryImageName.empty()))
|
if (secondaryMeasure && !m_PrimaryImageName.empty() && (m_OverlapImageName.empty() || m_SecondaryImageName.empty()))
|
||||||
{
|
{
|
||||||
CLogger::Warning(L"Histogram: SecondaryImage and BothImage not defined");
|
LogWarning(L"Histogram: SecondaryImage and BothImage not defined");
|
||||||
|
|
||||||
m_PrimaryImage.DisposeImage();
|
m_PrimaryImage.DisposeImage();
|
||||||
m_SecondaryImage.DisposeImage();
|
m_SecondaryImage.DisposeImage();
|
||||||
@ -262,7 +262,7 @@ void CMeterHistogram::ReadOptions(CConfigParser& parser, const WCHAR* section)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"GraphStart=%s is not valid in [%s]", graph, m_Name.c_str());
|
LogErrorF(L"GraphStart=%s is not valid in [%s]", graph, m_Name.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
graph = parser.ReadString(section, L"GraphOrientation", L"VERTICAL").c_str();
|
graph = parser.ReadString(section, L"GraphOrientation", L"VERTICAL").c_str();
|
||||||
@ -276,7 +276,7 @@ void CMeterHistogram::ReadOptions(CConfigParser& parser, const WCHAR* section)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"GraphOrientation=%s is not valid in [%s]", graph, m_Name.c_str());
|
LogErrorF(L"GraphOrientation=%s is not valid in [%s]", graph, m_Name.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_Initialized)
|
if (m_Initialized)
|
||||||
|
@ -159,7 +159,7 @@ void CMeterLine::ReadOptions(CConfigParser& parser, const WCHAR* section)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"GraphStart=%s is not valid in [%s]", graph, m_Name.c_str());
|
LogErrorF(L"GraphStart=%s is not valid in [%s]", graph, m_Name.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
graph = parser.ReadString(section, L"GraphOrientation", L"VERTICAL").c_str();
|
graph = parser.ReadString(section, L"GraphOrientation", L"VERTICAL").c_str();
|
||||||
@ -173,7 +173,7 @@ void CMeterLine::ReadOptions(CConfigParser& parser, const WCHAR* section)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"GraphOrientation=%s is not valid in [%s]", graph, m_Name.c_str());
|
LogErrorF(L"GraphOrientation=%s is not valid in [%s]", graph, m_Name.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_Initialized)
|
if (m_Initialized)
|
||||||
|
@ -201,7 +201,7 @@ void CMeterString::ReadOptions(CConfigParser& parser, const WCHAR* section)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
CLogger_ErrorF(L"ClipString=%s is not valid in [%s]", clipping, m_Name.c_str());
|
LogErrorF(L"ClipString=%s is not valid in [%s]", clipping, m_Name.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
m_FontFace = parser.ReadString(section, L"FontFace", L"Arial");
|
m_FontFace = parser.ReadString(section, L"FontFace", L"Arial");
|
||||||
@ -292,7 +292,7 @@ void CMeterString::ReadOptions(CConfigParser& parser, const WCHAR* section)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"StringCase=%s is not valid in [%s]", stringCase, m_Name.c_str());
|
LogErrorF(L"StringCase=%s is not valid in [%s]", stringCase, m_Name.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
const WCHAR* style = parser.ReadString(section, L"StringStyle", L"NORMAL").c_str();
|
const WCHAR* style = parser.ReadString(section, L"StringStyle", L"NORMAL").c_str();
|
||||||
@ -314,7 +314,7 @@ void CMeterString::ReadOptions(CConfigParser& parser, const WCHAR* section)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"StringStyle=%s is not valid in [%s]", style, m_Name.c_str());
|
LogErrorF(L"StringStyle=%s is not valid in [%s]", style, m_Name.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
const WCHAR* effect = parser.ReadString(section, L"StringEffect", L"NONE").c_str();
|
const WCHAR* effect = parser.ReadString(section, L"StringEffect", L"NONE").c_str();
|
||||||
@ -332,7 +332,7 @@ void CMeterString::ReadOptions(CConfigParser& parser, const WCHAR* section)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"StringEffect=%s is not valid in [%s]", effect, m_Name.c_str());
|
LogErrorF(L"StringEffect=%s is not valid in [%s]", effect, m_Name.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_Initialized &&
|
if (m_Initialized &&
|
||||||
@ -627,23 +627,23 @@ void CMeterString::EnumerateInstalledFontFamilies()
|
|||||||
}
|
}
|
||||||
fonts += L", ";
|
fonts += L", ";
|
||||||
}
|
}
|
||||||
CLogger::Warning(fonts.c_str());
|
LogWarning(fonts.c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogger::Error(L"Font enumeration: GetFamilies failed");
|
LogError(L"Font enumeration: GetFamilies failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
delete [] fontFamilies;
|
delete [] fontFamilies;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogger::Warning(L"No installed fonts");
|
LogWarning(L"No installed fonts");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogger::Error(L"Font enumeration: InstalledFontCollection failed");
|
LogError(L"Font enumeration: InstalledFontCollection failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -651,10 +651,10 @@ void CMeterString::InitializeStatic()
|
|||||||
{
|
{
|
||||||
if (Rainmeter->GetDebug())
|
if (Rainmeter->GetDebug())
|
||||||
{
|
{
|
||||||
CLogger::Debug(L"------------------------------");
|
LogDebug(L"------------------------------");
|
||||||
CLogger::Debug(L"* Font families:");
|
LogDebug(L"* Font families:");
|
||||||
EnumerateInstalledFontFamilies();
|
EnumerateInstalledFontFamilies();
|
||||||
CLogger::Debug(L"------------------------------");
|
LogDebug(L"------------------------------");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -410,7 +410,7 @@ void CMeterWindow::Refresh(bool init, bool all)
|
|||||||
notice += L'\\';
|
notice += L'\\';
|
||||||
notice += m_FileName;
|
notice += m_FileName;
|
||||||
notice += L'"';
|
notice += L'"';
|
||||||
CLogger::Notice(notice.c_str());
|
LogNotice(notice.c_str());
|
||||||
|
|
||||||
SetResizeWindowMode(RESIZEMODE_RESET);
|
SetResizeWindowMode(RESIZEMODE_RESET);
|
||||||
|
|
||||||
@ -911,7 +911,7 @@ void CMeterWindow::RunBang(BANGCOMMAND bang, const std::vector<std::wstring>& ar
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogger_WarningF(L"!CommandMeasure: [%s] not found", measure.c_str());
|
LogWarningF(L"!CommandMeasure: [%s] not found", measure.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -947,11 +947,11 @@ void CMeterWindow::RunBang(BANGCOMMAND bang, const std::vector<std::wstring>& ar
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CLogger_WarningF(L"!PluginBang: [%s] not found", measure.c_str());
|
LogWarningF(L"!PluginBang: [%s] not found", measure.c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogger::Error(L"!PluginBang: Invalid parameters");
|
LogError(L"!PluginBang: Invalid parameters");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1127,7 +1127,7 @@ void CMeterWindow::ShowMeter(const std::wstring& name, bool group)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!group) CLogger_ErrorF(L"!ShowMeter: [%s] not found in \"%s\"", meter, m_FolderPath.c_str());
|
if (!group) LogErrorF(L"!ShowMeter: [%s] not found in \"%s\"", meter, m_FolderPath.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1149,7 +1149,7 @@ void CMeterWindow::HideMeter(const std::wstring& name, bool group)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!group) CLogger_ErrorF(L"!HideMeter: [%s] not found in \"%s\"", meter, m_FolderPath.c_str());
|
if (!group) LogErrorF(L"!HideMeter: [%s] not found in \"%s\"", meter, m_FolderPath.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1178,7 +1178,7 @@ void CMeterWindow::ToggleMeter(const std::wstring& name, bool group)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!group) CLogger_ErrorF(L"!ToggleMeter: [%s] not found in \"%s\"", meter, m_FolderPath.c_str());
|
if (!group) LogErrorF(L"!ToggleMeter: [%s] not found in \"%s\"", meter, m_FolderPath.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1201,7 +1201,7 @@ void CMeterWindow::MoveMeter(const std::wstring& name, int x, int y)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CLogger_ErrorF(L"!MoveMeter: [%s] not found in \"%s\"", meter, m_FolderPath.c_str());
|
LogErrorF(L"!MoveMeter: [%s] not found in \"%s\"", meter, m_FolderPath.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1251,7 +1251,7 @@ void CMeterWindow::UpdateMeter(const std::wstring& name, bool group)
|
|||||||
// Post-updates
|
// Post-updates
|
||||||
PostUpdate(bActiveTransition);
|
PostUpdate(bActiveTransition);
|
||||||
|
|
||||||
if (!group && bContinue) CLogger_ErrorF(L"!UpdateMeter: [%s] not found in \"%s\"", meter, m_FolderPath.c_str());
|
if (!group && bContinue) LogErrorF(L"!UpdateMeter: [%s] not found in \"%s\"", meter, m_FolderPath.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1272,7 +1272,7 @@ void CMeterWindow::EnableMeasure(const std::wstring& name, bool group)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!group) CLogger_ErrorF(L"!EnableMeasure: [%s] not found in \"%s\"", measure, m_FolderPath.c_str());
|
if (!group) LogErrorF(L"!EnableMeasure: [%s] not found in \"%s\"", measure, m_FolderPath.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1293,7 +1293,7 @@ void CMeterWindow::DisableMeasure(const std::wstring& name, bool group)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!group) CLogger_ErrorF(L"!DisableMeasure: [%s] not found in \"%s\"", measure, m_FolderPath.c_str());
|
if (!group) LogErrorF(L"!DisableMeasure: [%s] not found in \"%s\"", measure, m_FolderPath.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1321,7 +1321,7 @@ void CMeterWindow::ToggleMeasure(const std::wstring& name, bool group)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!group) CLogger_ErrorF(L"!ToggleMeasure: [%s] not found in \"%s\"", measure, m_FolderPath.c_str());
|
if (!group) LogErrorF(L"!ToggleMeasure: [%s] not found in \"%s\"", measure, m_FolderPath.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1361,7 +1361,7 @@ void CMeterWindow::UpdateMeasure(const std::wstring& name, bool group)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!group) CLogger_ErrorF(L"!UpdateMeasure: [%s] not found in \"%s\"", measure, m_FolderPath.c_str());
|
if (!group) LogErrorF(L"!UpdateMeasure: [%s] not found in \"%s\"", measure, m_FolderPath.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2109,7 +2109,7 @@ bool CMeterWindow::ReadSkin()
|
|||||||
{
|
{
|
||||||
std::wstring error = L"Unable to load font: ";
|
std::wstring error = L"Unable to load font: ";
|
||||||
error += file.c_str();
|
error += file.c_str();
|
||||||
CLogger::Error(error.c_str());
|
LogError(error.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2142,7 +2142,7 @@ bool CMeterWindow::ReadSkin()
|
|||||||
{
|
{
|
||||||
std::wstring error = L"Unable to load font: ";
|
std::wstring error = L"Unable to load font: ";
|
||||||
error += localFont;
|
error += localFont;
|
||||||
CLogger::Error(error.c_str());
|
LogError(error.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4348,7 +4348,7 @@ bool CMeterWindow::DoMoveAction(int x, int y, MOUSEACTION action)
|
|||||||
if (!m_MouseOver)
|
if (!m_MouseOver)
|
||||||
{
|
{
|
||||||
// If the mouse is over a meter it's also over the main window
|
// If the mouse is over a meter it's also over the main window
|
||||||
//CLogger_DebugF(L"@Enter: %s", m_FolderPath.c_str());
|
//LogDebugF(L"@Enter: %s", m_FolderPath.c_str());
|
||||||
m_MouseOver = true;
|
m_MouseOver = true;
|
||||||
SetMouseLeaveEvent(false);
|
SetMouseLeaveEvent(false);
|
||||||
RegisterMouseInput();
|
RegisterMouseInput();
|
||||||
@ -4387,7 +4387,7 @@ bool CMeterWindow::DoMoveAction(int x, int y, MOUSEACTION action)
|
|||||||
!mouse.GetLeaveAction().empty() ||
|
!mouse.GetLeaveAction().empty() ||
|
||||||
button)
|
button)
|
||||||
{
|
{
|
||||||
//CLogger_DebugF(L"MeterEnter: %s - [%s]", m_FolderPath.c_str(), (*j)->GetName());
|
//LogDebugF(L"MeterEnter: %s - [%s]", m_FolderPath.c_str(), (*j)->GetName());
|
||||||
(*j)->SetMouseOver(true);
|
(*j)->SetMouseOver(true);
|
||||||
|
|
||||||
if (!mouse.GetOverAction().empty())
|
if (!mouse.GetOverAction().empty())
|
||||||
@ -4413,7 +4413,7 @@ bool CMeterWindow::DoMoveAction(int x, int y, MOUSEACTION action)
|
|||||||
button->SetFocus(false);
|
button->SetFocus(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
//CLogger_DebugF(L"MeterLeave: %s - [%s]", m_FolderPath.c_str(), (*j)->GetName());
|
//LogDebugF(L"MeterLeave: %s - [%s]", m_FolderPath.c_str(), (*j)->GetName());
|
||||||
(*j)->SetMouseOver(false);
|
(*j)->SetMouseOver(false);
|
||||||
|
|
||||||
const CMouse& mouse = (*j)->GetMouse();
|
const CMouse& mouse = (*j)->GetMouse();
|
||||||
@ -4434,7 +4434,7 @@ bool CMeterWindow::DoMoveAction(int x, int y, MOUSEACTION action)
|
|||||||
{
|
{
|
||||||
if (!m_MouseOver)
|
if (!m_MouseOver)
|
||||||
{
|
{
|
||||||
//CLogger_DebugF(L"Enter: %s", m_FolderPath.c_str());
|
//LogDebugF(L"Enter: %s", m_FolderPath.c_str());
|
||||||
m_MouseOver = true;
|
m_MouseOver = true;
|
||||||
SetMouseLeaveEvent(false);
|
SetMouseLeaveEvent(false);
|
||||||
RegisterMouseInput();
|
RegisterMouseInput();
|
||||||
@ -4455,7 +4455,7 @@ bool CMeterWindow::DoMoveAction(int x, int y, MOUSEACTION action)
|
|||||||
// Mouse leave happens when the mouse is outside the window
|
// Mouse leave happens when the mouse is outside the window
|
||||||
if (m_MouseOver)
|
if (m_MouseOver)
|
||||||
{
|
{
|
||||||
//CLogger_DebugF(L"Leave: %s", m_FolderPath.c_str());
|
//LogDebugF(L"Leave: %s", m_FolderPath.c_str());
|
||||||
m_MouseOver = false;
|
m_MouseOver = false;
|
||||||
SetMouseLeaveEvent(true);
|
SetMouseLeaveEvent(true);
|
||||||
UnregisterMouseInput();
|
UnregisterMouseInput();
|
||||||
@ -4670,7 +4670,7 @@ LRESULT CMeterWindow::OnCopyData(UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// This meterwindow has been deactivated
|
// This meterwindow has been deactivated
|
||||||
CLogger::Warning(L"Unable to bang unloaded skin");
|
LogWarning(L"Unable to bang unloaded skin");
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -130,7 +130,7 @@ void CMouse::ReadOptions(CConfigParser& parser, const WCHAR* section)
|
|||||||
if (!m_CustomCursor)
|
if (!m_CustomCursor)
|
||||||
{
|
{
|
||||||
m_CursorType = MOUSECURSOR_ARROW;
|
m_CursorType = MOUSECURSOR_ARROW;
|
||||||
CLogger_ErrorF(L"Invalid cursor: %s", cursorPath.c_str());
|
LogErrorF(L"Invalid cursor: %s", cursorPath.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -238,7 +238,7 @@ void CRainmeter::BangWithArgs(BANGCOMMAND bang, std::vector<std::wstring>& args,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogger_ErrorF( L"Bang: Skin \"%s\" not found", folderPath.c_str());
|
LogErrorF( L"Bang: Skin \"%s\" not found", folderPath.c_str());
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -265,13 +265,13 @@ void CRainmeter::BangWithArgs(BANGCOMMAND bang, std::vector<std::wstring>& args,
|
|||||||
firstArg.erase(0, pos + 1);
|
firstArg.erase(0, pos + 1);
|
||||||
args.insert(args.begin(), newArg);
|
args.insert(args.begin(), newArg);
|
||||||
|
|
||||||
CLogger::Warning(L"!CommandMeasure: Two parameters required, only one given");
|
LogWarning(L"!CommandMeasure: Two parameters required, only one given");
|
||||||
BangWithArgs(bang, args, numOfArgs, meterWindow);
|
BangWithArgs(bang, args, numOfArgs, meterWindow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CLogger::Error(L"Bang: Incorrect number of arguments");
|
LogError(L"Bang: Incorrect number of arguments");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -296,7 +296,7 @@ void CRainmeter::BangGroupWithArgs(BANGCOMMAND bang, std::vector<std::wstring>&
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogger::Error(L"BangGroup: Incorrect number of arguments");
|
LogError(L"BangGroup: Incorrect number of arguments");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -330,7 +330,7 @@ void CRainmeter::Bang_ActivateSkin(std::vector<std::wstring>& args)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CLogger::Error(L"!ActivateConfig: Invalid parameters");
|
LogError(L"!ActivateConfig: Invalid parameters");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -344,7 +344,7 @@ void CRainmeter::Bang_DeactivateSkin(std::vector<std::wstring>& args, CMeterWind
|
|||||||
meterWindow = GetMeterWindow(args[0]);
|
meterWindow = GetMeterWindow(args[0]);
|
||||||
if (!meterWindow)
|
if (!meterWindow)
|
||||||
{
|
{
|
||||||
CLogger_WarningF(L"!DeactivateConfig: \"%s\" not active", args[0].c_str());
|
LogWarningF(L"!DeactivateConfig: \"%s\" not active", args[0].c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -355,7 +355,7 @@ void CRainmeter::Bang_DeactivateSkin(std::vector<std::wstring>& args, CMeterWind
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogger::Error(L"!DeactivateConfig: Invalid parameters");
|
LogError(L"!DeactivateConfig: Invalid parameters");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -379,7 +379,7 @@ void CRainmeter::Bang_ToggleSkin(std::vector<std::wstring>& args)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogger::Error(L"!ToggleConfig: Invalid parameters");
|
LogError(L"!ToggleConfig: Invalid parameters");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -402,7 +402,7 @@ void CRainmeter::Bang_DeactivateSkinGroup(std::vector<std::wstring>& args)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogger::Error(L"!DeactivateConfigGroup: Invalid parameters");
|
LogError(L"!DeactivateConfigGroup: Invalid parameters");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -442,7 +442,7 @@ void CRainmeter::Bang_SetClip(std::vector<std::wstring>& args)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogger::Error(L"!SetClip: Invalid parameter");
|
LogError(L"!SetClip: Invalid parameter");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -467,7 +467,7 @@ void CRainmeter::Bang_SetWallpaper(std::vector<std::wstring>& args, CMeterWindow
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogger::Error(L"!SetWallpaper: Invalid parameters");
|
LogError(L"!SetWallpaper: Invalid parameters");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -482,7 +482,7 @@ void CRainmeter::Bang_SkinMenu(std::vector<std::wstring>& args, CMeterWindow* me
|
|||||||
meterWindow = GetMeterWindow(args[0]);
|
meterWindow = GetMeterWindow(args[0]);
|
||||||
if (!meterWindow)
|
if (!meterWindow)
|
||||||
{
|
{
|
||||||
CLogger_WarningF(L"!SkinMenu: \"%s\" not active", args[0].c_str());
|
LogWarningF(L"!SkinMenu: \"%s\" not active", args[0].c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -494,7 +494,7 @@ void CRainmeter::Bang_SkinMenu(std::vector<std::wstring>& args, CMeterWindow* me
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogger::Error(L"!SkinMenu: Invalid parameter");
|
LogError(L"!SkinMenu: Invalid parameter");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -521,7 +521,7 @@ void CRainmeter::Bang_WriteKeyValue(std::vector<std::wstring>& args, CMeterWindo
|
|||||||
}
|
}
|
||||||
else if (args.size() < 4)
|
else if (args.size() < 4)
|
||||||
{
|
{
|
||||||
CLogger::Error(L"!WriteKeyValue: Invalid parameters");
|
LogError(L"!WriteKeyValue: Invalid parameters");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -535,21 +535,21 @@ void CRainmeter::Bang_WriteKeyValue(std::vector<std::wstring>& args, CMeterWindo
|
|||||||
|
|
||||||
if (strIniFile.find(L"..\\") != std::wstring::npos || strIniFile.find(L"../") != std::wstring::npos)
|
if (strIniFile.find(L"..\\") != std::wstring::npos || strIniFile.find(L"../") != std::wstring::npos)
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"!WriteKeyValue: Illegal path: %s", iniFile);
|
LogErrorF(L"!WriteKeyValue: Illegal path: %s", iniFile);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_wcsnicmp(iniFile, m_SkinPath.c_str(), m_SkinPath.size()) != 0 &&
|
if (_wcsnicmp(iniFile, m_SkinPath.c_str(), m_SkinPath.size()) != 0 &&
|
||||||
_wcsnicmp(iniFile, m_SettingsPath.c_str(), m_SettingsPath.size()) != 0)
|
_wcsnicmp(iniFile, m_SettingsPath.c_str(), m_SettingsPath.size()) != 0)
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"!WriteKeyValue: Illegal path: %s", iniFile);
|
LogErrorF(L"!WriteKeyValue: Illegal path: %s", iniFile);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verify whether the file exists
|
// Verify whether the file exists
|
||||||
if (_waccess(iniFile, 0) == -1)
|
if (_waccess(iniFile, 0) == -1)
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"!WriteKeyValue: File not found: %s", iniFile);
|
LogErrorF(L"!WriteKeyValue: File not found: %s", iniFile);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -557,7 +557,7 @@ void CRainmeter::Bang_WriteKeyValue(std::vector<std::wstring>& args, CMeterWindo
|
|||||||
DWORD attr = GetFileAttributes(iniFile);
|
DWORD attr = GetFileAttributes(iniFile);
|
||||||
if (attr == -1 || (attr & FILE_ATTRIBUTE_READONLY))
|
if (attr == -1 || (attr & FILE_ATTRIBUTE_READONLY))
|
||||||
{
|
{
|
||||||
CLogger_WarningF(L"!WriteKeyValue: File is read-only: %s", iniFile);
|
LogWarningF(L"!WriteKeyValue: File is read-only: %s", iniFile);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -573,11 +573,11 @@ void CRainmeter::Bang_WriteKeyValue(std::vector<std::wstring>& args, CMeterWindo
|
|||||||
|
|
||||||
if (temporary)
|
if (temporary)
|
||||||
{
|
{
|
||||||
if (GetDebug()) CLogger_DebugF(L"!WriteKeyValue: Writing to: %s (Temp: %s)", iniFile, strIniWrite.c_str());
|
if (GetDebug()) LogDebugF(L"!WriteKeyValue: Writing to: %s (Temp: %s)", iniFile, strIniWrite.c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (GetDebug()) CLogger_DebugF(L"!WriteKeyValue: Writing to: %s", iniFile);
|
if (GetDebug()) LogDebugF(L"!WriteKeyValue: Writing to: %s", iniFile);
|
||||||
strIniWrite = strIniFile;
|
strIniWrite = strIniFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -619,12 +619,12 @@ void CRainmeter::Bang_WriteKeyValue(std::vector<std::wstring>& args, CMeterWindo
|
|||||||
// Copy the file back
|
// Copy the file back
|
||||||
if (!CSystem::CopyFiles(strIniWrite, strIniFile))
|
if (!CSystem::CopyFiles(strIniWrite, strIniFile))
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"!WriteKeyValue: Failed to copy temporary file to original filepath: %s (Temp: %s)", iniFile, iniWrite);
|
LogErrorF(L"!WriteKeyValue: Failed to copy temporary file to original filepath: %s (Temp: %s)", iniFile, iniWrite);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // failed
|
else // failed
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"!WriteKeyValue: Failed to write to: %s (Temp: %s)", iniFile, iniWrite);
|
LogErrorF(L"!WriteKeyValue: Failed to write to: %s (Temp: %s)", iniFile, iniWrite);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove a temporary file
|
// Remove a temporary file
|
||||||
@ -634,7 +634,7 @@ void CRainmeter::Bang_WriteKeyValue(std::vector<std::wstring>& args, CMeterWindo
|
|||||||
{
|
{
|
||||||
if (write == 0) // failed
|
if (write == 0) // failed
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"!WriteKeyValue: Failed to write to: %s", iniFile);
|
LogErrorF(L"!WriteKeyValue: Failed to write to: %s", iniFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -665,7 +665,7 @@ void CRainmeter::Bang_Log(std::vector<std::wstring>& args)
|
|||||||
}
|
}
|
||||||
else if (_wcsicmp(type, L"NOTICE") != 0)
|
else if (_wcsicmp(type, L"NOTICE") != 0)
|
||||||
{
|
{
|
||||||
CLogger::Error(L"!Log: Invalid type");
|
LogError(L"!Log: Invalid type");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -958,9 +958,9 @@ int CRainmeter::Initialize(LPCWSTR iniPath, LPCWSTR layout)
|
|||||||
delete [] buffer;
|
delete [] buffer;
|
||||||
buffer = NULL;
|
buffer = NULL;
|
||||||
|
|
||||||
CLogger_NoticeF(L"Path: %s", m_Path.c_str());
|
LogNoticeF(L"Path: %s", m_Path.c_str());
|
||||||
CLogger_NoticeF(L"IniFile: %s", iniFile);
|
LogNoticeF(L"IniFile: %s", iniFile);
|
||||||
CLogger_NoticeF(L"SkinPath: %s", m_SkinPath.c_str());
|
LogNoticeF(L"SkinPath: %s", m_SkinPath.c_str());
|
||||||
|
|
||||||
// Extract volume path from program path
|
// Extract volume path from program path
|
||||||
// E.g.:
|
// E.g.:
|
||||||
@ -1416,7 +1416,7 @@ void CRainmeter::ActivateSkin(int folderIndex, int fileIndex)
|
|||||||
{
|
{
|
||||||
if (wcscmp(((*iter).second)->GetFileName().c_str(), fileSz) == 0)
|
if (wcscmp(((*iter).second)->GetFileName().c_str(), fileSz) == 0)
|
||||||
{
|
{
|
||||||
CLogger_WarningF(L"!ActivateConfig: \"%s\" already active", folderPath.c_str());
|
LogWarningF(L"!ActivateConfig: \"%s\" already active", folderPath.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2279,7 +2279,7 @@ void CRainmeter::ExecuteBang(const WCHAR* bang, std::vector<std::wstring>& args,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"Invalid bang: !%s", bang);
|
LogErrorF(L"Invalid bang: !%s", bang);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2486,7 +2486,7 @@ void CRainmeter::ReadGeneralSettings(const std::wstring& iniFile)
|
|||||||
|
|
||||||
if (m_Debug)
|
if (m_Debug)
|
||||||
{
|
{
|
||||||
CLogger_NoticeF(L"ConfigEditor: %s", m_SkinEditor.c_str());
|
LogNoticeF(L"ConfigEditor: %s", m_SkinEditor.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
m_TrayExecuteR = parser.ReadString(L"Rainmeter", L"TrayExecuteR", L"", false);
|
m_TrayExecuteR = parser.ReadString(L"Rainmeter", L"TrayExecuteR", L"", false);
|
||||||
@ -2731,7 +2731,7 @@ void CRainmeter::UpdateDesktopWorkArea(bool reset)
|
|||||||
{
|
{
|
||||||
format += L" => FAIL";
|
format += L" => FAIL";
|
||||||
}
|
}
|
||||||
CLogger_DebugF(format.c_str(), i, r.left, r.top, r.right, r.bottom, r.right - r.left, r.bottom - r.top);
|
LogDebugF(format.c_str(), i, r.left, r.top, r.right, r.bottom, r.right - r.left, r.bottom - r.top);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
changed = true;
|
changed = true;
|
||||||
@ -2754,7 +2754,7 @@ void CRainmeter::UpdateDesktopWorkArea(bool reset)
|
|||||||
|
|
||||||
if (m_Debug)
|
if (m_Debug)
|
||||||
{
|
{
|
||||||
CLogger_DebugF(L"DesktopWorkAreaType: %s", m_DesktopWorkAreaType ? L"Margin" : L"Default");
|
LogDebugF(L"DesktopWorkAreaType: %s", m_DesktopWorkAreaType ? L"Margin" : L"Default");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (UINT i = 0; i <= numOfMonitors; ++i)
|
for (UINT i = 0; i <= numOfMonitors; ++i)
|
||||||
@ -2806,7 +2806,7 @@ void CRainmeter::UpdateDesktopWorkArea(bool reset)
|
|||||||
{
|
{
|
||||||
format += L" => FAIL";
|
format += L" => FAIL";
|
||||||
}
|
}
|
||||||
CLogger_DebugF(format.c_str(), r.left, r.top, r.right, r.bottom, r.right - r.left, r.bottom - r.top);
|
LogDebugF(format.c_str(), r.left, r.top, r.right, r.bottom, r.right - r.left, r.bottom - r.top);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3609,7 +3609,7 @@ void CRainmeter::ExpandEnvironmentVariables(std::wstring& strPath)
|
|||||||
DWORD ret = ExpandEnvironmentStrings(strPath.c_str(), buffer, bufSize);
|
DWORD ret = ExpandEnvironmentStrings(strPath.c_str(), buffer, bufSize);
|
||||||
if (ret == 0) // Error
|
if (ret == 0) // Error
|
||||||
{
|
{
|
||||||
CLogger_WarningF(L"Unable to expand environment strings in: %s", strPath.c_str());
|
LogWarningF(L"Unable to expand environment strings in: %s", strPath.c_str());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (ret <= bufSize) // Fits in the buffer
|
if (ret <= bufSize) // Fits in the buffer
|
||||||
|
@ -161,13 +161,13 @@ BOOL CALLBACK MyInfoEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprcMonit
|
|||||||
|
|
||||||
if (Rainmeter->GetDebug())
|
if (Rainmeter->GetDebug())
|
||||||
{
|
{
|
||||||
CLogger::Debug(info.szDevice);
|
LogDebug(info.szDevice);
|
||||||
CLogger_DebugF(L" Flags : %s(0x%08X)", (info.dwFlags & MONITORINFOF_PRIMARY) ? L"PRIMARY " : L"", info.dwFlags);
|
LogDebugF(L" Flags : %s(0x%08X)", (info.dwFlags & MONITORINFOF_PRIMARY) ? L"PRIMARY " : L"", info.dwFlags);
|
||||||
CLogger_DebugF(L" Handle : 0x%p", hMonitor);
|
LogDebugF(L" Handle : 0x%p", hMonitor);
|
||||||
CLogger_DebugF(L" ScrArea : L=%i, T=%i, R=%i, B=%i (W=%i, H=%i)",
|
LogDebugF(L" ScrArea : L=%i, T=%i, R=%i, B=%i (W=%i, H=%i)",
|
||||||
lprcMonitor->left, lprcMonitor->top, lprcMonitor->right, lprcMonitor->bottom,
|
lprcMonitor->left, lprcMonitor->top, lprcMonitor->right, lprcMonitor->bottom,
|
||||||
lprcMonitor->right - lprcMonitor->left, lprcMonitor->bottom - lprcMonitor->top);
|
lprcMonitor->right - lprcMonitor->left, lprcMonitor->bottom - lprcMonitor->top);
|
||||||
CLogger_DebugF(L" WorkArea : L=%i, T=%i, R=%i, B=%i (W=%i, H=%i)",
|
LogDebugF(L" WorkArea : L=%i, T=%i, R=%i, B=%i (W=%i, H=%i)",
|
||||||
info.rcWork.left, info.rcWork.top, info.rcWork.right, info.rcWork.bottom,
|
info.rcWork.left, info.rcWork.top, info.rcWork.right, info.rcWork.bottom,
|
||||||
info.rcWork.right - info.rcWork.left, info.rcWork.bottom - info.rcWork.top);
|
info.rcWork.right - info.rcWork.left, info.rcWork.bottom - info.rcWork.top);
|
||||||
}
|
}
|
||||||
@ -255,8 +255,8 @@ void CSystem::SetMultiMonitorInfo()
|
|||||||
|
|
||||||
if (logging)
|
if (logging)
|
||||||
{
|
{
|
||||||
CLogger::Debug(L"------------------------------");
|
LogDebug(L"------------------------------");
|
||||||
CLogger::Debug(L"* EnumDisplayDevices / EnumDisplaySettings API");
|
LogDebug(L"* EnumDisplayDevices / EnumDisplaySettings API");
|
||||||
}
|
}
|
||||||
|
|
||||||
DISPLAY_DEVICE dd = {sizeof(DISPLAY_DEVICE)};
|
DISPLAY_DEVICE dd = {sizeof(DISPLAY_DEVICE)};
|
||||||
@ -276,7 +276,7 @@ void CSystem::SetMultiMonitorInfo()
|
|||||||
{
|
{
|
||||||
deviceString.assign(dd.DeviceString, wcsnlen(dd.DeviceString, _countof(dd.DeviceString)));
|
deviceString.assign(dd.DeviceString, wcsnlen(dd.DeviceString, _countof(dd.DeviceString)));
|
||||||
|
|
||||||
CLogger::Debug(deviceName.c_str());
|
LogDebug(deviceName.c_str());
|
||||||
|
|
||||||
if (dd.StateFlags & DISPLAY_DEVICE_ACTIVE)
|
if (dd.StateFlags & DISPLAY_DEVICE_ACTIVE)
|
||||||
{
|
{
|
||||||
@ -334,7 +334,7 @@ void CSystem::SetMultiMonitorInfo()
|
|||||||
|
|
||||||
if (logging)
|
if (logging)
|
||||||
{
|
{
|
||||||
CLogger_DebugF(L" Name : %s", monitor.monitorName.c_str());
|
LogDebugF(L" Name : %s", monitor.monitorName.c_str());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -342,8 +342,8 @@ void CSystem::SetMultiMonitorInfo()
|
|||||||
|
|
||||||
if (logging)
|
if (logging)
|
||||||
{
|
{
|
||||||
CLogger_DebugF(L" Adapter : %s", deviceString.c_str());
|
LogDebugF(L" Adapter : %s", deviceString.c_str());
|
||||||
CLogger_DebugF(L" Flags : %s(0x%08X)", msg.c_str(), dd.StateFlags);
|
LogDebugF(L" Flags : %s(0x%08X)", msg.c_str(), dd.StateFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dd.StateFlags & DISPLAY_DEVICE_ACTIVE)
|
if (dd.StateFlags & DISPLAY_DEVICE_ACTIVE)
|
||||||
@ -360,7 +360,7 @@ void CSystem::SetMultiMonitorInfo()
|
|||||||
|
|
||||||
if (logging)
|
if (logging)
|
||||||
{
|
{
|
||||||
CLogger_DebugF(L" Handle : 0x%p", monitor.handle);
|
LogDebugF(L" Handle : 0x%p", monitor.handle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -374,10 +374,10 @@ void CSystem::SetMultiMonitorInfo()
|
|||||||
|
|
||||||
if (logging)
|
if (logging)
|
||||||
{
|
{
|
||||||
CLogger_DebugF(L" ScrArea : L=%i, T=%i, R=%i, B=%i (W=%i, H=%i)",
|
LogDebugF(L" ScrArea : L=%i, T=%i, R=%i, B=%i (W=%i, H=%i)",
|
||||||
info.rcMonitor.left, info.rcMonitor.top, info.rcMonitor.right, info.rcMonitor.bottom,
|
info.rcMonitor.left, info.rcMonitor.top, info.rcMonitor.right, info.rcMonitor.bottom,
|
||||||
info.rcMonitor.right - info.rcMonitor.left, info.rcMonitor.bottom - info.rcMonitor.top);
|
info.rcMonitor.right - info.rcMonitor.left, info.rcMonitor.bottom - info.rcMonitor.top);
|
||||||
CLogger_DebugF(L" WorkArea : L=%i, T=%i, R=%i, B=%i (W=%i, H=%i)",
|
LogDebugF(L" WorkArea : L=%i, T=%i, R=%i, B=%i (W=%i, H=%i)",
|
||||||
info.rcWork.left, info.rcWork.top, info.rcWork.right, info.rcWork.bottom,
|
info.rcWork.left, info.rcWork.top, info.rcWork.right, info.rcWork.bottom,
|
||||||
info.rcWork.right - info.rcWork.left, info.rcWork.bottom - info.rcWork.top);
|
info.rcWork.right - info.rcWork.left, info.rcWork.bottom - info.rcWork.top);
|
||||||
}
|
}
|
||||||
@ -404,8 +404,8 @@ void CSystem::SetMultiMonitorInfo()
|
|||||||
{
|
{
|
||||||
if (logging)
|
if (logging)
|
||||||
{
|
{
|
||||||
CLogger_DebugF(L" Adapter : %s", deviceString.c_str());
|
LogDebugF(L" Adapter : %s", deviceString.c_str());
|
||||||
CLogger_DebugF(L" Flags : %s(0x%08X)", msg.c_str(), dd.StateFlags);
|
LogDebugF(L" Flags : %s(0x%08X)", msg.c_str(), dd.StateFlags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
++dwDevice;
|
++dwDevice;
|
||||||
@ -415,15 +415,15 @@ void CSystem::SetMultiMonitorInfo()
|
|||||||
|
|
||||||
if (monitors.empty()) // Failed to enumerate the non-mirroring monitors
|
if (monitors.empty()) // Failed to enumerate the non-mirroring monitors
|
||||||
{
|
{
|
||||||
CLogger::Warning(L"Failed to enumerate the non-mirroring monitors. Only EnumDisplayMonitors is used instead.");
|
LogWarning(L"Failed to enumerate the non-mirroring monitors. Only EnumDisplayMonitors is used instead.");
|
||||||
c_Monitors.useEnumDisplayDevices = false;
|
c_Monitors.useEnumDisplayDevices = false;
|
||||||
c_Monitors.useEnumDisplayMonitors = true;
|
c_Monitors.useEnumDisplayMonitors = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (logging)
|
if (logging)
|
||||||
{
|
{
|
||||||
CLogger::Debug(L"------------------------------");
|
LogDebug(L"------------------------------");
|
||||||
CLogger::Debug(L"* EnumDisplayMonitors API");
|
LogDebug(L"* EnumDisplayMonitors API");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c_Monitors.useEnumDisplayMonitors)
|
if (c_Monitors.useEnumDisplayMonitors)
|
||||||
@ -432,7 +432,7 @@ void CSystem::SetMultiMonitorInfo()
|
|||||||
|
|
||||||
if (monitors.empty()) // Failed to enumerate the monitors
|
if (monitors.empty()) // Failed to enumerate the monitors
|
||||||
{
|
{
|
||||||
CLogger::Warning(L"Failed to enumerate monitors. Using dummy monitor info.");
|
LogWarning(L"Failed to enumerate monitors. Using dummy monitor info.");
|
||||||
c_Monitors.useEnumDisplayMonitors = false;
|
c_Monitors.useEnumDisplayMonitors = false;
|
||||||
|
|
||||||
MonitorInfo monitor;
|
MonitorInfo monitor;
|
||||||
@ -466,7 +466,7 @@ void CSystem::SetMultiMonitorInfo()
|
|||||||
|
|
||||||
if (logging)
|
if (logging)
|
||||||
{
|
{
|
||||||
CLogger::Debug(L"------------------------------");
|
LogDebug(L"------------------------------");
|
||||||
|
|
||||||
std::wstring method = L"* METHOD: ";
|
std::wstring method = L"* METHOD: ";
|
||||||
if (c_Monitors.useEnumDisplayDevices)
|
if (c_Monitors.useEnumDisplayDevices)
|
||||||
@ -478,11 +478,11 @@ void CSystem::SetMultiMonitorInfo()
|
|||||||
{
|
{
|
||||||
method += c_Monitors.useEnumDisplayMonitors ? L"EnumDisplayMonitors Mode" : L"Dummy Mode";
|
method += c_Monitors.useEnumDisplayMonitors ? L"EnumDisplayMonitors Mode" : L"Dummy Mode";
|
||||||
}
|
}
|
||||||
CLogger::Debug(method.c_str());
|
LogDebug(method.c_str());
|
||||||
|
|
||||||
CLogger_DebugF(L"* MONITORS: Count=%i, Primary=@%i", (int)monitors.size(), c_Monitors.primary);
|
LogDebugF(L"* MONITORS: Count=%i, Primary=@%i", (int)monitors.size(), c_Monitors.primary);
|
||||||
CLogger::Debug(L"@0: Virtual screen");
|
LogDebug(L"@0: Virtual screen");
|
||||||
CLogger_DebugF(L" L=%i, T=%i, R=%i, B=%i (W=%i, H=%i)",
|
LogDebugF(L" L=%i, T=%i, R=%i, B=%i (W=%i, H=%i)",
|
||||||
c_Monitors.vsL, c_Monitors.vsT, c_Monitors.vsL + c_Monitors.vsW, c_Monitors.vsT + c_Monitors.vsH,
|
c_Monitors.vsL, c_Monitors.vsT, c_Monitors.vsL + c_Monitors.vsW, c_Monitors.vsT + c_Monitors.vsH,
|
||||||
c_Monitors.vsW, c_Monitors.vsH);
|
c_Monitors.vsW, c_Monitors.vsH);
|
||||||
|
|
||||||
@ -491,17 +491,17 @@ void CSystem::SetMultiMonitorInfo()
|
|||||||
{
|
{
|
||||||
if ((*iter).active)
|
if ((*iter).active)
|
||||||
{
|
{
|
||||||
CLogger_DebugF(L"@%i: %s (active), MonitorName: %s", i, (*iter).deviceName.c_str(), (*iter).monitorName.c_str());
|
LogDebugF(L"@%i: %s (active), MonitorName: %s", i, (*iter).deviceName.c_str(), (*iter).monitorName.c_str());
|
||||||
CLogger_DebugF(L" L=%i, T=%i, R=%i, B=%i (W=%i, H=%i)",
|
LogDebugF(L" L=%i, T=%i, R=%i, B=%i (W=%i, H=%i)",
|
||||||
(*iter).screen.left, (*iter).screen.top, (*iter).screen.right, (*iter).screen.bottom,
|
(*iter).screen.left, (*iter).screen.top, (*iter).screen.right, (*iter).screen.bottom,
|
||||||
(*iter).screen.right - (*iter).screen.left, (*iter).screen.bottom - (*iter).screen.top);
|
(*iter).screen.right - (*iter).screen.left, (*iter).screen.bottom - (*iter).screen.top);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogger_DebugF(L"@%i: %s (inactive), MonitorName: %s", i, (*iter).deviceName.c_str(), (*iter).monitorName.c_str());
|
LogDebugF(L"@%i: %s (inactive), MonitorName: %s", i, (*iter).deviceName.c_str(), (*iter).monitorName.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CLogger::Debug(L"------------------------------");
|
LogDebug(L"------------------------------");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -531,7 +531,7 @@ void CSystem::UpdateWorkareaInfo()
|
|||||||
|
|
||||||
if (Rainmeter->GetDebug())
|
if (Rainmeter->GetDebug())
|
||||||
{
|
{
|
||||||
CLogger_DebugF(L"WorkArea@%i : L=%i, T=%i, R=%i, B=%i (W=%i, H=%i)",
|
LogDebugF(L"WorkArea@%i : L=%i, T=%i, R=%i, B=%i (W=%i, H=%i)",
|
||||||
i,
|
i,
|
||||||
info.rcWork.left, info.rcWork.top, info.rcWork.right, info.rcWork.bottom,
|
info.rcWork.left, info.rcWork.top, info.rcWork.right, info.rcWork.bottom,
|
||||||
info.rcWork.right - info.rcWork.left, info.rcWork.bottom - info.rcWork.top);
|
info.rcWork.right - info.rcWork.left, info.rcWork.bottom - info.rcWork.top);
|
||||||
@ -696,7 +696,7 @@ BOOL CALLBACK MyEnumWindowsProc(HWND hwnd, LPARAM lParam)
|
|||||||
|
|
||||||
if (logging)
|
if (logging)
|
||||||
{
|
{
|
||||||
CLogger_DebugF(L"%c [%c] 0x%p : %s (Name: \"%s\", zPos=%i)",
|
LogDebugF(L"%c [%c] 0x%p : %s (Name: \"%s\", zPos=%i)",
|
||||||
flag, IsWindowVisible(hwnd) ? L'V' : L'H', hwnd, className, Window->GetFolderPath().c_str(), (int)zPos);
|
flag, IsWindowVisible(hwnd) ? L'V' : L'H', hwnd, className, Window->GetFolderPath().c_str(), (int)zPos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -705,7 +705,7 @@ BOOL CALLBACK MyEnumWindowsProc(HWND hwnd, LPARAM lParam)
|
|||||||
if (logging)
|
if (logging)
|
||||||
{
|
{
|
||||||
flag = (hwnd == CSystem::GetHelperWindow()) ? L'o' : ' ';
|
flag = (hwnd == CSystem::GetHelperWindow()) ? L'o' : ' ';
|
||||||
CLogger_DebugF(L"%c [%c] 0x%p : %s", flag, IsWindowVisible(hwnd) ? L'V' : L'H', hwnd, className);
|
LogDebugF(L"%c [%c] 0x%p : %s", flag, IsWindowVisible(hwnd) ? L'V' : L'H', hwnd, className);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -721,7 +721,7 @@ void CSystem::ChangeZPosInOrder()
|
|||||||
bool logging = Rainmeter->GetDebug() && DEBUG_VERBOSE;
|
bool logging = Rainmeter->GetDebug() && DEBUG_VERBOSE;
|
||||||
std::vector<CMeterWindow*> windowsInZOrder;
|
std::vector<CMeterWindow*> windowsInZOrder;
|
||||||
|
|
||||||
if (logging) CLogger::Debug(L"1: ----- BEFORE -----");
|
if (logging) LogDebug(L"1: ----- BEFORE -----");
|
||||||
|
|
||||||
// Retrieve the Rainmeter's meter windows in Z-order
|
// Retrieve the Rainmeter's meter windows in Z-order
|
||||||
EnumWindows(MyEnumWindowsProc, (LPARAM)(&windowsInZOrder));
|
EnumWindows(MyEnumWindowsProc, (LPARAM)(&windowsInZOrder));
|
||||||
@ -753,7 +753,7 @@ void CSystem::ChangeZPosInOrder()
|
|||||||
|
|
||||||
if (logging)
|
if (logging)
|
||||||
{
|
{
|
||||||
CLogger::Debug(L"2: ----- AFTER -----");
|
LogDebug(L"2: ----- AFTER -----");
|
||||||
|
|
||||||
// Log all windows in Z-order
|
// Log all windows in Z-order
|
||||||
EnumWindows(MyEnumWindowsProc, (LPARAM)NULL);
|
EnumWindows(MyEnumWindowsProc, (LPARAM)NULL);
|
||||||
@ -796,7 +796,7 @@ void CSystem::PrepareHelperWindow(HWND WorkerW)
|
|||||||
{
|
{
|
||||||
if (logging)
|
if (logging)
|
||||||
{
|
{
|
||||||
CLogger_DebugF(L"System: HelperWindow: hwnd=0x%p (WorkerW=0x%p), hwndInsertAfter=0x%p (\"%s\" %s) - %s",
|
LogDebugF(L"System: HelperWindow: hwnd=0x%p (WorkerW=0x%p), hwndInsertAfter=0x%p (\"%s\" %s) - %s",
|
||||||
c_HelperWindow, WorkerW, hwnd, windowText, className, (GetWindowLongPtr(c_HelperWindow, GWL_EXSTYLE) & WS_EX_TOPMOST) ? L"TOPMOST" : L"NORMAL");
|
c_HelperWindow, WorkerW, hwnd, windowText, className, (GetWindowLongPtr(c_HelperWindow, GWL_EXSTYLE) & WS_EX_TOPMOST) ? L"TOPMOST" : L"NORMAL");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -805,7 +805,7 @@ void CSystem::PrepareHelperWindow(HWND WorkerW)
|
|||||||
if (logging)
|
if (logging)
|
||||||
{
|
{
|
||||||
DWORD err = GetLastError();
|
DWORD err = GetLastError();
|
||||||
CLogger_DebugF(L"System: HelperWindow: hwnd=0x%p (WorkerW=0x%p), hwndInsertAfter=0x%p (\"%s\" %s) - FAILED (ErrorCode=0x%08X)",
|
LogDebugF(L"System: HelperWindow: hwnd=0x%p (WorkerW=0x%p), hwndInsertAfter=0x%p (\"%s\" %s) - FAILED (ErrorCode=0x%08X)",
|
||||||
c_HelperWindow, WorkerW, hwnd, windowText, className, err);
|
c_HelperWindow, WorkerW, hwnd, windowText, className, err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -813,7 +813,7 @@ void CSystem::PrepareHelperWindow(HWND WorkerW)
|
|||||||
|
|
||||||
if (logging)
|
if (logging)
|
||||||
{
|
{
|
||||||
CLogger_DebugF(L"System: HelperWindow: hwnd=0x%p (WorkerW=0x%p), hwndInsertAfter=HWND_TOPMOST - %s",
|
LogDebugF(L"System: HelperWindow: hwnd=0x%p (WorkerW=0x%p), hwndInsertAfter=HWND_TOPMOST - %s",
|
||||||
c_HelperWindow, WorkerW, (GetWindowLongPtr(c_HelperWindow, GWL_EXSTYLE) & WS_EX_TOPMOST) ? L"TOPMOST" : L"NORMAL");
|
c_HelperWindow, WorkerW, (GetWindowLongPtr(c_HelperWindow, GWL_EXSTYLE) & WS_EX_TOPMOST) ? L"TOPMOST" : L"NORMAL");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -824,7 +824,7 @@ void CSystem::PrepareHelperWindow(HWND WorkerW)
|
|||||||
|
|
||||||
if (logging)
|
if (logging)
|
||||||
{
|
{
|
||||||
CLogger_DebugF(L"System: HelperWindow: hwnd=0x%p (WorkerW=0x%p), hwndInsertAfter=HWND_BOTTOM - %s",
|
LogDebugF(L"System: HelperWindow: hwnd=0x%p (WorkerW=0x%p), hwndInsertAfter=HWND_BOTTOM - %s",
|
||||||
c_HelperWindow, WorkerW, (GetWindowLongPtr(c_HelperWindow, GWL_EXSTYLE) & WS_EX_TOPMOST) ? L"TOPMOST" : L"NORMAL");
|
c_HelperWindow, WorkerW, (GetWindowLongPtr(c_HelperWindow, GWL_EXSTYLE) & WS_EX_TOPMOST) ? L"TOPMOST" : L"NORMAL");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -851,7 +851,7 @@ bool CSystem::CheckDesktopState(HWND WorkerW)
|
|||||||
|
|
||||||
if (Rainmeter->GetDebug())
|
if (Rainmeter->GetDebug())
|
||||||
{
|
{
|
||||||
CLogger_DebugF(L"System: \"Show %s\" has been detected.",
|
LogDebugF(L"System: \"Show %s\" has been detected.",
|
||||||
c_ShowDesktop ? L"desktop" : L"open windows");
|
c_ShowDesktop ? L"desktop" : L"open windows");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -957,7 +957,7 @@ LRESULT CALLBACK CSystem::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_DISPLAYCHANGE:
|
case WM_DISPLAYCHANGE:
|
||||||
CLogger::Notice(L"System: Display settings changed");
|
LogNotice(L"System: Display settings changed");
|
||||||
ClearMultiMonitorInfo();
|
ClearMultiMonitorInfo();
|
||||||
CConfigParser::ClearMultiMonitorVariables();
|
CConfigParser::ClearMultiMonitorVariables();
|
||||||
case WM_SETTINGCHANGE:
|
case WM_SETTINGCHANGE:
|
||||||
@ -965,7 +965,7 @@ LRESULT CALLBACK CSystem::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lP
|
|||||||
{
|
{
|
||||||
if (uMsg == WM_SETTINGCHANGE) // SPI_SETWORKAREA
|
if (uMsg == WM_SETTINGCHANGE) // SPI_SETWORKAREA
|
||||||
{
|
{
|
||||||
CLogger::Notice(L"System: Work area changed");
|
LogNotice(L"System: Work area changed");
|
||||||
UpdateWorkareaInfo();
|
UpdateWorkareaInfo();
|
||||||
CConfigParser::UpdateWorkareaVariables();
|
CConfigParser::UpdateWorkareaVariables();
|
||||||
}
|
}
|
||||||
@ -1144,7 +1144,7 @@ void CSystem::SetWallpaper(const std::wstring& wallpaper, const std::wstring& st
|
|||||||
{
|
{
|
||||||
if (_waccess(wallpaper.c_str(), 0) == -1)
|
if (_waccess(wallpaper.c_str(), 0) == -1)
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"!SetWallpaper: Unable to read file: %s", wallpaper.c_str());
|
LogErrorF(L"!SetWallpaper: Unable to read file: %s", wallpaper.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1197,7 +1197,7 @@ void CSystem::SetWallpaper(const std::wstring& wallpaper, const std::wstring& st
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogger::Error(L"!SetWallpaper: Invalid style");
|
LogError(L"!SetWallpaper: Invalid style");
|
||||||
}
|
}
|
||||||
|
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
@ -1239,7 +1239,7 @@ bool CSystem::CopyFiles(std::wstring from, std::wstring to, bool bMove)
|
|||||||
int result = SHFileOperation(&fo);
|
int result = SHFileOperation(&fo);
|
||||||
if (result != 0)
|
if (result != 0)
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"Copy error: From %s to %s (%i)", from.c_str(), to.c_str(), result);
|
LogErrorF(L"Copy error: From %s to %s (%i)", from.c_str(), to.c_str(), result);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -1282,7 +1282,7 @@ bool CSystem::RemoveFolder(std::wstring folder)
|
|||||||
int result = SHFileOperation(&fo);
|
int result = SHFileOperation(&fo);
|
||||||
if (result != 0)
|
if (result != 0)
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"Unable to delete folder %s (%i)", folder.c_str(), result);
|
LogErrorF(L"Unable to delete folder %s (%i)", folder.c_str(), result);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -1307,7 +1307,7 @@ void CSystem::UpdateIniFileMappingList()
|
|||||||
ret = RegQueryInfoKey(hKey, NULL, NULL, NULL, &numSubKeys, NULL, NULL, NULL, NULL, NULL, NULL, (LPFILETIME)&ftLastWriteTime);
|
ret = RegQueryInfoKey(hKey, NULL, NULL, NULL, &numSubKeys, NULL, NULL, NULL, NULL, NULL, NULL, (LPFILETIME)&ftLastWriteTime);
|
||||||
if (ret == ERROR_SUCCESS)
|
if (ret == ERROR_SUCCESS)
|
||||||
{
|
{
|
||||||
//CLogger_DebugF(L"IniFileMapping: numSubKeys=%u, ftLastWriteTime=%llu", numSubKeys, ftLastWriteTime);
|
//LogDebugF(L"IniFileMapping: numSubKeys=%u, ftLastWriteTime=%llu", numSubKeys, ftLastWriteTime);
|
||||||
|
|
||||||
if (ftLastWriteTime != s_LastWriteTime ||
|
if (ftLastWriteTime != s_LastWriteTime ||
|
||||||
numSubKeys != c_IniFileMappings.size())
|
numSubKeys != c_IniFileMappings.size())
|
||||||
@ -1396,7 +1396,7 @@ std::wstring CSystem::GetTemporaryFile(const std::wstring& iniFile)
|
|||||||
}
|
}
|
||||||
else // failed
|
else // failed
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"Unable to create temporary file to: %s", temporary.c_str());
|
LogErrorF(L"Unable to create temporary file to: %s", temporary.c_str());
|
||||||
temporary = L"?";
|
temporary = L"?";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,12 +66,12 @@ public:
|
|||||||
if (iter != c_CacheMap.end())
|
if (iter != c_CacheMap.end())
|
||||||
{
|
{
|
||||||
(*iter).second->AddRef();
|
(*iter).second->AddRef();
|
||||||
//CLogger_DebugF(L"* ADD: key=%s, ref=%i", key.c_str(), (*iter).second->GetRef());
|
//LogDebugF(L"* ADD: key=%s, ref=%i", key.c_str(), (*iter).second->GetRef());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
c_CacheMap[key] = new ImageCache(bitmap, hBuffer);
|
c_CacheMap[key] = new ImageCache(bitmap, hBuffer);
|
||||||
//CLogger_DebugF(L"* ADD: key=%s, ref=new", key.c_str());
|
//LogDebugF(L"* ADD: key=%s, ref=new", key.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,11 +82,11 @@ public:
|
|||||||
{
|
{
|
||||||
ImageCache* cache = (*iter).second;
|
ImageCache* cache = (*iter).second;
|
||||||
cache->Release();
|
cache->Release();
|
||||||
//CLogger_DebugF(L"* REMOVE: key=%s, ref=%i", key.c_str(), cache->GetRef());
|
//LogDebugF(L"* REMOVE: key=%s, ref=%i", key.c_str(), cache->GetRef());
|
||||||
|
|
||||||
if (cache->IsInvalid())
|
if (cache->IsInvalid())
|
||||||
{
|
{
|
||||||
//CLogger_DebugF(L"* EMPTY-ERASE: key=%s", key.c_str());
|
//LogDebugF(L"* EMPTY-ERASE: key=%s", key.c_str());
|
||||||
c_CacheMap.erase(iter);
|
c_CacheMap.erase(iter);
|
||||||
delete cache;
|
delete cache;
|
||||||
}
|
}
|
||||||
@ -375,7 +375,7 @@ void CTintedImage::LoadImage(const std::wstring& imageName, bool bLoadAlways)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"%s: Unable to load: %s", m_Name, filename.c_str());
|
LogErrorF(L"%s: Unable to load: %s", m_Name, filename.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CloseHandle(fileHandle);
|
CloseHandle(fileHandle);
|
||||||
@ -407,7 +407,7 @@ void CTintedImage::LoadImage(const std::wstring& imageName, bool bLoadAlways)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"%s: Unable to open: %s", m_Name, filename.c_str());
|
LogErrorF(L"%s: Unable to open: %s", m_Name, filename.c_str());
|
||||||
|
|
||||||
if (fileHandle != INVALID_HANDLE_VALUE)
|
if (fileHandle != INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
@ -673,7 +673,7 @@ void CTintedImage::ReadOptions(CConfigParser& parser, const WCHAR* section)
|
|||||||
if (m_CropMode < CROPMODE_TL || m_CropMode > CROPMODE_C)
|
if (m_CropMode < CROPMODE_TL || m_CropMode > CROPMODE_C)
|
||||||
{
|
{
|
||||||
m_CropMode = CROPMODE_TL;
|
m_CropMode = CROPMODE_TL;
|
||||||
CLogger_ErrorF(L"%s=%s (origin) is not valid in [%s]", m_OptionArray[OptionIndexImageCrop], crop, section);
|
LogErrorF(L"%s=%s (origin) is not valid in [%s]", m_OptionArray[OptionIndexImageCrop], crop, section);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -777,7 +777,7 @@ void CTintedImage::ReadOptions(CConfigParser& parser, const WCHAR* section)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"%s=%s (origin) is not valid in [%s]", m_OptionArray[OptionIndexImageFlip], flip, section);
|
LogErrorF(L"%s=%s (origin) is not valid in [%s]", m_OptionArray[OptionIndexImageFlip], flip, section);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_DisableTransform)
|
if (!m_DisableTransform)
|
||||||
|
@ -434,14 +434,14 @@ void CTrayWindow::ReadOptions(CConfigParser& parser)
|
|||||||
{
|
{
|
||||||
delete m_Bitmap;
|
delete m_Bitmap;
|
||||||
m_Bitmap = NULL;
|
m_Bitmap = NULL;
|
||||||
CLogger_WarningF(L"Bitmap image not found: %s", imagePath);
|
LogWarningF(L"Bitmap image not found: %s", imagePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CLogger_ErrorF(L"No such TrayMeter: %s", type);
|
LogErrorF(L"No such TrayMeter: %s", type);
|
||||||
}
|
}
|
||||||
|
|
||||||
TryAddTrayIcon();
|
TryAddTrayIcon();
|
||||||
|
@ -70,7 +70,7 @@ void LuaManager::ReportErrors(lua_State* L, const std::wstring& file)
|
|||||||
|
|
||||||
std::wstring str(file, file.find_last_of(L'\\') + 1);
|
std::wstring str(file, file.find_last_of(L'\\') + 1);
|
||||||
str += StringUtil::Widen(error);
|
str += StringUtil::Widen(error);
|
||||||
CLogger_ErrorF(L"Script: %s", str.c_str());
|
LogErrorF(L"Script: %s", str.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void LuaManager::PushWide(lua_State* L, const WCHAR* str)
|
void LuaManager::PushWide(lua_State* L, const WCHAR* str)
|
||||||
|
@ -54,7 +54,7 @@ static int Print(lua_State* L)
|
|||||||
lua_pop(L, 1);
|
lua_pop(L, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
CLogger::Debug(StringUtil::Widen(message).c_str());
|
LogDebug(StringUtil::Widen(message).c_str());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user