From 44a93d7883ba253c81dee9ffb42555d772997534 Mon Sep 17 00:00:00 2001 From: Greg Date: Fri, 17 Feb 2023 20:17:51 -0700 Subject: [PATCH] SPRX path now saves to app. --- Windows/OrbisLibraryManager/App.config | 15 ++++++++ Windows/OrbisLibraryManager/MainWindow.xaml | 5 ++- .../OrbisLibraryManager/MainWindow.xaml.cs | 9 +++++ .../OrbisLibraryManager.csproj | 12 ++++++ .../Properties/Settings.Designer.cs | 38 +++++++++++++++++++ .../Properties/Settings.settings | 9 +++++ 6 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 Windows/OrbisLibraryManager/App.config create mode 100644 Windows/OrbisLibraryManager/Properties/Settings.Designer.cs create mode 100644 Windows/OrbisLibraryManager/Properties/Settings.settings diff --git a/Windows/OrbisLibraryManager/App.config b/Windows/OrbisLibraryManager/App.config new file mode 100644 index 0000000..69c85e7 --- /dev/null +++ b/Windows/OrbisLibraryManager/App.config @@ -0,0 +1,15 @@ + + + + +
+ + + + + + /data/ + + + + \ No newline at end of file diff --git a/Windows/OrbisLibraryManager/MainWindow.xaml b/Windows/OrbisLibraryManager/MainWindow.xaml index 8480961..94c44e3 100644 --- a/Windows/OrbisLibraryManager/MainWindow.xaml +++ b/Windows/OrbisLibraryManager/MainWindow.xaml @@ -51,10 +51,11 @@ + Width="180" + LostFocus="SPRXPath_LostFocus"/> diff --git a/Windows/OrbisLibraryManager/MainWindow.xaml.cs b/Windows/OrbisLibraryManager/MainWindow.xaml.cs index 8ea63de..cdcfd11 100644 --- a/Windows/OrbisLibraryManager/MainWindow.xaml.cs +++ b/Windows/OrbisLibraryManager/MainWindow.xaml.cs @@ -41,6 +41,9 @@ namespace OrbisLibraryManager // Update State Task.Run(() => EnableTargetOptions(TargetManager.SelectedTarget.Info.Status == TargetStatusType.APIAvailable)); + + // Load settings. + SPRXPath.FieldText = Properties.Settings.Default.SPRXPath; } private void RefreshLibraryList() @@ -324,6 +327,12 @@ namespace OrbisLibraryManager TargetManager.SelectedTarget.Shutdown(); } + private void SPRXPath_LostFocus(object sender, RoutedEventArgs e) + { + Properties.Settings.Default.SPRXPath = SPRXPath.FieldText; + Properties.Settings.Default.Save(); + } + #endregion } } diff --git a/Windows/OrbisLibraryManager/OrbisLibraryManager.csproj b/Windows/OrbisLibraryManager/OrbisLibraryManager.csproj index c5ad217..d1a2d69 100644 --- a/Windows/OrbisLibraryManager/OrbisLibraryManager.csproj +++ b/Windows/OrbisLibraryManager/OrbisLibraryManager.csproj @@ -79,6 +79,18 @@ Code + + True + True + Settings.settings + + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + diff --git a/Windows/OrbisLibraryManager/Properties/Settings.Designer.cs b/Windows/OrbisLibraryManager/Properties/Settings.Designer.cs new file mode 100644 index 0000000..f907f46 --- /dev/null +++ b/Windows/OrbisLibraryManager/Properties/Settings.Designer.cs @@ -0,0 +1,38 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace OrbisLibraryManager.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.4.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("/data/")] + public string SPRXPath { + get { + return ((string)(this["SPRXPath"])); + } + set { + this["SPRXPath"] = value; + } + } + } +} diff --git a/Windows/OrbisLibraryManager/Properties/Settings.settings b/Windows/OrbisLibraryManager/Properties/Settings.settings new file mode 100644 index 0000000..ba294c4 --- /dev/null +++ b/Windows/OrbisLibraryManager/Properties/Settings.settings @@ -0,0 +1,9 @@ + + + + + + /data/ + + + \ No newline at end of file