- Uptime: Added AddDaysToHours=1/0 (default 1) to disable adding hours to days when %4 is not specified in Format=.

- Installer: Now supports silent installs. Switches and return values available at http://rainmeter.net/RainCMS/?q=Installation_beta
This commit is contained in:
Birunthan Mohanathas 2011-03-23 19:19:45 +00:00
parent 5cc004f241
commit a4b24d75ac
2 changed files with 14 additions and 3 deletions

View File

@ -26,7 +26,8 @@
** The constructor ** The constructor
** **
*/ */
CMeasureUptime::CMeasureUptime(CMeterWindow* meterWindow, const WCHAR* name) : CMeasure(meterWindow, name) CMeasureUptime::CMeasureUptime(CMeterWindow* meterWindow, const WCHAR* name) : CMeasure(meterWindow, name),
m_AddDaysToHours(false)
{ {
} }
@ -51,6 +52,15 @@ void CMeasureUptime::ReadConfig(CConfigParser& parser, const WCHAR* section)
CMeasure::ReadConfig(parser, section); CMeasure::ReadConfig(parser, section);
m_Format = parser.ReadString(section, L"Format", L"%4!i!d %3!i!:%2!02i!"); m_Format = parser.ReadString(section, L"Format", L"%4!i!d %3!i!:%2!02i!");
if (m_Format.find(L"%4") == std::wstring::npos)
{
m_AddDaysToHours = 0!=parser.ReadInt(section, L"AddDaysToHours", 1);
}
else
{
m_AddDaysToHours = false;
}
} }
/* /*
@ -87,7 +97,7 @@ const WCHAR* CMeasureUptime::GetStringValue(AUTOSCALE autoScale, double scale, i
time[2] = (value / (60 * 60)); time[2] = (value / (60 * 60));
time[3] = (value / (60 * 60 * 24)); time[3] = (value / (60 * 60 * 24));
if (m_Format.find(L"%4") != std::wstring::npos) if (!m_AddDaysToHours)
{ {
time[2] %= 24; time[2] %= 24;
} }

View File

@ -32,6 +32,7 @@ public:
virtual void ReadConfig(CConfigParser& parser, const WCHAR* section); virtual void ReadConfig(CConfigParser& parser, const WCHAR* section);
private: private:
bool m_AddDaysToHours;
std::wstring m_Format; std::wstring m_Format;
}; };