mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Some of the plugins don't work with the dynamic variables so the feature is now disabled for them.
This commit is contained in:
parent
9cf291517a
commit
ffdec7be65
@ -129,7 +129,7 @@ void CConfigParser::SetVariable(const std::wstring& strVariable, const std::wstr
|
|||||||
**
|
**
|
||||||
**
|
**
|
||||||
*/
|
*/
|
||||||
const std::wstring& CConfigParser::ReadString(LPCTSTR section, LPCTSTR key, LPCTSTR defValue)
|
const std::wstring& CConfigParser::ReadString(LPCTSTR section, LPCTSTR key, LPCTSTR defValue, bool bReplaceMeasures)
|
||||||
{
|
{
|
||||||
static std::wstring result;
|
static std::wstring result;
|
||||||
|
|
||||||
@ -194,7 +194,7 @@ const std::wstring& CConfigParser::ReadString(LPCTSTR section, LPCTSTR key, LPCT
|
|||||||
} while(loop);
|
} while(loop);
|
||||||
|
|
||||||
// Check for measures ([Measure])
|
// Check for measures ([Measure])
|
||||||
if (!m_Measures.empty())
|
if (!m_Measures.empty() && bReplaceMeasures)
|
||||||
{
|
{
|
||||||
start = 0;
|
start = 0;
|
||||||
end = std::wstring::npos;
|
end = std::wstring::npos;
|
||||||
|
@ -40,7 +40,7 @@ public:
|
|||||||
void AddMeasure(CMeasure* pMeasure);
|
void AddMeasure(CMeasure* pMeasure);
|
||||||
void SetVariable(const std::wstring& strVariable, const std::wstring& strValue);
|
void SetVariable(const std::wstring& strVariable, const std::wstring& strValue);
|
||||||
|
|
||||||
const std::wstring& ReadString(LPCTSTR section, LPCTSTR key, LPCTSTR defValue);
|
const std::wstring& ReadString(LPCTSTR section, LPCTSTR key, LPCTSTR defValue, bool bReplaceMeasures = true);
|
||||||
double ReadFloat(LPCTSTR section, LPCTSTR key, double defValue);
|
double ReadFloat(LPCTSTR section, LPCTSTR key, double defValue);
|
||||||
double ReadFormula(LPCTSTR section, LPCTSTR key, double defValue);
|
double ReadFormula(LPCTSTR section, LPCTSTR key, double defValue);
|
||||||
int ReadInt(LPCTSTR section, LPCTSTR key, int defValue);
|
int ReadInt(LPCTSTR section, LPCTSTR key, int defValue);
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include <tchar.h>
|
#include <tchar.h>
|
||||||
#include "MeasureCalc.h"
|
#include "MeasureCalc.h"
|
||||||
#include "MeasureNet.h"
|
#include "MeasureNet.h"
|
||||||
|
#include "MeasurePlugin.h"
|
||||||
#include "MeterButton.h"
|
#include "MeterButton.h"
|
||||||
|
|
||||||
using namespace Gdiplus;
|
using namespace Gdiplus;
|
||||||
@ -1875,7 +1876,7 @@ void CMeterWindow::Update(bool nodraw)
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if ((*i)->HasDynamicVariables())
|
if ((*i)->HasDynamicVariables() && dynamic_cast<CMeasurePlugin*>((*i)) == NULL) // Plugins are not meant to be reinitialized
|
||||||
{
|
{
|
||||||
(*i)->ReadConfig(m_Parser, (*i)->GetName());
|
(*i)->ReadConfig(m_Parser, (*i)->GetName());
|
||||||
}
|
}
|
||||||
|
@ -180,7 +180,7 @@ LPCTSTR ReadConfigString(LPCTSTR section, LPCTSTR key, LPCTSTR defValue)
|
|||||||
CConfigParser* parser = Rainmeter->GetCurrentParser();
|
CConfigParser* parser = Rainmeter->GetCurrentParser();
|
||||||
if (parser)
|
if (parser)
|
||||||
{
|
{
|
||||||
return parser->ReadString(section, key, defValue).c_str();
|
return parser->ReadString(section, key, defValue, false).c_str();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
const int revision_number = 185;
|
const int revision_number = 191;
|
Loading…
x
Reference in New Issue
Block a user