mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-18 06:38:00 +00:00
1 parent
76dd08ee11
commit
60febfec86
3 files changed
+14
-3
No files matched your search
@@ -98,7 +98,7 @@ public sealed class Data
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The live translation interval for debouncing in milliseconds.
|
/// The live translation interval for debouncing in milliseconds.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int LiveTranslationDebounceIntervalMilliseconds { get; set; } = 1_000;
|
public int LiveTranslationDebounceIntervalMilliseconds { get; set; } = 1_500;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Do we want to preselect any translator options?
|
/// Do we want to preselect any translator options?
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
|
|
||||||
using AIStudio.Provider;
|
using AIStudio.Provider;
|
||||||
using AIStudio.Settings.DataModel;
|
using AIStudio.Settings.DataModel;
|
||||||
|
|
||||||
@@ -13,6 +15,12 @@ public sealed class SettingsManager
|
|||||||
{
|
{
|
||||||
private const string SETTINGS_FILENAME = "settings.json";
|
private const string SETTINGS_FILENAME = "settings.json";
|
||||||
|
|
||||||
|
private static readonly JsonSerializerOptions JSON_OPTIONS = new()
|
||||||
|
{
|
||||||
|
WriteIndented = true,
|
||||||
|
Converters = { new JsonStringEnumConverter() },
|
||||||
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The directory where the configuration files are stored.
|
/// The directory where the configuration files are stored.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -101,7 +109,7 @@ public sealed class SettingsManager
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
var settingsJson = await File.ReadAllTextAsync(settingsPath);
|
var settingsJson = await File.ReadAllTextAsync(settingsPath);
|
||||||
var loadedConfiguration = JsonSerializer.Deserialize<Data>(settingsJson);
|
var loadedConfiguration = JsonSerializer.Deserialize<Data>(settingsJson, JSON_OPTIONS);
|
||||||
if(loadedConfiguration is null)
|
if(loadedConfiguration is null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -120,7 +128,7 @@ public sealed class SettingsManager
|
|||||||
if(!Directory.Exists(ConfigDirectory))
|
if(!Directory.Exists(ConfigDirectory))
|
||||||
Directory.CreateDirectory(ConfigDirectory!);
|
Directory.CreateDirectory(ConfigDirectory!);
|
||||||
|
|
||||||
var settingsJson = JsonSerializer.Serialize(this.ConfigurationData);
|
var settingsJson = JsonSerializer.Serialize(this.ConfigurationData, JSON_OPTIONS);
|
||||||
await File.WriteAllTextAsync(settingsPath, settingsJson);
|
await File.WriteAllTextAsync(settingsPath, settingsJson);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# v0.8.6, build 168
|
||||||
|
- Improved the readability of the `settings.json` file by using indentation and enum names instead of numbers
|
||||||
|
- Increased the default value for the live translation delay from 1,000 to 1,500 ms
|
||||||
Reference in new issue
Block a user