Skip to content

Commit

Permalink
Keep user.settings after upgrade
Browse files Browse the repository at this point in the history
- Fixes #234
- Love the kitty anyway
  • Loading branch information
bitbeans committed Feb 24, 2018
1 parent 665e698 commit c2da26b
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
3 changes: 3 additions & 0 deletions SimpleDnsCrypt/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@
<setting name="QueryLogFile" serializeAs="String">
<value />
</setting>
<setting name="UpgradeRequired" serializeAs="String">
<value>True</value>
</setting>
</SimpleDnsCrypt.Properties.Settings>
</userSettings>
</configuration>
12 changes: 12 additions & 0 deletions SimpleDnsCrypt/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions SimpleDnsCrypt/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,8 @@
<Setting Name="QueryLogFile" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="UpgradeRequired" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
</Settings>
</SettingsFile>
7 changes: 7 additions & 0 deletions SimpleDnsCrypt/ViewModels/LoaderViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,13 @@ private async void InitializeApplication()
[ImportingConstructor]
public LoaderViewModel(IWindowManager windowManager, IEventAggregator events)
{
if (Properties.Settings.Default.UpgradeRequired)
{
Properties.Settings.Default.Upgrade();
Properties.Settings.Default.UpgradeRequired = false;
Properties.Settings.Default.Save();
}

_windowManager = windowManager;
_events = events;
_events.Subscribe(this);
Expand Down

0 comments on commit c2da26b

Please sign in to comment.