Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions PostCodeSerialMonitor/Models/AppConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,16 @@ public class AppConfiguration
{
[Required]
[Range(1, int.MaxValue)]
public int FormatVersion { get; set; } = 1;
public int FormatVersion { get; set; } = 2;

public bool CheckForAppUpdates { get; set; } = true;
public bool CheckForCodeUpdates { get; set; } = true;
public bool CheckForFwUpdates { get; set; } = true;

[Required]
[Url]
public Uri AppUpdateUrl { get; set; } = new Uri("https://example.com/todo");

[Required]
[Url]
public Uri CodesMetaBaseUrl { get; set; } = new Uri("https://errors.xboxresearch.com");

[Required]
[Url]
public Uri FwUpdateUrl { get; set; } = new Uri("https://example.com/todo");

[Required]
public string Language { get; set; } = "en-US";

Expand Down
2 changes: 1 addition & 1 deletion PostCodeSerialMonitor/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace PostCodeSerialMonitor;

public static class ServiceCollectionExtensions
{
const int SUPPORTED_CONFIG_FORMAT_VERSION = 1;
const int SUPPORTED_CONFIG_FORMAT_VERSION = 2;
public static void AddCommonServices(this IServiceCollection collection)
{
// Configure logging
Expand Down
10 changes: 0 additions & 10 deletions PostCodeSerialMonitor/ViewModels/ConfigurationDialogViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,9 @@ public partial class ConfigurationDialogViewModel : ViewModelBase
[ObservableProperty]
private bool checkForFwUpdates;

[ObservableProperty]
private string appUpdateUrl;

[ObservableProperty]
private string codesMetaBaseUrl;

[ObservableProperty]
private string fwUpdateUrl;

[ObservableProperty]
private ObservableCollection<string> languages;

Expand All @@ -61,9 +55,7 @@ public ConfigurationDialogViewModel(ConfigurationService configurationService)
CheckForAppUpdates = _originalConfiguration.CheckForAppUpdates;
CheckForCodeUpdates = _originalConfiguration.CheckForCodeUpdates;
CheckForFwUpdates = _originalConfiguration.CheckForFwUpdates;
AppUpdateUrl = _originalConfiguration.AppUpdateUrl.ToString();
CodesMetaBaseUrl = _originalConfiguration.CodesMetaBaseUrl.ToString();
FwUpdateUrl = _originalConfiguration.FwUpdateUrl.ToString();
SelectedLanguage = _originalConfiguration.Language;

//Add available languages
Expand All @@ -80,9 +72,7 @@ await _configurationService.UpdateConfigurationAsync(config =>
config.CheckForAppUpdates = CheckForAppUpdates;
config.CheckForCodeUpdates = CheckForCodeUpdates;
config.CheckForFwUpdates = CheckForFwUpdates;
config.AppUpdateUrl = new Uri(AppUpdateUrl);
config.CodesMetaBaseUrl = new Uri(CodesMetaBaseUrl);
config.FwUpdateUrl = new Uri(FwUpdateUrl);
config.Language = SelectedLanguage;
});

Expand Down
8 changes: 1 addition & 7 deletions PostCodeSerialMonitor/Views/ConfigurationDialog.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@

<CheckBox Content="{x:Static assets:Resources.CheckApplicationUpdates}"
IsChecked="{Binding CheckForAppUpdates}"/>
<TextBox Text="{Binding AppUpdateUrl}"
Watermark="{x:Static assets:Resources.ApplicationUpdateUrl}"
IsEnabled="{Binding CheckForAppUpdates}"/>


<CheckBox Content="{x:Static assets:Resources.CheckCodeUpdates}"
IsChecked="{Binding CheckForCodeUpdates}"
Margin="0,10,0,0"/>
Expand All @@ -37,9 +34,6 @@
<CheckBox Content="{x:Static assets:Resources.CheckFirmwareUpdates}"
IsChecked="{Binding CheckForFwUpdates}"
Margin="0,10,0,0"/>
<TextBox Text="{Binding FwUpdateUrl}"
Watermark="{x:Static assets:Resources.FirmwareUpdateUrl}"
IsEnabled="{Binding CheckForFwUpdates}"/>
</StackPanel>
</ScrollViewer>

Expand Down
4 changes: 1 addition & 3 deletions PostCodeSerialMonitor/config.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{
"AppConfiguration": {
"FormatVersion": 1,
"FormatVersion": 2,
"CheckForAppUpdates": true,
"CheckForCodeUpdates": true,
"CheckForFwUpdates": true,
"AppUpdateUrl": "https://example.com/todo",
"CodesMetaBaseUrl": "https://errors.xboxresearch.com/",
"FwUpdateUrl": "https://example.com/todo",
"MetaStoragePath": "meta",
"Language": "en-US",
"MetaJsonUrl": "https://errors.xboxresearch.com/meta.json"
Expand Down