mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
- 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:
parent
5cc004f241
commit
a4b24d75ac
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user