mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-01-18 06:29:44 +08: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:
parent
a1d277e771
commit
79c625d737
@ -136,8 +136,6 @@ private:
|
||||
void Disable(bool const traceEvent)
|
||||
{
|
||||
if (m_app) {
|
||||
const auto& fancyZonesData = JSONHelpers::FancyZonesDataInstance();
|
||||
fancyZonesData.SaveFancyZonesData();
|
||||
if (traceEvent)
|
||||
{
|
||||
Trace::FancyZones::EnableFancyZones(false);
|
||||
|
@ -207,6 +207,7 @@ namespace JSONHelpers
|
||||
if (data.zoneSetUuid == zoneSetId && data.deviceId == deviceId)
|
||||
{
|
||||
appZoneHistoryMap.erase(processPath);
|
||||
SaveFancyZonesData();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -224,6 +225,7 @@ namespace JSONHelpers
|
||||
}
|
||||
|
||||
appZoneHistoryMap[processPath] = AppZoneHistoryData{ .zoneSetUuid = zoneSetId, .deviceId = deviceId, .zoneIndex = zoneIndex };
|
||||
SaveFancyZonesData();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -538,6 +540,7 @@ namespace JSONHelpers
|
||||
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) };
|
||||
SaveFancyZonesData();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user