QuickClaude 1.0
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+50
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace QuickClaude
|
||||
{
|
||||
public class Settings
|
||||
{
|
||||
public double Left { get; set; } = double.NaN;
|
||||
public double Top { get; set; } = double.NaN;
|
||||
public double Width { get; set; } = 460;
|
||||
public double Height { get; set; } = 380;
|
||||
public string TextColor { get; set; } = "Black";
|
||||
public bool Topmost { get; set; } = false;
|
||||
public string WorkDir { get; set; } = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
|
||||
public string Mode { get; set; } = "default";
|
||||
public string SessionId { get; set; } = "";
|
||||
public string ClaudePath { get; set; } = "";
|
||||
|
||||
public static string Folder =>
|
||||
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "QuickClaude");
|
||||
|
||||
static string FilePath => Path.Combine(Folder, "settings.json");
|
||||
public static string TranscriptPath => Path.Combine(Folder, "transcript.txt");
|
||||
|
||||
public static Settings Load()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (File.Exists(FilePath))
|
||||
{
|
||||
var s = JsonSerializer.Deserialize<Settings>(File.ReadAllText(FilePath));
|
||||
if (s != null) return s;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
return new Settings();
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
try
|
||||
{
|
||||
Directory.CreateDirectory(Folder);
|
||||
File.WriteAllText(FilePath, JsonSerializer.Serialize(this, new JsonSerializerOptions { WriteIndented = true }));
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user