diff --git a/WeeXnes/App.xaml.cs b/WeeXnes/App.xaml.cs index 1642c08..9dae338 100644 --- a/WeeXnes/App.xaml.cs +++ b/WeeXnes/App.xaml.cs @@ -84,6 +84,11 @@ namespace WeeXnes SaveSettingsHandler.Data.KeyManager.Section, SaveSettingsHandler.Data.KeyManager.CopyOnSelect)); + KeyManagerView.Data.sortList.Value = + Convert.ToBoolean(SettingsView.Data.settingsFile.GetValue( + SaveSettingsHandler.Data.KeyManager.Section, + SaveSettingsHandler.Data.KeyManager.SortList)); + //Load paths string customRpcPath = SettingsView.Data.settingsFile.GetValue( diff --git a/WeeXnes/Core/Global.cs b/WeeXnes/Core/Global.cs index 70dc745..f1baff7 100644 --- a/WeeXnes/Core/Global.cs +++ b/WeeXnes/Core/Global.cs @@ -8,7 +8,7 @@ namespace WeeXnes.Core { public class Information { - public const string Version = "4.4.1"; + public const string Version = "4.4.2"; public const string EncryptionHash = "8zf5#RdyQ]$4x4_"; public const string ApiUrl = "https://api.github.com/repos/weexnes/weexnessuite/releases/latest"; } diff --git a/WeeXnes/Core/SaveSettingsHandler.cs b/WeeXnes/Core/SaveSettingsHandler.cs index 3237553..e97ed47 100644 --- a/WeeXnes/Core/SaveSettingsHandler.cs +++ b/WeeXnes/Core/SaveSettingsHandler.cs @@ -24,6 +24,7 @@ namespace WeeXnes.Core public const string Section = "KEY_MANAGER"; public const string CensorKeys = "CensorKeys"; public const string CopyOnSelect = "CopyOnSelect"; + public const string SortList = "SortList"; } public static class DiscordRpcFiles { @@ -58,6 +59,18 @@ namespace WeeXnes.Core KeyManagerView.Data.copyOnSelect.Value.ToString() ); }; + + + KeyManagerView.Data.sortList.ValueChanged += () => + { + SettingsView.Data.settingsFile.SetValue( + Data.KeyManager.Section, + Data.KeyManager.SortList, + KeyManagerView.Data.sortList.Value.ToString() + ); + }; + + Global.AppDataPathRPC.ValueChanged += () => { SettingsView.Data.settingsFile.SetValue( diff --git a/WeeXnes/Views/KeyManager/KeyManagerView.xaml b/WeeXnes/Views/KeyManager/KeyManagerView.xaml index d74c9c3..bcf0ac2 100644 --- a/WeeXnes/Views/KeyManager/KeyManagerView.xaml +++ b/WeeXnes/Views/KeyManager/KeyManagerView.xaml @@ -17,7 +17,9 @@ Background="Transparent" Foreground="White" BorderThickness="0" - SelectionChanged="ListviewKeys_OnSelectionChanged"> + SelectionChanged="ListviewKeys_OnSelectionChanged" + IsTextSearchEnabled="True" + > KeyItemsList = new BindingList(); public static UpdateVar censorKeys = new UpdateVar(); public static UpdateVar copyOnSelect = new UpdateVar(); + public static UpdateVar sortList = new UpdateVar(); } public KeyManagerView() { @@ -24,6 +26,9 @@ namespace WeeXnes.Views.KeyManager } private void KeyManagerView_OnLoaded(object sender, RoutedEventArgs e) { + if(Data.sortList.Value) + resortList(); + ListviewKeys.Items.Refresh(); } @@ -52,6 +57,16 @@ namespace WeeXnes.Views.KeyManager } ClearInputs(); + + if(Data.sortList.Value) + resortList(); + } + + private void resortList() + { + BindingList newList = new BindingList(Data.KeyItemsList.OrderBy(x => x.Name).ToList()); + Data.KeyItemsList = newList; + ListviewKeys.ItemsSource = Data.KeyItemsList; } private void ClearInputs() diff --git a/WeeXnes/Views/Settings/SettingsView.xaml b/WeeXnes/Views/Settings/SettingsView.xaml index 1713fea..36fe999 100644 --- a/WeeXnes/Views/Settings/SettingsView.xaml +++ b/WeeXnes/Views/Settings/SettingsView.xaml @@ -61,6 +61,10 @@ Name="CheckboxCopyOnSelect" Checked="CheckboxCopyOnSelect_OnChecked" Unchecked="CheckboxCopyOnSelect_OnUnchecked"/> + diff --git a/WeeXnes/Views/Settings/SettingsView.xaml.cs b/WeeXnes/Views/Settings/SettingsView.xaml.cs index c05f519..d69735a 100644 --- a/WeeXnes/Views/Settings/SettingsView.xaml.cs +++ b/WeeXnes/Views/Settings/SettingsView.xaml.cs @@ -29,6 +29,7 @@ namespace WeeXnes.Views.Settings { CheckboxCensorKeys.IsChecked = KeyManagerView.Data.censorKeys.Value; CheckboxCopyOnSelect.IsChecked = KeyManagerView.Data.copyOnSelect.Value; + CheckboxSortKeys.IsChecked = KeyManagerView.Data.sortList.Value; } private void CheckboxCensorKeys_OnChecked(object sender, RoutedEventArgs e) { @@ -120,5 +121,15 @@ namespace WeeXnes.Views.Settings { KeyManagerView.Data.copyOnSelect.Value = false; } + + private void CheckboxSortKeys_OnChecked(object sender, RoutedEventArgs e) + { + KeyManagerView.Data.sortList.Value = true; + } + + private void CheckboxSortKeys_OnUnchecked(object sender, RoutedEventArgs e) + { + KeyManagerView.Data.sortList.Value = false; + } } } \ No newline at end of file diff --git a/WeeXnes/WeeXnes.csproj b/WeeXnes/WeeXnes.csproj index 785abdb..48b867b 100644 --- a/WeeXnes/WeeXnes.csproj +++ b/WeeXnes/WeeXnes.csproj @@ -4,7 +4,7 @@ Debug AnyCPU - 4.4.1 + 4.4.2 {4B33CEE7-C74D-43B9-B99A-8B273D5195BC} WinExe WeeXnes