Skip to content

Commit 5201fa9

Browse files
committed
1.7.3
[New] File Dialog to choose path for run program action [Changed] Switch to json to save UserSettings [Bug fixes] - HDR cannot be disabled through actions - Missing logo in Info pop up - Administrative rights were necessary for event logging (disabled for now) - Settings couldn't be saved and loaded properly
1 parent 811c23a commit 5201fa9

38 files changed

+635
-413
lines changed

Build.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ function buildVS
3131
Write-Host "Building x86 $($path)" -foregroundcolor green
3232
& "$($msBuildExe)" "$($path)" /t:Build /m /property:Configuration=Release /property:Platform=x86
3333

34-
$x64zip = ".\Releases\Release_HDRProfile_$($version)_x64.zip"
35-
$x86zip = ".\Releases\Release_HDRProfile_$($version)_x86.zip"
34+
$x64zip = ".\Releases\Release_AutoHDR_$($version)_x64.zip"
35+
$x86zip = ".\Releases\Release_AutoHDR_$($version)_x86.zip"
3636

3737

3838

RunBuild.bat

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
@Echo off
21
powershell "%~dp0Build.ps1"
32
pause

Source/HDRProfile/App.xaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -782,9 +782,6 @@
782782
<DataTemplate DataType="{x:Type local:ApplicationAdder}">
783783
<views:ApplicationAdderView></views:ApplicationAdderView>
784784
</DataTemplate>
785-
<DataTemplate DataType="{x:Type prflActns:ApplicationAction}">
786-
<views:ApplicationActionView></views:ApplicationActionView>
787-
</DataTemplate>
788785
<DataTemplate DataType="{x:Type prflActns:ProfileActionAdder}">
789786
<views:ProfileActionAdderView></views:ProfileActionAdderView>
790787
</DataTemplate>

Source/HDRProfile/ApplicationAdder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ private void GetUWPAplication()
9696
}
9797
};
9898
if (DialogService != null)
99-
DialogService.ShowDialogModal(uwpDialog);
99+
DialogService.ShowDialogModal(uwpDialog, new System.Drawing.Size(800,600));
100100
}
101101

102102
}

Source/HDRProfile/ApplicationItem.cs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
using CodectoryCore.UI.Wpf;
2+
using Newtonsoft.Json;
23
using System;
34
using System.Collections.Generic;
45
using System.Diagnostics;
56
using System.Drawing;
67
using System.IO;
78
using System.Linq;
9+
using System.Runtime.Serialization;
810
using System.Text;
911
using System.Threading.Tasks;
1012
using System.Windows.Controls;
1113
using System.Xml.Serialization;
1214

1315
namespace AutoHDR
1416
{
17+
[JsonObject(MemberSerialization.OptIn)]
1518
public class ApplicationItem : BaseViewModel, IEquatable<ApplicationItem>
1619
{
1720
private bool _isUWP = false;
@@ -24,19 +27,22 @@ public class ApplicationItem : BaseViewModel, IEquatable<ApplicationItem>
2427
private string _uwpApplicationID;
2528
private string _uwpIconPath;
2629

27-
30+
[JsonProperty]
2831
public string DisplayName { get => displayName; set { displayName = value; OnPropertyChanged(); } }
32+
[JsonProperty]
2933
public string ApplicationName { get => _applicationName; set { _applicationName = value; OnPropertyChanged(); } }
34+
[JsonProperty]
3035
public string ApplicationFilePath { get => _applicationFilePath; set { _applicationFilePath = value; try { Icon = Tools.GetFileIcon(value); } catch { } OnPropertyChanged(); } }
31-
// public bool RestartProcess { get => _restartProcess; set { _restartProcess = value; OnPropertyChanged(); } }
36+
// public bool RestartProcess { get => _restartProcess; set { _restartProcess = value; OnPropertyChanged(); } }
37+
[JsonProperty]
3238
public bool IsUWP { get => _isUWP; set { _isUWP = value; OnPropertyChanged(); } }
3339

34-
[XmlIgnore]
3540
public Bitmap Icon { get => icon; set { icon = value; OnPropertyChanged(); } }
36-
41+
[JsonProperty]
3742
public string UWPFamilyPackageName { get => _uwpFamilyPackageName; set { _uwpFamilyPackageName = value; OnPropertyChanged(); } }
38-
43+
[JsonProperty]
3944
public string UWPApplicationID { get => _uwpApplicationID; set { _uwpApplicationID = value; OnPropertyChanged(); } }
45+
[JsonProperty]
4046
public string UWPIconPath { get => _uwpIconPath; set { _uwpIconPath = value; try { Icon = new Bitmap(Bitmap.FromFile(value)); } catch { }OnPropertyChanged(); } }
4147

4248

Source/HDRProfile/ApplicationProfileAssignment.cs

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,64 @@
11
using AutoHDR.Profiles;
22
using CodectoryCore.UI.Wpf;
3+
using Newtonsoft.Json;
34
using System;
45
using System.Collections.Generic;
56
using System.Collections.ObjectModel;
67
using System.Linq;
8+
using System.Runtime.Serialization;
79
using System.Text;
810
using System.Threading.Tasks;
911

1012
namespace AutoHDR
1113
{
14+
[JsonObject(MemberSerialization.OptIn)]
1215
public class ApplicationProfileAssignment : BaseViewModel
1316
{
1417
private int _position = -1;
1518
private ApplicationItem _application = null;
1619

17-
private Profiles.Profile _profile = null;
1820

1921
private static SortableObservableCollection<ApplicationProfileAssignment> Assignments => Globals.Instance.Settings.ApplicationProfileAssignments;
2022

23+
[JsonProperty]
2124
public ApplicationItem Application { get => _application; set { _application = value; OnPropertyChanged(); }
2225
}
2326

24-
public Profile Profile {
25-
get => _profile;
26-
set { _profile = value; OnPropertyChanged(); Globals.Instance.SaveSettings(); }
27+
private Guid _profileGuid = Guid.Empty;
28+
29+
[JsonProperty]
30+
public Guid ProfileGUID
31+
{
32+
get => _profileGuid;
33+
set
34+
{
35+
_profileGuid = value;
36+
OnPropertyChanged();
37+
OnPropertyChanged(nameof(Profile));
38+
}
2739
}
2840

29-
public int Position { get => _position; set { _position = value; OnPropertyChanged(); Globals.Instance.SaveSettings(); } }
41+
public Profile Profile {
42+
get
43+
{
44+
if (Globals.Instance.Settings.ApplicationProfiles.Any(p => p.GUID.Equals(_profileGuid)))
45+
return Globals.Instance.Settings.ApplicationProfiles.First(p => p.GUID.Equals(_profileGuid));
46+
else
47+
return null;
48+
}
49+
set
50+
{
51+
if (value == null)
52+
{_profileGuid = Guid.Empty;
53+
return;
54+
}
55+
_profileGuid = value.GUID.Equals(Guid.Empty) ? Guid.NewGuid() : value.GUID; OnPropertyChanged(); OnPropertyChanged(nameof(ProfileGUID));
56+
}
57+
}
58+
59+
[JsonProperty]
60+
61+
public int Position { get => _position; set { _position = value; OnPropertyChanged(); } }
3062

3163

3264
private ApplicationProfileAssignment()
@@ -48,9 +80,7 @@ public void RemoveAssignment()
4880
a.Position = a.Position - 1;
4981
}
5082
Assignments.Remove(this);
51-
Assignments.Sort(x => x.Position, System.ComponentModel.ListSortDirection.Ascending);
52-
Globals.Instance.SaveSettings();
53-
}
83+
Assignments.Sort(x => x.Position, System.ComponentModel.ListSortDirection.Ascending); }
5484

5585
public void ChangePosition(bool up)
5686
{
@@ -65,8 +95,6 @@ public void ChangePosition(bool up)
6595
}
6696
Position = newPosition;
6797
Assignments.Sort(x => x.Position, System.ComponentModel.ListSortDirection.Ascending);
68-
69-
Globals.Instance.SaveSettings();
7098
}
7199

72100

@@ -77,7 +105,6 @@ public static ApplicationProfileAssignment NewAssigment(ApplicationItem applicat
77105
assigment.Position = GetNextPosition();
78106
Assignments.Add(assigment);
79107
Assignments.Sort(x => x.Position, System.ComponentModel.ListSortDirection.Ascending);
80-
Globals.Instance.SaveSettings();
81108
return assigment;
82109
}
83110

Source/HDRProfile/AutoHDR.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@
381381
<Resource Include="Logo.ico" />
382382
</ItemGroup>
383383
<ItemGroup>
384-
<None Include="Resources\Logo.png" />
384+
<Resource Include="Resources\Logo.png" />
385385
</ItemGroup>
386386
<ItemGroup>
387387
<Folder Include="Plugins\" />

0 commit comments

Comments
 (0)