X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=win%2FC%23%2FfrmUpdater.cs;h=7d56c587efc0e1e673f9d6fbb96db97f41f4d8ac;hb=4f0019f03c2e85e8634150ff0c9a31bee6d35ce5;hp=9180f6dc369a2d81782d6adc08bfc6e427b06b79;hpb=65c22f1b679be4c6a631ea68b501ca465d7ac5c8;p=handbrake-jp%2Fhandbrake-jp-git.git
diff --git a/win/C#/frmUpdater.cs b/win/C#/frmUpdater.cs
index 9180f6dc..7d56c587 100644
--- a/win/C#/frmUpdater.cs
+++ b/win/C#/frmUpdater.cs
@@ -1,64 +1,103 @@
/* 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. */
-
-using System;
-using System.Windows.Forms;
-using System.IO;
-using System.Xml;
-using System.Net;
+ 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();
- }
- private void getRss()
- {
- wBrowser.DocumentText = "" + rssRead.versionInfo() + "";
+ appcast = reader;
+ GetRss();
+ SetVersions();
}
- private void setVersions()
+ ///
+ /// Get the RSS feed
+ ///
+ private void GetRss()
{
- lbl_oldVersion.Text = "(you have: " + Properties.Settings.Default.hb_version + " / " + Properties.Settings.Default.hb_build + ").";
- lbl_newVersion.Text = rssRead.version() + " (" + rssRead.build() + ")";
+ wBrowser.Url = appcast.DescriptionUrl;
}
- private void btn_installUpdate_Click(object sender, EventArgs e)
+ ///
+ /// Set the versions
+ ///
+ private void SetVersions()
{
- frmDownload download = new frmDownload();
- download.Show();
- this.Close();
+ 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_remindLater_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(appcast.DownloadFile);
+ download.ShowDialog();
this.Close();
}
- private void btn_skip_Click(object sender, EventArgs e)
+ ///
+ /// Handle the Remind Later button click event
+ ///
+ ///
+ /// The sender.
+ ///
+ ///
+ /// The EventArgs.
+ ///
+ private void BtnRemindLaterClick(object sender, EventArgs e)
{
- try
- {
- Properties.Settings.Default.skipversion = int.Parse(rssRead.build());
- Properties.Settings.Default.Save();
- }
- catch (Exception exc)
- {
- MessageBox.Show(exc.ToString());
- }
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();
+ }
}
}
\ No newline at end of file