X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=win%2FC%23%2FfrmUpdater.cs;h=816e00facb04dfa01f7ea5effc97f882dfbacd47;hb=a524194964cbed535f17b1b729fec7847539c94e;hp=271e17bc06a96e84e89513e8d500cf658a2327ca;hpb=8d18c8508c0b708c9d05d814f16b32b5bf92654f;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/win/C#/frmUpdater.cs b/win/C#/frmUpdater.cs index 271e17bc..816e00fa 100644 --- a/win/C#/frmUpdater.cs +++ b/win/C#/frmUpdater.cs @@ -6,40 +6,38 @@ using System; using System.Windows.Forms; -using System.IO; -using System.Xml; -using System.Net; +using Handbrake.Functions; namespace Handbrake { public partial class frmUpdater : Form { - Functions.AppcastReader appcast = new Functions.AppcastReader(); - public frmUpdater() + readonly AppcastReader _appcast; + public frmUpdater(AppcastReader reader) { InitializeComponent(); - appcast.getInfo(); // Initializes the appcast - getRss(); - setVersions(); + _appcast = reader; + GetRss(); + SetVersions(); } - private void getRss() + private void GetRss() { - wBrowser.DocumentText = "" + appcast.versionInfo() + ""; + wBrowser.Url = _appcast.descriptionUrl; } - private void setVersions() + 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() + ")"; + 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) { - frmDownload download = new frmDownload(appcast.downloadFile()); - download.Show(); + frmDownload download = new frmDownload(_appcast.downloadFile); + download.ShowDialog(); this.Close(); } @@ -50,7 +48,7 @@ namespace Handbrake private void btn_skip_Click(object sender, EventArgs e) { - Properties.Settings.Default.skipversion = int.Parse(appcast.build()); + Properties.Settings.Default.skipversion = int.Parse(_appcast.build); Properties.Settings.Default.Save(); this.Close();