/* frmUpdater.cs $ This file is part of the HandBrake source code. Homepage: . It may be used under the terms of the GNU General Public License. */ namespace Handbrake { using System; using System.Windows.Forms; using Functions; /// /// A window to display update information. /// public partial class frmUpdater : Form { /// /// An instance of the Appcast Reader /// private readonly AppcastReader appcast; /// /// Initializes a new instance of the class. /// /// /// The appcast reader. /// public frmUpdater(AppcastReader reader) { InitializeComponent(); appcast = reader; GetRss(); SetVersions(); } /// /// Get the RSS feed /// private void GetRss() { wBrowser.Url = appcast.DescriptionUrl; } /// /// Set the versions /// private void SetVersions() { string old = "(You have: " + Properties.Settings.Default.hb_version.Trim() + " / " + Properties.Settings.Default.hb_build.ToString().Trim() + ")"; string newBuild = appcast.Version.Trim() + " (" + appcast.Build + ")"; lbl_update_text.Text = "HandBrake " + newBuild + " is now available. " + old; } /// /// Handle the Install Update button click event. /// /// /// The sender. /// /// /// The EventArgs. /// private void BtnInstallUpdateClick(object sender, EventArgs e) { frmDownload download = new frmDownload(appcast.DownloadFile); download.ShowDialog(); this.Close(); } /// /// Handle the Remind Later button click event /// /// /// The sender. /// /// /// The EventArgs. /// private void BtnRemindLaterClick(object sender, EventArgs e) { this.Close(); } /// /// Handle the Skip update button click event /// /// /// The sender. /// /// /// The e. /// private void BtnSkipClick(object sender, EventArgs e) { Properties.Settings.Default.skipversion = int.Parse(appcast.Build); Properties.Settings.Default.Save(); this.Close(); } } }