Fix adding new feeds and version check at start-up

This commit is contained in:
2015-01-22 16:50:28 -05:00
parent 75ba11fefd
commit f7dddff14d
3 changed files with 6 additions and 15 deletions

View File

@@ -51,7 +51,7 @@ namespace FeedCenter
public Category DefaultCategory public Category DefaultCategory
{ {
get { return _allCategories.First(c => c.IsDefault); } get { return AllCategories.First(c => c.IsDefault); }
} }
#endregion #endregion

View File

@@ -107,6 +107,10 @@ namespace FeedCenter
InitializeFeed(); InitializeFeed();
// Check for update // Check for update
if (Settings.Default.CheckVersionAtStartup)
UpdateCheck.CheckForUpdate();
// Show the link if updates are available
if (UpdateCheck.UpdateAvailable) if (UpdateCheck.UpdateAvailable)
newVersionLink.Visibility = Visibility.Visible; newVersionLink.Visibility = Visibility.Visible;
@@ -782,7 +786,7 @@ namespace FeedCenter
// Create and configure the new feed // Create and configure the new feed
var feed = Feed.Create(_database); var feed = Feed.Create(_database);
feed.Source = feedUrl; feed.Source = feedUrl;
feed.Category = _database.Categories.First(category => category.IsDefault); feed.Category = _database.DefaultCategory;
// Read the feed for the first time // Read the feed for the first time
var feedReadResult = feed.Read(_database); var feedReadResult = feed.Read(_database);

View File

@@ -172,7 +172,6 @@ namespace FeedCenter
private static class ProgressKey private static class ProgressKey
{ {
public const string Update = "Update";
public const string DatabaseCreate = "CreateDatabase"; public const string DatabaseCreate = "CreateDatabase";
public const string DatabaseUpdate = "UpdateDatabase"; public const string DatabaseUpdate = "UpdateDatabase";
public const string DatabaseMaintenance = "MaintainDatabase"; 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.DatabaseUpdate, Properties.Resources.SplashUpdatingDatabase, UpdateDatabase));
_progressSteps.Add(new ProgressStep(ProgressKey.DatabaseMaintenance, Properties.Resources.SplashMaintainingDatabase, MaintainDatabase)); _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() private static bool CheckDatabase()