From d16cdd11a162e95775a868bf417aa882097c4b62 Mon Sep 17 00:00:00 2001
From: zznty <94796179+zznty@users.noreply.github.com>
Date: Sun, 23 Oct 2022 21:27:06 +0700
Subject: [PATCH] add super intelligent save button cuz torch is trash
---
TorchRemote.Plugin/ConfigControl.xaml | 18 ++++++++++++++++++
TorchRemote.Plugin/ConfigControl.xaml.cs | 21 +++++++++++++++++++++
TorchRemote.Plugin/Plugin.cs | 3 +--
TorchRemote.Plugin/manifest.xml | 2 +-
4 files changed, 41 insertions(+), 3 deletions(-)
create mode 100644 TorchRemote.Plugin/ConfigControl.xaml
create mode 100644 TorchRemote.Plugin/ConfigControl.xaml.cs
diff --git a/TorchRemote.Plugin/ConfigControl.xaml b/TorchRemote.Plugin/ConfigControl.xaml
new file mode 100644
index 0000000..9d36430
--- /dev/null
+++ b/TorchRemote.Plugin/ConfigControl.xaml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/TorchRemote.Plugin/ConfigControl.xaml.cs b/TorchRemote.Plugin/ConfigControl.xaml.cs
new file mode 100644
index 0000000..85396fc
--- /dev/null
+++ b/TorchRemote.Plugin/ConfigControl.xaml.cs
@@ -0,0 +1,21 @@
+using System.Windows;
+using System.Windows.Controls;
+using Torch;
+
+namespace TorchRemote.Plugin;
+
+public partial class ConfigControl : UserControl
+{
+ private readonly Persistent _persistent;
+
+ public ConfigControl(Persistent persistent)
+ {
+ _persistent = persistent;
+ InitializeComponent();
+ }
+
+ private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
+ {
+ _persistent.Save();
+ }
+}
\ No newline at end of file
diff --git a/TorchRemote.Plugin/Plugin.cs b/TorchRemote.Plugin/Plugin.cs
index b76e23b..bd9d3d6 100644
--- a/TorchRemote.Plugin/Plugin.cs
+++ b/TorchRemote.Plugin/Plugin.cs
@@ -25,9 +25,8 @@ public class Plugin : TorchPluginBase, IWpfPlugin
.AddFactory(s => new ChatMonitorManager(s.Torch));
}
- public UserControl GetControl() => new PropertyGrid
+ public UserControl GetControl() => new ConfigControl(_config)
{
- Margin = new(3),
DataContext = _config.Data
};
}
diff --git a/TorchRemote.Plugin/manifest.xml b/TorchRemote.Plugin/manifest.xml
index b5debc5..36ae4b7 100644
--- a/TorchRemote.Plugin/manifest.xml
+++ b/TorchRemote.Plugin/manifest.xml
@@ -2,5 +2,5 @@
Torch Remote
284017F3-9682-4841-A544-EB04DB8CB9BA
- v1.0.5
+ v1.0.6
\ No newline at end of file