Changed the behavior of DynamicVariables. The fixed value definition of the following settings is handled as the starting value. If the value definition of these settings contains variables or measures, related !bangs are ignored.

[Measure]
Disabled

[Meter]
Hidden
X
Y

In case of "Hidden":
- Hidden not added or Hidden=0/1 (=fixed value specified) and DynamicVariables=1
The specified value is handled as the starting value. After that the value is not re-read on every update. !RainmeterShowMeter etc. are enabled.

- Hidden=#VAR# or Hidden=[Measure] and DynamicVariables=1
The value is re-read on every update. !RainmeterShowMeter etc. are disabled by re-reading value.
This commit is contained in:
spx
2010-06-01 14:55:52 +00:00
parent 5ff8f59ebf
commit f2682eaee0
7 changed files with 217 additions and 113 deletions

View File

@ -68,6 +68,7 @@ CMeasure::CMeasure(CMeterWindow* meterWindow)
m_AveragePos = 0;
m_AverageSize = 0;
m_DynamicVariables = false;
m_Initialized = false;
m_MeterWindow = meterWindow;
}
@ -82,6 +83,17 @@ CMeasure::~CMeasure()
{
}
/*
** Initialize
**
** Initializes the measure.
**
*/
void CMeasure::Initialize()
{
m_Initialized = true;
}
/*
** ReadConfig
**
@ -91,6 +103,8 @@ CMeasure::~CMeasure()
*/
void CMeasure::ReadConfig(CConfigParser& parser, const WCHAR* section)
{
bool replaced;
// Clear substitutes to prevent from being added more than once.
if (!m_Substitute.empty())
{
@ -98,7 +112,20 @@ void CMeasure::ReadConfig(CConfigParser& parser, const WCHAR* section)
}
m_Invert = 0!=parser.ReadInt(section, L"InvertMeasure", 0);
m_Disabled = 0!=parser.ReadInt(section, L"Disabled", m_Disabled);
if (!m_Initialized)
{
m_Disabled = 0!=parser.ReadInt(section, L"Disabled", 0);
}
else
{
replaced = false;
const std::wstring& result = parser.ReadString(section, L"Disabled", L"0", true, &replaced);
if (replaced)
{
m_Disabled = 0!=(int)parser.ParseDouble(result, 0.0, true);
}
}
UINT updateDivider = parser.ReadInt(section, L"UpdateDivider", 1);
if (updateDivider != m_UpdateDivider)