Skip to content

Commit

Permalink
Make application settings portable
Browse files Browse the repository at this point in the history
- Implement PortableJsonSettingsProvider
- Set all settings to roaming=True
  • Loading branch information
DJDoubleD committed Aug 14, 2023
1 parent 2d94fcc commit 44a2280
Show file tree
Hide file tree
Showing 6 changed files with 243 additions and 182 deletions.
274 changes: 137 additions & 137 deletions QobuzDownloaderX/App.config
Original file line number Diff line number Diff line change
@@ -1,149 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="QobuzDownloaderX.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<userSettings>
<QobuzDownloaderX.Properties.Settings>
<setting name="savedFolder" serializeAs="String">
<value />
</setting>
<setting name="savedAppID" serializeAs="String">
<value />
</setting>
<setting name="savedEmail" serializeAs="String">
<value />
</setting>
<setting name="savedPassword" serializeAs="String">
<value />
</setting>
<setting name="savedFormatID" serializeAs="String">
<value />
</setting>
<setting name="UpgradeRequired" serializeAs="String">
<value>True</value>
</setting>
<setting name="albumTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="artistTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="albumArtistTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="trackTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="totalTracksTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="discTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="totalDiscsTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="genreTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="isrcTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="upcTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="copyrightTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="yearTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="explicitTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="imageTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="commentTag" serializeAs="String">
<value>False</value>
</setting>
<setting name="composerTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="trackTitleTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="commentText" serializeAs="String">
<value />
</setting>
<setting name="quality1" serializeAs="String">
<value>False</value>
</setting>
<setting name="quality2" serializeAs="String">
<value>False</value>
</setting>
<setting name="quality3" serializeAs="String">
<value>False</value>
</setting>
<setting name="quality4" serializeAs="String">
<value>True</value>
</setting>
<setting name="qualityFormat" serializeAs="String">
<value>27</value>
</setting>
<setting name="audioType" serializeAs="String">
<value>.flac</value>
</setting>
<setting name="savedUserID" serializeAs="String">
<value />
</setting>
<setting name="savedUserAuthToken" serializeAs="String">
<value />
</setting>
<setting name="savedAltLoginValue" serializeAs="String">
<value>0</value>
</setting>
<setting name="savedArtSize" serializeAs="String">
<value>2</value>
</setting>
<setting name="typeTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="savedMaxLength" serializeAs="String">
<value>100</value>
</setting>
<setting name="savedFilenameTemplate" serializeAs="String">
<value>1</value>
</setting>
<setting name="savedFilenameTemplateString" serializeAs="String">
<value> - </value>
</setting>
<setting name="producerTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="labelTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="involvedPeopleTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="initialListSeparator" serializeAs="String">
<value>, </value>
</setting>
<setting name="listEndSeparator" serializeAs="String">
<value> &amp; </value>
</setting>
<setting name="mergePerformers" serializeAs="String">
<value>False</value>
</setting>
</QobuzDownloaderX.Properties.Settings>
</userSettings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
Expand All @@ -152,4 +16,140 @@
</dependentAssembly>
</assemblyBinding>
</runtime>
<userSettings>
<QobuzDownloaderX.Properties.Settings>
<setting name="savedFolder" serializeAs="String">
<value />
</setting>
<setting name="savedAppID" serializeAs="String">
<value />
</setting>
<setting name="savedEmail" serializeAs="String">
<value />
</setting>
<setting name="savedPassword" serializeAs="String">
<value />
</setting>
<setting name="savedFormatID" serializeAs="String">
<value />
</setting>
<setting name="UpgradeRequired" serializeAs="String">
<value>True</value>
</setting>
<setting name="albumTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="artistTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="albumArtistTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="trackTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="totalTracksTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="discTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="totalDiscsTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="genreTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="isrcTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="upcTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="copyrightTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="yearTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="explicitTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="imageTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="commentTag" serializeAs="String">
<value>False</value>
</setting>
<setting name="composerTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="trackTitleTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="commentText" serializeAs="String">
<value />
</setting>
<setting name="quality1" serializeAs="String">
<value>False</value>
</setting>
<setting name="quality2" serializeAs="String">
<value>False</value>
</setting>
<setting name="quality3" serializeAs="String">
<value>False</value>
</setting>
<setting name="quality4" serializeAs="String">
<value>True</value>
</setting>
<setting name="qualityFormat" serializeAs="String">
<value>27</value>
</setting>
<setting name="audioType" serializeAs="String">
<value>.flac</value>
</setting>
<setting name="savedUserID" serializeAs="String">
<value />
</setting>
<setting name="savedUserAuthToken" serializeAs="String">
<value />
</setting>
<setting name="savedAltLoginValue" serializeAs="String">
<value>0</value>
</setting>
<setting name="savedArtSize" serializeAs="String">
<value>2</value>
</setting>
<setting name="typeTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="savedMaxLength" serializeAs="String">
<value>100</value>
</setting>
<setting name="savedFilenameTemplate" serializeAs="String">
<value>1</value>
</setting>
<setting name="savedFilenameTemplateString" serializeAs="String">
<value> - </value>
</setting>
<setting name="producerTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="labelTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="involvedPeopleTag" serializeAs="String">
<value>True</value>
</setting>
<setting name="initialListSeparator" serializeAs="String">
<value>, </value>
</setting>
<setting name="listEndSeparator" serializeAs="String">
<value> &amp; </value>
</setting>
<setting name="mergePerformers" serializeAs="String">
<value>False</value>
</setting>
</QobuzDownloaderX.Properties.Settings>
</userSettings>
</configuration>
7 changes: 6 additions & 1 deletion QobuzDownloaderX/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using QobuzDownloaderX.Shared;
using Bluegrams.Application;
using QobuzDownloaderX.Shared;
using System;
using System.Globalization;
using System.Windows.Forms;
Expand All @@ -13,6 +14,10 @@ internal static class Program
[STAThread]
private static void Main()
{
// Make the default settings class portable
PortableJsonSettingsProvider.SettingsDirectory = FileTools.GetInitializedSettingsDir();
PortableJsonSettingsProvider.ApplyProvider(Properties.Settings.Default);

// Use en-US formatting everywhere for consistency
var culture = CultureInfo.GetCultureInfo("en-US");

Expand Down
Loading

1 comment on commit 44a2280

@DJDoubleD
Copy link
Owner Author

@DJDoubleD DJDoubleD commented on 44a2280 Aug 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to mention in commit message that it resolves #17.
So will push the amended commit with just the changed description.

Please sign in to comment.