X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=win%2FC%23%2FfrmUpdater.cs;h=7d56c587efc0e1e673f9d6fbb96db97f41f4d8ac;hb=32219d93ec8fcf0db6f7ca5d6045419882563951;hp=bf36299fad7c97da199393fccfb5c0db68fdf655;hpb=aeed8ecc01fc3b7260c8041c533823dc71103a75;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/win/C#/frmUpdater.cs b/win/C#/frmUpdater.cs index bf36299f..7d56c587 100644 --- a/win/C#/frmUpdater.cs +++ b/win/C#/frmUpdater.cs @@ -1,63 +1,103 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Text; -using System.Windows.Forms; -using System.IO; -using System.Xml; -using System.Net; +/* 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 { - Functions.RssReader rssRead = new Functions.RssReader(); - public frmUpdater() + /// + /// 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(); - - getRss(); - setVersions(); + + appcast = reader; + GetRss(); + SetVersions(); } - private void getRss() + /// + /// Get the RSS feed + /// + private void GetRss() { - - wBrowser.DocumentText = "" + rssRead.versionInfo() + ""; + wBrowser.Url = appcast.DescriptionUrl; } - private void setVersions() + /// + /// Set the versions + /// + private void SetVersions() { - lbl_oldVersion.Text = "(you have: " + Properties.Settings.Default.CliVersion + " / " + Properties.Settings.Default.build + ")."; - lbl_newVersion.Text = rssRead.version() + " (" + rssRead.build() + ")"; + 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; } - private void btn_installUpdate_Click(object sender, EventArgs e) + /// + /// Handle the Install Update button click event. + /// + /// + /// The sender. + /// + /// + /// The EventArgs. + /// + private void BtnInstallUpdateClick(object sender, EventArgs e) { - frmDownload download = new frmDownload(); - download.Show(); - this.Close(); + frmDownload download = new frmDownload(appcast.DownloadFile); + download.ShowDialog(); + this.Close(); } - private void btn_remindLater_Click(object sender, EventArgs e) + /// + /// Handle the Remind Later button click event + /// + /// + /// The sender. + /// + /// + /// The EventArgs. + /// + private void BtnRemindLaterClick(object sender, EventArgs e) { this.Close(); } - private void btn_skip_Click(object sender, EventArgs e) + /// + /// Handle the Skip update button click event + /// + /// + /// The sender. + /// + /// + /// The e. + /// + private void BtnSkipClick(object sender, EventArgs e) { - try - { - Properties.Settings.Default.skipversion = int.Parse(rssRead.build()); - } - catch (Exception exc) - { - MessageBox.Show(exc.ToString()); - } + Properties.Settings.Default.skipversion = int.Parse(appcast.Build); + Properties.Settings.Default.Save(); + this.Close(); } - } } \ No newline at end of file