mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Fixed for !DeactivateConfig. Default of current config broken in 1172.
This commit is contained in:
parent
1e88fe1db3
commit
94b1145f7a
@ -325,19 +325,23 @@ void CRainmeter::Bang_ActivateConfig(const WCHAR* arg)
|
|||||||
** !DeactivateConfig bang
|
** !DeactivateConfig bang
|
||||||
**
|
**
|
||||||
*/
|
*/
|
||||||
void CRainmeter::Bang_DeactivateConfig(const WCHAR* arg)
|
void CRainmeter::Bang_DeactivateConfig(const WCHAR* arg, CMeterWindow* meterWindow)
|
||||||
{
|
{
|
||||||
std::vector<std::wstring> subStrings = ParseString(arg);
|
std::vector<std::wstring> subStrings = ParseString(arg);
|
||||||
|
|
||||||
if (!subStrings.empty())
|
if (!subStrings.empty())
|
||||||
{
|
{
|
||||||
CMeterWindow* mw = GetMeterWindow(subStrings[0]);
|
meterWindow = GetMeterWindow(subStrings[0]);
|
||||||
if (mw)
|
if (!meterWindow)
|
||||||
{
|
{
|
||||||
DeactivateConfig(mw, -1);
|
LogWithArgs(LOG_WARNING, L"!DeactivateConfig: \"%s\" not active", subStrings[0].c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LogWithArgs(LOG_WARNING, L"!DeactivateConfig: \"%s\" not active", subStrings[0].c_str());
|
}
|
||||||
|
|
||||||
|
if (meterWindow)
|
||||||
|
{
|
||||||
|
DeactivateConfig(meterWindow, -1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -450,21 +454,25 @@ void CRainmeter::Bang_SetWallpaper(const WCHAR* arg)
|
|||||||
** !SkinMenu bang
|
** !SkinMenu bang
|
||||||
**
|
**
|
||||||
*/
|
*/
|
||||||
void CRainmeter::Bang_SkinMenu(const WCHAR* arg)
|
void CRainmeter::Bang_SkinMenu(const WCHAR* arg, CMeterWindow* meterWindow)
|
||||||
{
|
{
|
||||||
std::vector<std::wstring> subStrings = ParseString(arg);
|
std::vector<std::wstring> subStrings = ParseString(arg);
|
||||||
|
|
||||||
if (!subStrings.empty())
|
if (!subStrings.empty())
|
||||||
{
|
{
|
||||||
CMeterWindow* mw = GetMeterWindow(subStrings[0]);
|
meterWindow = GetMeterWindow(subStrings[0]);
|
||||||
if (mw)
|
if (!meterWindow)
|
||||||
{
|
{
|
||||||
POINT pos;
|
LogWithArgs(LOG_WARNING, L"!SkinMenu: \"%s\" not active", subStrings[0].c_str());
|
||||||
GetCursorPos(&pos);
|
|
||||||
ShowContextMenu(pos, mw);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LogWithArgs(LOG_WARNING, L"!SkinMenu: \"%s\" not active", subStrings[0].c_str());
|
}
|
||||||
|
|
||||||
|
if (meterWindow)
|
||||||
|
{
|
||||||
|
POINT pos;
|
||||||
|
GetCursorPos(&pos);
|
||||||
|
ShowContextMenu(pos, meterWindow);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1622,7 +1630,7 @@ void CRainmeter::ExecuteBang(const std::wstring& name, std::wstring& arg, CMeter
|
|||||||
}
|
}
|
||||||
else if (_wcsicmp(bang, L"DeactivateConfig") == 0)
|
else if (_wcsicmp(bang, L"DeactivateConfig") == 0)
|
||||||
{
|
{
|
||||||
Bang_DeactivateConfig(args);
|
Bang_DeactivateConfig(args, meterWindow);
|
||||||
}
|
}
|
||||||
else if (_wcsicmp(bang, L"ToggleConfig") == 0)
|
else if (_wcsicmp(bang, L"ToggleConfig") == 0)
|
||||||
{
|
{
|
||||||
@ -1794,7 +1802,7 @@ void CRainmeter::ExecuteBang(const std::wstring& name, std::wstring& arg, CMeter
|
|||||||
}
|
}
|
||||||
else if (_wcsicmp(bang, L"SkinMenu") == 0)
|
else if (_wcsicmp(bang, L"SkinMenu") == 0)
|
||||||
{
|
{
|
||||||
Bang_SkinMenu(args);
|
Bang_SkinMenu(args, meterWindow);
|
||||||
}
|
}
|
||||||
else if (_wcsicmp(bang, L"TrayMenu") == 0)
|
else if (_wcsicmp(bang, L"TrayMenu") == 0)
|
||||||
{
|
{
|
||||||
|
@ -217,12 +217,12 @@ private:
|
|||||||
void BangWithArgs(BANGCOMMAND bang, const WCHAR* arg, size_t numOfArgs, CMeterWindow* meterWindow);
|
void BangWithArgs(BANGCOMMAND bang, const WCHAR* arg, size_t numOfArgs, CMeterWindow* meterWindow);
|
||||||
void BangGroupWithArgs(BANGCOMMAND bang, const WCHAR* arg, size_t numOfArgs, CMeterWindow* meterWindow);
|
void BangGroupWithArgs(BANGCOMMAND bang, const WCHAR* arg, size_t numOfArgs, CMeterWindow* meterWindow);
|
||||||
void Bang_ActivateConfig(const WCHAR* arg);
|
void Bang_ActivateConfig(const WCHAR* arg);
|
||||||
void Bang_DeactivateConfig(const WCHAR* arg);
|
void Bang_DeactivateConfig(const WCHAR* arg, CMeterWindow* meterWindow);
|
||||||
void Bang_ToggleConfig(const WCHAR* arg);
|
void Bang_ToggleConfig(const WCHAR* arg);
|
||||||
void Bang_DeactivateConfigGroup(const WCHAR* arg);
|
void Bang_DeactivateConfigGroup(const WCHAR* arg);
|
||||||
void Bang_SetClip(const WCHAR* arg);
|
void Bang_SetClip(const WCHAR* arg);
|
||||||
void Bang_SetWallpaper(const WCHAR* arg);
|
void Bang_SetWallpaper(const WCHAR* arg);
|
||||||
void Bang_SkinMenu(const WCHAR* arg);
|
void Bang_SkinMenu(const WCHAR* arg, CMeterWindow* meterWindow);
|
||||||
void Bang_TrayMenu();
|
void Bang_TrayMenu();
|
||||||
void Bang_WriteKeyValue(const WCHAR* arg, CMeterWindow* meterWindow);
|
void Bang_WriteKeyValue(const WCHAR* arg, CMeterWindow* meterWindow);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user