From 305dcbd7943780a705e267ef5a5aab72bad41cbd Mon Sep 17 00:00:00 2001 From: WeeXnes Date: Tue, 6 May 2025 12:04:36 +0200 Subject: [PATCH] working password saving --- Cryptura/App.axaml.cs | 3 ++- Cryptura/MainWindow.axaml.cs | 5 +++- Cryptura/PasswordWindow.axaml | 27 ++++++++++++++++++++ Cryptura/PasswordWindow.axaml.cs | 43 ++++++++++++++++++++++++++++++++ Cryptura/WXFile.cs | 6 +++-- 5 files changed, 80 insertions(+), 4 deletions(-) create mode 100644 Cryptura/PasswordWindow.axaml create mode 100644 Cryptura/PasswordWindow.axaml.cs diff --git a/Cryptura/App.axaml.cs b/Cryptura/App.axaml.cs index 67dee72..8991641 100644 --- a/Cryptura/App.axaml.cs +++ b/Cryptura/App.axaml.cs @@ -1,3 +1,4 @@ +using System; using Avalonia; using Avalonia.Controls.ApplicationLifetimes; using Avalonia.Markup.Xaml; @@ -15,7 +16,7 @@ public partial class App : Application { if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) { - desktop.MainWindow = new MainWindow(); + desktop.MainWindow = new PasswordWindow(); } base.OnFrameworkInitializationCompleted(); diff --git a/Cryptura/MainWindow.axaml.cs b/Cryptura/MainWindow.axaml.cs index 2df7a97..2290f36 100644 --- a/Cryptura/MainWindow.axaml.cs +++ b/Cryptura/MainWindow.axaml.cs @@ -11,6 +11,7 @@ namespace Cryptura; public partial class MainWindow : Window { public static bool censorPasswords = true; + public static string MasterPassword = ""; private void AdjustThemeToPlatform() { if (Core.IsRunningOnGnome()) @@ -26,10 +27,12 @@ public partial class MainWindow : Window AcrylicBorderObject.IsVisible = true; } } - public MainWindow() + public MainWindow(string masterPassword) { InitializeComponent(); + MasterPassword = masterPassword; AdjustThemeToPlatform(); + Password pw = new Password("Example", "Password"); FetchPasswords(); } diff --git a/Cryptura/PasswordWindow.axaml b/Cryptura/PasswordWindow.axaml new file mode 100644 index 0000000..6c7a221 --- /dev/null +++ b/Cryptura/PasswordWindow.axaml @@ -0,0 +1,27 @@ + + + + + + + + + +