diff --git a/Wox.Plugin.SystemPlugins/CMD/CMD.cs b/Wox.Plugin.SystemPlugins/CMD/CMD.cs
index aeeb8405ae..c205e3dca4 100644
--- a/Wox.Plugin.SystemPlugins/CMD/CMD.cs
+++ b/Wox.Plugin.SystemPlugins/CMD/CMD.cs
@@ -4,10 +4,11 @@ using System.IO;
using System.Linq;
using System.Runtime.Serialization.Formatters.Binary;
using System.Windows.Forms;
+using Control = System.Windows.Controls.Control;
namespace Wox.Plugin.SystemPlugins.CMD
{
- public class CMD : BaseSystemPlugin
+ public class CMD : BaseSystemPlugin,ISettingProvider
{
private PluginInitContext context;
@@ -167,5 +168,10 @@ namespace Wox.Plugin.SystemPlugins.CMD
{
get { return "Provide executing commands from Wox. Commands should start with >"; }
}
+
+ public Control CreateSettingPanel()
+ {
+ return new CMDSetting();
+ }
}
}
diff --git a/Wox.Plugin.SystemPlugins/CMD/CMDSetting.xaml b/Wox.Plugin.SystemPlugins/CMD/CMDSetting.xaml
new file mode 100644
index 0000000000..593e6a02a8
--- /dev/null
+++ b/Wox.Plugin.SystemPlugins/CMD/CMDSetting.xaml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Wox.Plugin.SystemPlugins/CMD/CMDSetting.xaml.cs b/Wox.Plugin.SystemPlugins/CMD/CMDSetting.xaml.cs
new file mode 100644
index 0000000000..d0bc06f568
--- /dev/null
+++ b/Wox.Plugin.SystemPlugins/CMD/CMDSetting.xaml.cs
@@ -0,0 +1,54 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using Wox.Infrastructure.Storage.UserSettings;
+
+namespace Wox.Plugin.SystemPlugins.CMD
+{
+ public partial class CMDSetting : UserControl
+ {
+ public CMDSetting()
+ {
+ InitializeComponent();
+ }
+
+ private void CMDSetting_OnLoaded(object sender, RoutedEventArgs re)
+ {
+ cbReplaceWinR.IsChecked = UserSettingStorage.Instance.ReplaceWinR;
+ cbLeaveCmdOpen.IsChecked = UserSettingStorage.Instance.LeaveCmdOpen;
+
+ cbLeaveCmdOpen.Checked += (o, e) =>
+ {
+ UserSettingStorage.Instance.LeaveCmdOpen = true;
+ UserSettingStorage.Instance.Save();
+ };
+
+ cbLeaveCmdOpen.Unchecked += (o, e) =>
+ {
+ UserSettingStorage.Instance.LeaveCmdOpen = false;
+ UserSettingStorage.Instance.Save();
+ };
+
+ cbReplaceWinR.Checked += (o, e) =>
+ {
+ UserSettingStorage.Instance.ReplaceWinR = true;
+ UserSettingStorage.Instance.Save();
+ };
+ cbReplaceWinR.Unchecked += (o, e) =>
+ {
+ UserSettingStorage.Instance.ReplaceWinR = false;
+ UserSettingStorage.Instance.Save();
+ };
+ }
+ }
+}
diff --git a/Wox.Plugin.SystemPlugins/Wox.Plugin.SystemPlugins.csproj b/Wox.Plugin.SystemPlugins/Wox.Plugin.SystemPlugins.csproj
index 6766360457..809178144d 100644
--- a/Wox.Plugin.SystemPlugins/Wox.Plugin.SystemPlugins.csproj
+++ b/Wox.Plugin.SystemPlugins/Wox.Plugin.SystemPlugins.csproj
@@ -54,6 +54,9 @@
+
+ CMDSetting.xaml
+
@@ -102,6 +105,10 @@
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
diff --git a/Wox/SettingWindow.xaml b/Wox/SettingWindow.xaml
index 889c84fcfc..37bae70fe9 100644
--- a/Wox/SettingWindow.xaml
+++ b/Wox/SettingWindow.xaml
@@ -26,14 +26,6 @@
-
-
-
-
-
-
-
-
diff --git a/Wox/SettingWindow.xaml.cs b/Wox/SettingWindow.xaml.cs
index 0406350629..3a51899797 100644
--- a/Wox/SettingWindow.xaml.cs
+++ b/Wox/SettingWindow.xaml.cs
@@ -48,27 +48,6 @@ namespace Wox
{
ctlHotkey.OnHotkeyChanged += ctlHotkey_OnHotkeyChanged;
ctlHotkey.SetHotkey(UserSettingStorage.Instance.Hotkey, false);
- cbReplaceWinR.Checked += (o, e) =>
- {
- UserSettingStorage.Instance.ReplaceWinR = true;
- UserSettingStorage.Instance.Save();
- };
- cbReplaceWinR.Unchecked += (o, e) =>
- {
- UserSettingStorage.Instance.ReplaceWinR = false;
- UserSettingStorage.Instance.Save();
- };
-
- cbLeaveCmdOpen.Checked += (o, e) => {
- UserSettingStorage.Instance.LeaveCmdOpen = true;
- UserSettingStorage.Instance.Save();
- };
-
- cbLeaveCmdOpen.Unchecked += (o, e) =>
- {
- UserSettingStorage.Instance.LeaveCmdOpen = false;
- UserSettingStorage.Instance.Save();
- };
cbHideWhenDeactive.Checked += (o, e) =>
{
@@ -82,10 +61,8 @@ namespace Wox
UserSettingStorage.Instance.Save();
};
- cbReplaceWinR.IsChecked = UserSettingStorage.Instance.ReplaceWinR;
lvCustomHotkey.ItemsSource = UserSettingStorage.Instance.CustomPluginHotkeys;
cbStartWithWindows.IsChecked = File.Exists(woxLinkPath);
- cbLeaveCmdOpen.IsChecked = UserSettingStorage.Instance.LeaveCmdOpen;
cbHideWhenDeactive.IsChecked = UserSettingStorage.Instance.HideWhenDeactive;
#region Load Theme