From b63f92f127edbfb81caaa977fac70de080c85808 Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Wed, 24 Nov 2010 16:41:50 +0000 Subject: [PATCH] Groups can now be defined under the skins [Rainmeter] section as well (in addition to Rainmeter.ini). Also fixed small typo in r622. --- Library/MeterWindow.cpp | 8 ++++---- Library/MeterWindow.h | 1 + Library/Rainmeter.cpp | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Library/MeterWindow.cpp b/Library/MeterWindow.cpp index 584bae41..2fb2d8e2 100644 --- a/Library/MeterWindow.cpp +++ b/Library/MeterWindow.cpp @@ -1541,8 +1541,6 @@ void CMeterWindow::ReadConfig() m_AlphaValue = 255; m_FadeDuration = 250; - std::wstring group = L""; - CConfigParser parser; parser.Initialize(iniFile.c_str(), m_Rainmeter); @@ -1622,8 +1620,7 @@ void CMeterWindow::ReadConfig() m_FadeDuration = parser.ReadInt(section, L"FadeDuration", m_FadeDuration); - group = parser.ReadString(section, L"Group", group.c_str()); - InitializeGroup(group); + m_ConfigGroup = parser.ReadString(section, L"Group", m_ConfigGroup.c_str()); // On the second loop override settings from the skin's section section = m_SkinName.c_str(); @@ -1717,6 +1714,9 @@ bool CMeterWindow::ReadSkin() m_Parser.Initialize(iniFile.c_str(), m_Rainmeter, this); // Global settings + m_ConfigGroup += L"|"; + m_ConfigGroup += m_Parser.ReadString(L"Rainmeter", L"Group", m_ConfigGroup.c_str()); + InitializeGroup(m_ConfigGroup); // Check the version int appVersion = m_Parser.ReadInt(L"Rainmeter", L"AppVersion", 0); diff --git a/Library/MeterWindow.h b/Library/MeterWindow.h index 748230e6..acb61cf1 100644 --- a/Library/MeterWindow.h +++ b/Library/MeterWindow.h @@ -294,6 +294,7 @@ private: bool m_MouseOver; std::wstring m_Author; // Skin's author + std::wstring m_ConfigGroup; std::wstring m_BackgroundName; // Name of the background image Gdiplus::Rect m_BackgroundMargins; Gdiplus::Rect m_DragMargins; diff --git a/Library/Rainmeter.cpp b/Library/Rainmeter.cpp index 981c74a1..15d4f076 100644 --- a/Library/Rainmeter.cpp +++ b/Library/Rainmeter.cpp @@ -3766,7 +3766,7 @@ void CRainmeter::SetDebug(bool debug) void CRainmeter::SetDisableDrag(bool drag) { m_DisableDrag = drag; - WritePrivateProfileString(L"Rainmeter", L"DisableDrag", dragging ? L"1" : L"0", m_IniFile.c_str()); + WritePrivateProfileString(L"Rainmeter", L"DisableDrag", drag ? L"1" : L"0", m_IniFile.c_str()); } void CRainmeter::TestSettingsFile(bool bDefaultIniLocation)