mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
Persist app zone history in real time (#1257)
* save settings every time changes are performed * settings are not saved on app exit
This commit is contained in:
@@ -136,8 +136,6 @@ private:
|
|||||||
void Disable(bool const traceEvent)
|
void Disable(bool const traceEvent)
|
||||||
{
|
{
|
||||||
if (m_app) {
|
if (m_app) {
|
||||||
const auto& fancyZonesData = JSONHelpers::FancyZonesDataInstance();
|
|
||||||
fancyZonesData.SaveFancyZonesData();
|
|
||||||
if (traceEvent)
|
if (traceEvent)
|
||||||
{
|
{
|
||||||
Trace::FancyZones::EnableFancyZones(false);
|
Trace::FancyZones::EnableFancyZones(false);
|
||||||
|
|||||||
@@ -207,6 +207,7 @@ namespace JSONHelpers
|
|||||||
if (data.zoneSetUuid == zoneSetId && data.deviceId == deviceId)
|
if (data.zoneSetUuid == zoneSetId && data.deviceId == deviceId)
|
||||||
{
|
{
|
||||||
appZoneHistoryMap.erase(processPath);
|
appZoneHistoryMap.erase(processPath);
|
||||||
|
SaveFancyZonesData();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -224,6 +225,7 @@ namespace JSONHelpers
|
|||||||
}
|
}
|
||||||
|
|
||||||
appZoneHistoryMap[processPath] = AppZoneHistoryData{ .zoneSetUuid = zoneSetId, .deviceId = deviceId, .zoneIndex = zoneIndex };
|
appZoneHistoryMap[processPath] = AppZoneHistoryData{ .zoneSetUuid = zoneSetId, .deviceId = deviceId, .zoneIndex = zoneIndex };
|
||||||
|
SaveFancyZonesData();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -538,6 +540,7 @@ namespace JSONHelpers
|
|||||||
if (appliedZoneSetsMap.contains(std::wstring{ activeZoneSetId }))
|
if (appliedZoneSetsMap.contains(std::wstring{ activeZoneSetId }))
|
||||||
{
|
{
|
||||||
deviceInfoMap[deviceId] = DeviceInfoData{ appliedZoneSetsMap.at(std::wstring{ activeZoneSetId }), static_cast<bool>(showSpacing), static_cast<int>(spacing), static_cast<int>(zoneCount) };
|
deviceInfoMap[deviceId] = DeviceInfoData{ appliedZoneSetsMap.at(std::wstring{ activeZoneSetId }), static_cast<bool>(showSpacing), static_cast<int>(spacing), static_cast<int>(zoneCount) };
|
||||||
|
SaveFancyZonesData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user