From f7dddff14df5f13dfe96f75bad3f9f74a03644b2 Mon Sep 17 00:00:00 2001 From: Chris Kaczor Date: Thu, 22 Jan 2015 16:50:28 -0500 Subject: [PATCH] Fix adding new feeds and version check at start-up --- Application/Entities.cs | 2 +- Application/MainWindow.xaml.cs | 6 +++++- Application/SplashWindow.xaml.cs | 13 ------------- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/Application/Entities.cs b/Application/Entities.cs index 897f448..d28e236 100644 --- a/Application/Entities.cs +++ b/Application/Entities.cs @@ -51,7 +51,7 @@ namespace FeedCenter public Category DefaultCategory { - get { return _allCategories.First(c => c.IsDefault); } + get { return AllCategories.First(c => c.IsDefault); } } #endregion diff --git a/Application/MainWindow.xaml.cs b/Application/MainWindow.xaml.cs index 37d6484..49b1259 100644 --- a/Application/MainWindow.xaml.cs +++ b/Application/MainWindow.xaml.cs @@ -107,6 +107,10 @@ namespace FeedCenter InitializeFeed(); // Check for update + if (Settings.Default.CheckVersionAtStartup) + UpdateCheck.CheckForUpdate(); + + // Show the link if updates are available if (UpdateCheck.UpdateAvailable) newVersionLink.Visibility = Visibility.Visible; @@ -782,7 +786,7 @@ namespace FeedCenter // Create and configure the new feed var feed = Feed.Create(_database); feed.Source = feedUrl; - feed.Category = _database.Categories.First(category => category.IsDefault); + feed.Category = _database.DefaultCategory; // Read the feed for the first time var feedReadResult = feed.Read(_database); diff --git a/Application/SplashWindow.xaml.cs b/Application/SplashWindow.xaml.cs index cf604b0..4624d5f 100644 --- a/Application/SplashWindow.xaml.cs +++ b/Application/SplashWindow.xaml.cs @@ -172,7 +172,6 @@ namespace FeedCenter private static class ProgressKey { - public const string Update = "Update"; public const string DatabaseCreate = "CreateDatabase"; public const string DatabaseUpdate = "UpdateDatabase"; public const string DatabaseMaintenance = "MaintainDatabase"; @@ -187,18 +186,6 @@ namespace FeedCenter _progressSteps.Add(new ProgressStep(ProgressKey.DatabaseUpdate, Properties.Resources.SplashUpdatingDatabase, UpdateDatabase)); _progressSteps.Add(new ProgressStep(ProgressKey.DatabaseMaintenance, Properties.Resources.SplashMaintainingDatabase, MaintainDatabase)); - - _progressSteps.Add(new ProgressStep(ProgressKey.Update, Properties.Resources.SplashCheckingForUpdate, CheckUpdate)); - } - - private static bool CheckUpdate() - { - // If the user does not want to check version at startup then we're done - if (!Settings.Default.CheckVersionAtStartup) - return false; - - // Return if the check worked and an update is available - return UpdateCheck.CheckForUpdate() && UpdateCheck.UpdateAvailable; } private static bool CheckDatabase()