diff options
author | sr55 <[email protected]> | 2012-03-19 20:18:46 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2012-03-19 20:18:46 +0000 |
commit | 582d0170487c8dcd113cae0e0b38345226f3147e (patch) | |
tree | 5b1f9ea1fae5652418b22bb2e103e886fdf26fba /win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | |
parent | 4ff24a85e32d10ee8ab5ed524ec03e3f22da92e1 (diff) |
WinGui: (WPF) Started implementing the startup procedure: Update checking, Preset updates, CLI monitoring.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4517 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index d42e535c7..c37d36eb8 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -629,6 +629,18 @@ namespace HandBrakeWPF.ViewModels /// </summary>
public override void OnLoad()
{
+ // Check the CLI Executable.
+ CliCheckHelper.CheckCLIVersion();
+
+ // Perform an update check if required
+ UpdateCheckHelper.PerformStartupUpdateCheck();
+
+ // Setup the presets.
+ if (this.presetService.CheckIfPresetsAreOutOfDate())
+ if (!this.userSettingService.GetUserSetting<bool>(UserSettingConstants.PresetNotification))
+ this.errorService.ShowMessageBox("HandBrake has determined your built-in presets are out of date... These presets will now be updated.",
+ "Preset Update", MessageBoxButton.OK, MessageBoxImage.Information);
+
this.SelectedPreset = this.presetService.DefaultPreset;
}
@@ -706,14 +718,7 @@ namespace HandBrakeWPF.ViewModels /// </summary>
public void CheckForUpdates()
{
- // TODO The update service needs refactoring.
- this.userSettingService.SetUserSetting(UserSettingConstants.LastUpdateCheckDate, DateTime.Now);
- string url = userSettingService.GetUserSetting<string>(ASUserSettingConstants.HandBrakePlatform).Contains("x86_64")
- ? userSettingService.GetUserSetting<string>(UserSettingConstants.Appcast_x64)
- : userSettingService.GetUserSetting<string>(UserSettingConstants.Appcast_i686);
- UpdateService.BeginCheckForUpdates(UpdateCheckHelper.UpdateCheckDoneMenu, false,
- url, userSettingService.GetUserSetting<int>(ASUserSettingConstants.HandBrakeBuild),
- userSettingService.GetUserSetting<int>(UserSettingConstants.Skipversion));
+ UpdateCheckHelper.CheckForUpdates();
}
/// <summary>
|