feat(ui): constrain decimal input and add stacked timed toasts with uniform actions
This commit is contained in:
@@ -27,6 +27,16 @@ class Program
|
||||
var appDataDir = Path.Combine(
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
|
||||
"Duempelkas");
|
||||
var isolated = false;
|
||||
#if DEBUG
|
||||
var directoryIndex = Array.IndexOf(args, "--data-directory");
|
||||
if (directoryIndex >= 0)
|
||||
{
|
||||
if (directoryIndex + 1 >= args.Length) throw new ArgumentException("Datenordner fehlt.");
|
||||
appDataDir = Path.GetFullPath(args[directoryIndex + 1]);
|
||||
isolated = true;
|
||||
}
|
||||
#endif
|
||||
Directory.CreateDirectory(appDataDir);
|
||||
|
||||
var dbPath = Path.Combine(appDataDir, "duempelkas.db");
|
||||
@@ -34,7 +44,7 @@ class Program
|
||||
// One-time compatibility: keep existing data if older versions stored DB next to the app executable.
|
||||
var legacyExeDirectory = Path.GetDirectoryName(Environment.ProcessPath ?? AppContext.BaseDirectory) ?? AppContext.BaseDirectory;
|
||||
var legacyDbPath = Path.Combine(legacyExeDirectory, "duempelkas.db");
|
||||
if (!File.Exists(dbPath) && File.Exists(legacyDbPath))
|
||||
if (!isolated && !File.Exists(dbPath) && File.Exists(legacyDbPath))
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -50,7 +60,7 @@ class Program
|
||||
}
|
||||
}
|
||||
|
||||
appBuilder.Services.AddInfrastructure($"Data Source={dbPath}");
|
||||
appBuilder.Services.AddInfrastructure(new Microsoft.Data.Sqlite.SqliteConnectionStringBuilder { DataSource = dbPath }.ToString(), appDataDir);
|
||||
|
||||
appBuilder.RootComponents.Add<Duempelkas.App.Components.App>("app");
|
||||
|
||||
@@ -72,9 +82,7 @@ class Program
|
||||
}
|
||||
|
||||
// Load saved window size or use defaults
|
||||
var settingsPath = Path.Combine(
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
|
||||
"Duempelkas", "window.json");
|
||||
var settingsPath = Path.Combine(appDataDir, "window.json");
|
||||
|
||||
int savedWidth = 1280, savedHeight = 800;
|
||||
if (File.Exists(settingsPath))
|
||||
@@ -90,7 +98,7 @@ class Program
|
||||
}
|
||||
|
||||
app.MainWindow
|
||||
.SetTitle("Dümpelkas – Kassenbuch")
|
||||
.SetTitle(isolated ? "Dümpelkas – Testdaten" : "Dümpelkas – Kassenbuch")
|
||||
.SetSize(savedWidth, savedHeight)
|
||||
.SetUseOsDefaultSize(false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user