Skip to content
This repository has been archived by the owner on Dec 11, 2022. It is now read-only.

Commit

Permalink
Merge pull request #23 from porohkun/v0.2
Browse files Browse the repository at this point in the history
V0.2
  • Loading branch information
porohkun authored Aug 14, 2020
2 parents 3ec0d0a + cc9b02f commit 29cd5f0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ScreenSlicer/Commands/RestoreDefaultRulesCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected override void ExecuteInternal(bool parameter)
foreach (var rule in rulesTuple.Where(r => r.IsSelected))
{
var oldRule = Settings.Instance.Compatibility.Rules.FirstOrDefault(r => r.Name == rule.Rule.Name);
int index = oldRule == null ? 0 : Settings.Instance.Compatibility.Rules.IndexOf(oldRule);
int index = oldRule == null ? Settings.Instance.Compatibility.Rules.Count : Settings.Instance.Compatibility.Rules.IndexOf(oldRule);
if (oldRule != null)
Settings.Instance.Compatibility.Rules.Remove(oldRule);
Settings.Instance.Compatibility.Rules.Insert(index, rule.Rule);
Expand Down
4 changes: 2 additions & 2 deletions ScreenSlicer/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.2.0.0")]
[assembly: AssemblyFileVersion("0.2.0.0")]
[assembly: AssemblyVersion("0.2.1.0")]
[assembly: AssemblyFileVersion("0.2.1.0")]
7 changes: 6 additions & 1 deletion ScreenSlicer/Settings/Settings.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Newtonsoft.Json;
using ScreenSlicer.Commands;
using System;
using System.ComponentModel;
using System.IO;
Expand Down Expand Up @@ -163,7 +164,11 @@ private static Settings Load()
}
}
}
result = result ?? new Settings(true);
if (result == null)
{
result = new Settings(true);
new RestoreDefaultRulesCommand().Execute(true);
}
result.PropertyChanged += Save;
return result;
}
Expand Down
1 change: 1 addition & 0 deletions ScreenSlicer/Updating/Updater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public async void CheckUpdates()
{
mgr.CreateShortcutForThisExe();
mgr.CreateRunAtWindowsStartupRegistry();
_restoreDefaultRules.Execute(true);
},
onAppUpdate: v =>
{
Expand Down

0 comments on commit 29cd5f0

Please sign in to comment.