diff --git a/res/assets/com.typomustakes.Keys.svg b/res/assets/com.typomustakes.Keys.svg deleted file mode 100644 index 7615e24..0000000 --- a/res/assets/com.typomustakes.Keys.svg +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/App/UI/MainWindow/MainWindow.cs b/src/App/UI/MainWindow/MainWindow.cs index 3c2d7a8..948e134 100644 --- a/src/App/UI/MainWindow/MainWindow.cs +++ b/src/App/UI/MainWindow/MainWindow.cs @@ -49,7 +49,7 @@ public partial class MainWindow } private void BindUIElements() - { + { var builder = new Gtk.Builder("Keys.UI.MainWindow.MainWindow.xml"); Window = builder.GetObject(windowId) as Window; if (Window == null) @@ -109,4 +109,9 @@ public partial class MainWindow throw new Exception("Failed to load UI element with ID: " + e.Message); } } + + private void ShowAboutDialog() + { + + } } \ No newline at end of file diff --git a/src/Logic/ISecretService.cs b/src/Logic/ISecretService.cs index a8870d5..931cc05 100644 --- a/src/Logic/ISecretService.cs +++ b/src/Logic/ISecretService.cs @@ -2,7 +2,9 @@ namespace Logic; public interface ISecretService { + public event Action OnFinishedCreatingSecret; public List GetCollections(); public bool CreateCollection(string label); public void DeleteCollection(string label); + public void CreateOrReplaceSecret(string collectionLabel, string secretLabel, string secret); } diff --git a/src/Logic/SecretService.cs b/src/Logic/SecretService.cs index 910be64..07b836c 100644 --- a/src/Logic/SecretService.cs +++ b/src/Logic/SecretService.cs @@ -2,6 +2,8 @@ namespace Logic; public class SecretService : ISecretService { + public event Action OnFinishedCreatingSecret; + Secret.Service service; public SecretService() @@ -17,6 +19,7 @@ public class SecretService : ISecretService GLib.List.Foreach(collections, data => { Secret.Collection collection = (Secret.Collection)GObject.Internal.InstanceWrapper.WrapHandle(data, false); + collection.LoadItemsSync(null); result.Add(collection); }); return result; @@ -39,4 +42,19 @@ public class SecretService : ISecretService { GetCollections().FirstOrDefault(c => c.Label == label).DeleteSync(null); } + + public void CreateOrReplaceSecret(string collectionLabel, string secretLabel, string secret) + { + GLib.HashTable.NewSimilar(); + + + Secret.Item.CreateSync( + GetCollections().Where(c => c.Label == collectionLabel).First(), + null, + secretLabel, + Secret.Value.New(secret, secret.Length, "text/plain"), + Secret.ItemCreateFlags.Replace, + null + ); + } }