mirror of
https://github.com/ckaczor/FeedCenter.git
synced 2026-02-16 10:58:31 -05:00
Fix adding new feeds and version check at start-up
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user