This commit is contained in:
Birunthan Mohanathas 2012-07-13 22:04:43 +03:00
parent 216d58da31
commit 215211741e
2 changed files with 11 additions and 13 deletions

View File

@ -390,8 +390,6 @@ void CMeterWindow::Refresh(bool init, bool all)
ZPOSITION oldZPos = m_WindowZPosition; ZPOSITION oldZPos = m_WindowZPosition;
//TODO: Should these be moved to a Reload command instead of hitting the disk on every refresh
ReadOptions(); // Read the general settings
if (!ReadSkin()) if (!ReadSkin())
{ {
Rainmeter->DeactivateSkin(this, -1); Rainmeter->DeactivateSkin(this, -1);
@ -1838,7 +1836,14 @@ void CMeterWindow::ReadOptions()
m_FadeDuration = parser.ReadInt(section, L"FadeDuration", 250); m_FadeDuration = parser.ReadInt(section, L"FadeDuration", 250);
m_SkinGroup = parser.ReadString(section, L"Group", L""); std::wstring skinGroup = parser.ReadString(section, L"Group", L"");
const std::wstring& group = m_Parser.ReadString(L"Rainmeter", L"Group", L"");
if (!group.empty())
{
skinGroup += L'|';
skinGroup += group;
}
InitializeGroup(skinGroup);
if (writeFlags != 0) if (writeFlags != 0)
{ {
@ -1957,6 +1962,9 @@ bool CMeterWindow::ReadSkin()
m_Parser.Initialize(iniFile, this, NULL, &resourcePath); m_Parser.Initialize(iniFile, this, NULL, &resourcePath);
// Read options from Rainmeter.ini.
ReadOptions();
// Check the version // Check the version
UINT appVersion = m_Parser.ReadUInt(L"Rainmeter", L"AppVersion", 0); UINT appVersion = m_Parser.ReadUInt(L"Rainmeter", L"AppVersion", 0);
if (appVersion > RAINMETER_VERSION) if (appVersion > RAINMETER_VERSION)
@ -1979,15 +1987,6 @@ bool CMeterWindow::ReadSkin()
SetWindowPositionVariables(m_ScreenX, m_ScreenY); SetWindowPositionVariables(m_ScreenX, m_ScreenY);
SetWindowSizeVariables(0, 0); SetWindowSizeVariables(0, 0);
// Global settings
const std::wstring& group = m_Parser.ReadString(L"Rainmeter", L"Group", L"");
if (!group.empty())
{
m_SkinGroup += L'|';
m_SkinGroup += group;
}
InitializeGroup(m_SkinGroup);
static const RECT defMargins = {0}; static const RECT defMargins = {0};
m_BackgroundMargins = m_Parser.ReadRECT(L"Rainmeter", L"BackgroundMargins", defMargins); m_BackgroundMargins = m_Parser.ReadRECT(L"Rainmeter", L"BackgroundMargins", defMargins);
m_DragMargins = m_Parser.ReadRECT(L"Rainmeter", L"DragMargins", defMargins); m_DragMargins = m_Parser.ReadRECT(L"Rainmeter", L"DragMargins", defMargins);

View File

@ -357,7 +357,6 @@ private:
std::wstring m_OnRefreshAction; std::wstring m_OnRefreshAction;
std::wstring m_OnCloseAction; std::wstring m_OnCloseAction;
std::wstring m_SkinGroup;
std::wstring m_BackgroundName; std::wstring m_BackgroundName;
RECT m_BackgroundMargins; RECT m_BackgroundMargins;
RECT m_DragMargins; RECT m_DragMargins;