mirror of
https://github.com/ckaczor/FeedCenter.git
synced 2026-01-14 09:58:53 -05:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f3145d8811 | |||
| 9e2e7aabe8 | |||
| 7ee84f079b | |||
| 8f70003bef | |||
| 38f093dc5c | |||
| e5bdc80d10 | |||
| 260268194a | |||
| 8ecde89be0 | |||
| 845e80577c | |||
| 31a04b13e6 |
@@ -24,7 +24,7 @@
|
||||
<None Remove="Resources\Warning.ico" />
|
||||
</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.InstalledBrowsers" Version="1.0.4" />
|
||||
<PackageReference Include="ChrisKaczor.Wpf.Application.SingleInstance" Version="1.0.5" />
|
||||
@@ -34,7 +34,7 @@
|
||||
<PackageReference Include="ChrisKaczor.Wpf.Controls.Toolbar" Version="1.0.3" />
|
||||
<PackageReference Include="ChrisKaczor.Wpf.Validation" Version="1.0.4" />
|
||||
<PackageReference Include="ChrisKaczor.Wpf.Windows.ControlBox" Version="1.0.3" />
|
||||
<PackageReference Include="ChrisKaczor.Wpf.Windows.SnappingWindow" Version="1.0.3" />
|
||||
<PackageReference Include="ChrisKaczor.Wpf.Windows.SnappingWindow" Version="1.0.4" />
|
||||
<PackageReference Include="Dapper" Version="2.0.123" />
|
||||
<PackageReference Include="DebounceThrottle" Version="2.0.0" />
|
||||
<PackageReference Include="H.NotifyIcon.Wpf" Version="2.0.108" />
|
||||
@@ -44,7 +44,7 @@
|
||||
<PackageReference Include="Microsoft.SqlServer.Compact" Version="4.0.8876.1" GeneratePathProperty="true">
|
||||
<NoWarn>NU1701</NoWarn>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Windows.Compatibility" Version="7.0.1" />
|
||||
<PackageReference Include="Microsoft.Windows.Compatibility" Version="7.0.6" />
|
||||
<PackageReference Include="NameBasedGrid" Version="0.10.1">
|
||||
<NoWarn>NU1701</NoWarn>
|
||||
</PackageReference>
|
||||
|
||||
@@ -202,6 +202,9 @@ public partial class Feed : RealmObject, INotifyDataErrorInfo
|
||||
case FeedReadResult.NotEnabled:
|
||||
case FeedReadResult.NotModified:
|
||||
|
||||
// Reset status to success
|
||||
LastReadResult = FeedReadResult.Success;
|
||||
|
||||
// Ignore
|
||||
break;
|
||||
|
||||
@@ -353,6 +356,9 @@ public partial class Feed : RealmObject, INotifyDataErrorInfo
|
||||
{
|
||||
switch (httpRequestException.StatusCode)
|
||||
{
|
||||
case HttpStatusCode.TooManyRequests:
|
||||
return Tuple.Create(FeedReadResult.TooManyRequests, string.Empty);
|
||||
|
||||
case HttpStatusCode.ServiceUnavailable:
|
||||
return Tuple.Create(FeedReadResult.TemporarilyUnavailable, string.Empty);
|
||||
|
||||
|
||||
@@ -15,5 +15,6 @@ public enum FeedReadResult
|
||||
ConnectionFailed,
|
||||
ServerError,
|
||||
Moved,
|
||||
TemporarilyUnavailable
|
||||
TemporarilyUnavailable,
|
||||
TooManyRequests
|
||||
}
|
||||
@@ -178,7 +178,7 @@ public partial class MainWindow
|
||||
if (DateTime.Now - Settings.Default.LastVersionCheck >= Settings.Default.VersionCheckInterval)
|
||||
{
|
||||
// Get the update information
|
||||
UpdateCheck.CheckForUpdate().Wait();
|
||||
UpdateCheck.CheckForUpdate(Settings.Default.IncludePrerelease).Wait();
|
||||
|
||||
// Update the last check time
|
||||
Settings.Default.LastVersionCheck = DateTime.Now;
|
||||
|
||||
@@ -90,7 +90,7 @@ public partial class MainWindow : IDisposable
|
||||
|
||||
// Check for update
|
||||
if (Settings.Default.CheckVersionAtStartup)
|
||||
await UpdateCheck.CheckForUpdate();
|
||||
await UpdateCheck.CheckForUpdate(Settings.Default.IncludePrerelease);
|
||||
|
||||
// Show the link if updates are available
|
||||
if (UpdateCheck.UpdateAvailable)
|
||||
|
||||
@@ -24,17 +24,18 @@ public partial class MainWindow
|
||||
{
|
||||
StopTimer();
|
||||
|
||||
_mainTimer.Dispose();
|
||||
_mainTimer?.Dispose();
|
||||
_mainTimer = null;
|
||||
}
|
||||
|
||||
private void StartTimer()
|
||||
{
|
||||
_mainTimer.Start();
|
||||
_mainTimer?.Start();
|
||||
}
|
||||
|
||||
private void StopTimer()
|
||||
{
|
||||
_mainTimer.Stop();
|
||||
_mainTimer?.Stop();
|
||||
}
|
||||
|
||||
private void HandleMainTimerElapsed(object sender, EventArgs e)
|
||||
|
||||
@@ -166,6 +166,12 @@ public partial class MainWindow
|
||||
|
||||
// Delete the feed
|
||||
_database.SaveChanges(() => _database.Feeds.Remove(feedToDelete));
|
||||
|
||||
// Refresh the database to current settings
|
||||
ResetDatabase();
|
||||
|
||||
// Re-initialize the feed display
|
||||
DisplayFeed();
|
||||
}
|
||||
|
||||
private void OpenAllFeedItemsOnSinglePage()
|
||||
|
||||
@@ -34,6 +34,6 @@ public partial class MainWindow
|
||||
|
||||
private void HandleNewVersionLinkClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
UpdateCheck.DisplayUpdateInformation(true);
|
||||
UpdateCheck.DisplayUpdateInformation(true, Settings.Default.IncludePrerelease);
|
||||
}
|
||||
}
|
||||
@@ -49,14 +49,14 @@ public partial class MainWindow
|
||||
{
|
||||
// Set the last window location
|
||||
Settings.Default.WindowLocation = new Point(Left, Top);
|
||||
Settings.Default.Save();
|
||||
|
||||
// Set the last window size
|
||||
Settings.Default.WindowSize = new Size(Width, Height);
|
||||
Settings.Default.Save();
|
||||
|
||||
// Save the dock on the navigation tray
|
||||
Settings.Default.ToolbarLocation = NameBasedGrid.NameBasedGrid.GetRow(NavigationToolbarTray) == "TopToolbarRow" ? Dock.Top : Dock.Bottom;
|
||||
|
||||
// Save settings
|
||||
Settings.Default.Save();
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
Name="CheckVersionOnStartupCheckBox"
|
||||
IsChecked="{Binding Source={x:Static properties:Settings.Default}, Path=CheckVersionAtStartup}"
|
||||
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}"
|
||||
HorizontalAlignment="Left"
|
||||
Click="HandleCheckVersionNowButtonClick" />
|
||||
|
||||
@@ -15,7 +15,7 @@ public partial class UpdateOptionsPanel
|
||||
|
||||
private void HandleCheckVersionNowButtonClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
UpdateCheck.DisplayUpdateInformation(true);
|
||||
UpdateCheck.DisplayUpdateInformation(true, Settings.Default.IncludePrerelease);
|
||||
}
|
||||
|
||||
private void OnSaveSettings(object sender, RoutedEventArgs e)
|
||||
|
||||
27
Application/Properties/Resources.Designer.cs
generated
27
Application/Properties/Resources.Designer.cs
generated
@@ -840,6 +840,15 @@ namespace FeedCenter.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Temporarily unavailable.
|
||||
/// </summary>
|
||||
public static string FeedReadResult_TemporarilyUnavailable {
|
||||
get {
|
||||
return ResourceManager.GetString("FeedReadResult_TemporarilyUnavailable", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Timeout.
|
||||
/// </summary>
|
||||
@@ -849,6 +858,15 @@ namespace FeedCenter.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Too many requests.
|
||||
/// </summary>
|
||||
public static string FeedReadResult_TooManyRequests {
|
||||
get {
|
||||
return ResourceManager.GetString("FeedReadResult_TooManyRequests", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Not authorized.
|
||||
/// </summary>
|
||||
@@ -939,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>
|
||||
/// Looks up a localized string similar to Last Updated.
|
||||
/// </summary>
|
||||
|
||||
@@ -555,4 +555,13 @@ All feeds currently in category "{0}" will be moved to the default category.</va
|
||||
<data name="userAgentLabel" xml:space="preserve">
|
||||
<value>User agent</value>
|
||||
</data>
|
||||
<data name="FeedReadResult_TemporarilyUnavailable" xml:space="preserve">
|
||||
<value>Temporarily unavailable</value>
|
||||
</data>
|
||||
<data name="FeedReadResult_TooManyRequests" xml:space="preserve">
|
||||
<value>Too many requests</value>
|
||||
</data>
|
||||
<data name="includePrereleaseCheckBox" xml:space="preserve">
|
||||
<value>Include _prerelease</value>
|
||||
</data>
|
||||
</root>
|
||||
14
Application/Properties/Settings.Designer.cs
generated
14
Application/Properties/Settings.Designer.cs
generated
@@ -12,7 +12,7 @@ namespace FeedCenter.Properties {
|
||||
|
||||
|
||||
[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 {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
@@ -302,5 +302,17 @@ namespace FeedCenter.Properties {
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,5 +74,8 @@
|
||||
<Setting Name="DatabaseFile" Type="System.String" Scope="Application">
|
||||
<Value Profile="(Default)">FeedCenter.realm</Value>
|
||||
</Setting>
|
||||
<Setting Name="IncludePrerelease" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
||||
@@ -36,6 +36,9 @@ public static class SettingsStore
|
||||
// Try to get the setting from the database that matches the name and version
|
||||
var setting = entities.Settings.FirstOrDefault(s => s.Name == name);
|
||||
|
||||
if (setting?.Value == value)
|
||||
return;
|
||||
|
||||
entities.SaveChanges(() =>
|
||||
{
|
||||
// If there was no setting we need to create it
|
||||
|
||||
@@ -49,6 +49,9 @@
|
||||
<setting name="DefaultUserAgent" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="IncludePrerelease" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
</FeedCenter.Properties.Settings>
|
||||
</userSettings>
|
||||
<applicationSettings>
|
||||
|
||||
Reference in New Issue
Block a user