Add prerelease option

This commit is contained in:
2025-09-24 18:29:32 -04:00
parent 9e2e7aabe8
commit f3145d8811
11 changed files with 40 additions and 6 deletions

View File

@@ -24,7 +24,7 @@
<None Remove="Resources\Warning.ico" /> <None Remove="Resources\Warning.ico" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="ChrisKaczor.ApplicationUpdate" Version="1.0.5" /> <PackageReference Include="ChrisKaczor.ApplicationUpdate" Version="1.0.7" />
<PackageReference Include="ChrisKaczor.GenericSettingsProvider" Version="1.0.4" /> <PackageReference Include="ChrisKaczor.GenericSettingsProvider" Version="1.0.4" />
<PackageReference Include="ChrisKaczor.InstalledBrowsers" Version="1.0.4" /> <PackageReference Include="ChrisKaczor.InstalledBrowsers" Version="1.0.4" />
<PackageReference Include="ChrisKaczor.Wpf.Application.SingleInstance" Version="1.0.5" /> <PackageReference Include="ChrisKaczor.Wpf.Application.SingleInstance" Version="1.0.5" />

View File

@@ -178,7 +178,7 @@ public partial class MainWindow
if (DateTime.Now - Settings.Default.LastVersionCheck >= Settings.Default.VersionCheckInterval) if (DateTime.Now - Settings.Default.LastVersionCheck >= Settings.Default.VersionCheckInterval)
{ {
// Get the update information // Get the update information
UpdateCheck.CheckForUpdate().Wait(); UpdateCheck.CheckForUpdate(Settings.Default.IncludePrerelease).Wait();
// Update the last check time // Update the last check time
Settings.Default.LastVersionCheck = DateTime.Now; Settings.Default.LastVersionCheck = DateTime.Now;

View File

@@ -90,7 +90,7 @@ public partial class MainWindow : IDisposable
// Check for update // Check for update
if (Settings.Default.CheckVersionAtStartup) if (Settings.Default.CheckVersionAtStartup)
await UpdateCheck.CheckForUpdate(); await UpdateCheck.CheckForUpdate(Settings.Default.IncludePrerelease);
// Show the link if updates are available // Show the link if updates are available
if (UpdateCheck.UpdateAvailable) if (UpdateCheck.UpdateAvailable)

View File

@@ -34,6 +34,6 @@ public partial class MainWindow
private void HandleNewVersionLinkClick(object sender, RoutedEventArgs e) private void HandleNewVersionLinkClick(object sender, RoutedEventArgs e)
{ {
UpdateCheck.DisplayUpdateInformation(true); UpdateCheck.DisplayUpdateInformation(true, Settings.Default.IncludePrerelease);
} }
} }

View File

@@ -13,6 +13,10 @@
Name="CheckVersionOnStartupCheckBox" Name="CheckVersionOnStartupCheckBox"
IsChecked="{Binding Source={x:Static properties:Settings.Default}, Path=CheckVersionAtStartup}" IsChecked="{Binding Source={x:Static properties:Settings.Default}, Path=CheckVersionAtStartup}"
Click="OnSaveSettings" /> Click="OnSaveSettings" />
<CheckBox Content="{x:Static properties:Resources.includePrereleaseCheckBox}"
Name="IncludePrereleaseCheckBox"
IsChecked="{Binding Source={x:Static properties:Settings.Default}, Path=IncludePrerelease}"
Click="OnSaveSettings" />
<Button Content="{x:Static properties:Resources.checkVersionNowButton}" <Button Content="{x:Static properties:Resources.checkVersionNowButton}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Click="HandleCheckVersionNowButtonClick" /> Click="HandleCheckVersionNowButtonClick" />

View File

@@ -15,7 +15,7 @@ public partial class UpdateOptionsPanel
private void HandleCheckVersionNowButtonClick(object sender, RoutedEventArgs e) private void HandleCheckVersionNowButtonClick(object sender, RoutedEventArgs e)
{ {
UpdateCheck.DisplayUpdateInformation(true); UpdateCheck.DisplayUpdateInformation(true, Settings.Default.IncludePrerelease);
} }
private void OnSaveSettings(object sender, RoutedEventArgs e) private void OnSaveSettings(object sender, RoutedEventArgs e)

View File

@@ -957,6 +957,15 @@ namespace FeedCenter.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Include _prerelease.
/// </summary>
public static string includePrereleaseCheckBox {
get {
return ResourceManager.GetString("includePrereleaseCheckBox", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Last Updated. /// Looks up a localized string similar to Last Updated.
/// </summary> /// </summary>

View File

@@ -561,4 +561,7 @@ All feeds currently in category "{0}" will be moved to the default category.</va
<data name="FeedReadResult_TooManyRequests" xml:space="preserve"> <data name="FeedReadResult_TooManyRequests" xml:space="preserve">
<value>Too many requests</value> <value>Too many requests</value>
</data> </data>
<data name="includePrereleaseCheckBox" xml:space="preserve">
<value>Include _prerelease</value>
</data>
</root> </root>

View File

@@ -12,7 +12,7 @@ namespace FeedCenter.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.5.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.14.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -302,5 +302,17 @@ namespace FeedCenter.Properties {
return ((string)(this["DatabaseFile"])); return ((string)(this["DatabaseFile"]));
} }
} }
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool IncludePrerelease {
get {
return ((bool)(this["IncludePrerelease"]));
}
set {
this["IncludePrerelease"] = value;
}
}
} }
} }

View File

@@ -74,5 +74,8 @@
<Setting Name="DatabaseFile" Type="System.String" Scope="Application"> <Setting Name="DatabaseFile" Type="System.String" Scope="Application">
<Value Profile="(Default)">FeedCenter.realm</Value> <Value Profile="(Default)">FeedCenter.realm</Value>
</Setting> </Setting>
<Setting Name="IncludePrerelease" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings> </Settings>
</SettingsFile> </SettingsFile>

View File

@@ -49,6 +49,9 @@
<setting name="DefaultUserAgent" serializeAs="String"> <setting name="DefaultUserAgent" serializeAs="String">
<value /> <value />
</setting> </setting>
<setting name="IncludePrerelease" serializeAs="String">
<value>False</value>
</setting>
</FeedCenter.Properties.Settings> </FeedCenter.Properties.Settings>
</userSettings> </userSettings>
<applicationSettings> <applicationSettings>