mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
Removed changelog section from downloader form
This commit is contained in:
parent
98207bba76
commit
565da7acd3
5 changed files with 16 additions and 202 deletions
27
ShareX.HelpersLib/Properties/Resources.Designer.cs
generated
27
ShareX.HelpersLib/Properties/Resources.Designer.cs
generated
|
@ -501,15 +501,6 @@ internal static string DownloaderForm_ChangeProgress_Progress {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Progress: {0}.
|
||||
/// </summary>
|
||||
internal static string DownloaderForm_ChangeProgress_Progress___0_ {
|
||||
get {
|
||||
return ResourceManager.GetString("DownloaderForm_ChangeProgress_Progress___0_", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Status: {0}.
|
||||
/// </summary>
|
||||
|
@ -519,15 +510,6 @@ internal static string DownloaderForm_ChangeStatus_Status___0_ {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Download canceled..
|
||||
/// </summary>
|
||||
internal static string DownloaderForm_Download_Canceled {
|
||||
get {
|
||||
return ResourceManager.GetString("DownloaderForm_Download_Canceled", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Filename: {0}.
|
||||
/// </summary>
|
||||
|
@ -564,15 +546,6 @@ internal static string DownloaderForm_fileDownloader_DownloadCompleted_Install {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Possible proxy detected. Please open the Application Settings from the main menu and choose Proxy to enter your proxy server settings..
|
||||
/// </summary>
|
||||
internal static string DownloaderForm_ProxyDetected {
|
||||
get {
|
||||
return ResourceManager.GetString("DownloaderForm_ProxyDetected", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Cancel.
|
||||
/// </summary>
|
||||
|
|
|
@ -983,15 +983,6 @@ Would you like to download it?</value>
|
|||
<data name="ShapeType_DrawingTextBackground" xml:space="preserve">
|
||||
<value>Drawing: Text (Background)</value>
|
||||
</data>
|
||||
<data name="DownloaderForm_ProxyDetected" xml:space="preserve">
|
||||
<value>Possible proxy detected. Please open the Application Settings from the main menu and choose Proxy to enter your proxy server settings.</value>
|
||||
</data>
|
||||
<data name="DownloaderForm_Download_Canceled" xml:space="preserve">
|
||||
<value>Download canceled.</value>
|
||||
</data>
|
||||
<data name="DownloaderForm_ChangeProgress_Progress___0_" xml:space="preserve">
|
||||
<value>Progress: {0}</value>
|
||||
</data>
|
||||
<data name="ShapeType_ToolCrop" xml:space="preserve">
|
||||
<value>Crop image</value>
|
||||
</data>
|
||||
|
|
|
@ -29,24 +29,13 @@ protected override void Dispose(bool disposing)
|
|||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DownloaderForm));
|
||||
this.txtChangelog = new System.Windows.Forms.TextBox();
|
||||
this.lblProgress = new ShareX.HelpersLib.BlackStyleLabel();
|
||||
this.cbShowChangelog = new ShareX.HelpersLib.BlackStyleCheckBox();
|
||||
this.lblStatus = new ShareX.HelpersLib.BlackStyleLabel();
|
||||
this.lblFilename = new ShareX.HelpersLib.BlackStyleLabel();
|
||||
this.btnAction = new ShareX.HelpersLib.BlackStyleButton();
|
||||
this.pbProgress = new ShareX.HelpersLib.BlackStyleProgressBar();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// txtChangelog
|
||||
//
|
||||
this.txtChangelog.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(70)))), ((int)(((byte)(70)))), ((int)(((byte)(70)))));
|
||||
this.txtChangelog.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.txtChangelog.ForeColor = System.Drawing.Color.White;
|
||||
resources.ApplyResources(this.txtChangelog, "txtChangelog");
|
||||
this.txtChangelog.Name = "txtChangelog";
|
||||
this.txtChangelog.ReadOnly = true;
|
||||
//
|
||||
// lblProgress
|
||||
//
|
||||
this.lblProgress.BackColor = System.Drawing.Color.Transparent;
|
||||
|
@ -54,16 +43,6 @@ private void InitializeComponent()
|
|||
this.lblProgress.ForeColor = System.Drawing.Color.White;
|
||||
this.lblProgress.Name = "lblProgress";
|
||||
//
|
||||
// cbShowChangelog
|
||||
//
|
||||
this.cbShowChangelog.BackColor = System.Drawing.Color.Transparent;
|
||||
this.cbShowChangelog.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
resources.ApplyResources(this.cbShowChangelog, "cbShowChangelog");
|
||||
this.cbShowChangelog.ForeColor = System.Drawing.Color.White;
|
||||
this.cbShowChangelog.Name = "cbShowChangelog";
|
||||
this.cbShowChangelog.SpaceAfterCheckBox = 3;
|
||||
this.cbShowChangelog.CheckedChanged += new System.EventHandler(this.cbShowChangelog_CheckedChanged);
|
||||
//
|
||||
// lblStatus
|
||||
//
|
||||
this.lblStatus.BackColor = System.Drawing.Color.Transparent;
|
||||
|
@ -101,8 +80,6 @@ private void InitializeComponent()
|
|||
resources.ApplyResources(this, "$this");
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(70)))), ((int)(((byte)(70)))), ((int)(((byte)(70)))));
|
||||
this.Controls.Add(this.cbShowChangelog);
|
||||
this.Controls.Add(this.txtChangelog);
|
||||
this.Controls.Add(this.lblProgress);
|
||||
this.Controls.Add(this.lblStatus);
|
||||
this.Controls.Add(this.lblFilename);
|
||||
|
@ -115,7 +92,6 @@ private void InitializeComponent()
|
|||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.UpdaterForm_FormClosing);
|
||||
this.Shown += new System.EventHandler(this.DownloaderForm_Shown);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
|
@ -125,7 +101,5 @@ private void InitializeComponent()
|
|||
private BlackStyleLabel lblFilename;
|
||||
private BlackStyleLabel lblStatus;
|
||||
private BlackStyleLabel lblProgress;
|
||||
private System.Windows.Forms.TextBox txtChangelog;
|
||||
private BlackStyleCheckBox cbShowChangelog;
|
||||
}
|
||||
}
|
|
@ -26,7 +26,6 @@ You should have received a copy of the GNU General Public License
|
|||
using ShareX.HelpersLib.Properties;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
|
@ -44,7 +43,6 @@ public partial class DownloaderForm : BlackStyleForm
|
|||
public string Filename { get; set; }
|
||||
public string DownloadLocation { get; private set; }
|
||||
public IWebProxy Proxy { get; set; }
|
||||
public string Changelog { get; set; }
|
||||
public string AcceptHeader { get; set; }
|
||||
public bool AutoStartDownload { get; set; }
|
||||
public InstallType InstallType { get; set; }
|
||||
|
@ -53,25 +51,26 @@ public partial class DownloaderForm : BlackStyleForm
|
|||
public bool RunInstallerInBackground { get; set; }
|
||||
|
||||
private FileDownloader fileDownloader;
|
||||
private Rectangle fillRect;
|
||||
|
||||
private DownloaderForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
fillRect = new Rectangle(0, 0, ClientSize.Width, ClientSize.Height);
|
||||
|
||||
UpdateFormSize();
|
||||
ChangeStatus(Resources.DownloaderForm_DownloaderForm_Waiting_);
|
||||
|
||||
Status = DownloaderFormStatus.Waiting;
|
||||
|
||||
AutoStartDownload = true;
|
||||
InstallType = InstallType.Silent;
|
||||
AutoStartInstall = true;
|
||||
RunInstallerInBackground = true;
|
||||
}
|
||||
|
||||
public DownloaderForm(string url, string filename) : this()
|
||||
{
|
||||
URL = url;
|
||||
Filename = filename;
|
||||
lblFilename.Text = Helpers.SafeStringFormat(Resources.DownloaderForm_DownloaderForm_Filename___0_, Filename);
|
||||
}
|
||||
|
||||
public DownloaderForm(UpdateChecker updateChecker) : this(updateChecker.DownloadURL, updateChecker.Filename)
|
||||
{
|
||||
Proxy = updateChecker.Proxy;
|
||||
|
@ -82,13 +81,6 @@ public DownloaderForm(UpdateChecker updateChecker) : this(updateChecker.Download
|
|||
}
|
||||
}
|
||||
|
||||
public DownloaderForm(string url, string filename) : this()
|
||||
{
|
||||
URL = url;
|
||||
Filename = filename;
|
||||
lblFilename.Text = Helpers.SafeStringFormat(Resources.DownloaderForm_DownloaderForm_Filename___0_, Filename);
|
||||
}
|
||||
|
||||
private void DownloaderForm_Shown(object sender, EventArgs e)
|
||||
{
|
||||
if (AutoStartDownload)
|
||||
|
@ -195,42 +187,6 @@ private void ChangeStatus(string status)
|
|||
lblStatus.Text = Helpers.SafeStringFormat(Resources.DownloaderForm_ChangeStatus_Status___0_, status);
|
||||
}
|
||||
|
||||
private void HandleDownloadException(Exception ex)
|
||||
{
|
||||
if (ex is WebException)
|
||||
{
|
||||
WebException webEx = (WebException)ex;
|
||||
|
||||
if (webEx.Status == WebExceptionStatus.ProtocolError)
|
||||
{
|
||||
HttpWebResponse response = webEx.Response as HttpWebResponse;
|
||||
|
||||
if (response != null)
|
||||
{
|
||||
int responseCode = (int)response.StatusCode;
|
||||
|
||||
if (responseCode == 401)
|
||||
{
|
||||
ChangeFormForPossibleProxyDetected();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ChangeStatus(ex.Message);
|
||||
}
|
||||
|
||||
private void ChangeFormForPossibleProxyDetected()
|
||||
{
|
||||
txtChangelog.WordWrap = true;
|
||||
txtChangelog.Text = Resources.DownloaderForm_ProxyDetected;
|
||||
cbShowChangelog.Checked = true;
|
||||
ChangeStatus(Resources.Error);
|
||||
ChangeProgressForCanceledDownload();
|
||||
UpdateFormSize();
|
||||
}
|
||||
|
||||
private void ChangeProgress()
|
||||
{
|
||||
if (fileDownloader != null)
|
||||
|
@ -241,12 +197,6 @@ private void ChangeProgress()
|
|||
}
|
||||
}
|
||||
|
||||
private void ChangeProgressForCanceledDownload()
|
||||
{
|
||||
lblProgress.Text = Helpers.SafeStringFormat(CultureInfo.CurrentCulture, Resources.DownloaderForm_ChangeProgress_Progress___0_,
|
||||
Resources.DownloaderForm_Download_Canceled);
|
||||
}
|
||||
|
||||
private void StartDownload()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(URL) && Status == DownloaderFormStatus.Waiting)
|
||||
|
@ -263,25 +213,13 @@ private void StartDownload()
|
|||
fileDownloader.DownloadStarted += (v1, v2) => ChangeStatus(Resources.DownloaderForm_StartDownload_Downloading_);
|
||||
fileDownloader.ProgressChanged += (v1, v2) => ChangeProgress();
|
||||
fileDownloader.DownloadCompleted += fileDownloader_DownloadCompleted;
|
||||
fileDownloader.ExceptionThrowed += (v1, v2) => HandleDownloadException(fileDownloader.LastException);
|
||||
fileDownloader.ExceptionThrowed += (v1, v2) => ChangeStatus(fileDownloader.LastException.Message);
|
||||
fileDownloader.StartDownload();
|
||||
|
||||
ChangeStatus(Resources.DownloaderForm_StartDownload_Getting_file_size_);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateFormSize()
|
||||
{
|
||||
if (cbShowChangelog.Checked)
|
||||
{
|
||||
ClientSize = new Size(fillRect.Width, fillRect.Height);
|
||||
}
|
||||
else
|
||||
{
|
||||
ClientSize = new Size(fillRect.Width, txtChangelog.Location.Y - 3);
|
||||
}
|
||||
}
|
||||
|
||||
private void fileDownloader_DownloadCompleted(object sender, EventArgs e)
|
||||
{
|
||||
ChangeStatus(Resources.DownloaderForm_fileDownloader_DownloadCompleted_Download_completed_);
|
||||
|
@ -294,11 +232,6 @@ private void fileDownloader_DownloadCompleted(object sender, EventArgs e)
|
|||
}
|
||||
}
|
||||
|
||||
private void cbShowChangelog_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
UpdateFormSize();
|
||||
}
|
||||
|
||||
private void UpdaterForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
if (Status == DownloaderFormStatus.DownloadStarted && fileDownloader != null)
|
||||
|
|
|
@ -118,35 +118,6 @@
|
|||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="txtChangelog.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>8, 208</value>
|
||||
</data>
|
||||
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="txtChangelog.Multiline" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="txtChangelog.ScrollBars" type="System.Windows.Forms.ScrollBars, System.Windows.Forms">
|
||||
<value>Both</value>
|
||||
</data>
|
||||
<data name="txtChangelog.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>472, 201</value>
|
||||
</data>
|
||||
<data name="txtChangelog.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>14</value>
|
||||
</data>
|
||||
<data name=">>txtChangelog.Name" xml:space="preserve">
|
||||
<value>txtChangelog</value>
|
||||
</data>
|
||||
<data name=">>txtChangelog.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>txtChangelog.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>txtChangelog.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="lblProgress.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<value>Arial, 12pt</value>
|
||||
</data>
|
||||
|
@ -154,8 +125,9 @@
|
|||
<value>8, 72</value>
|
||||
</data>
|
||||
<data name="lblProgress.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>336, 78</value>
|
||||
<value>472, 78</value>
|
||||
</data>
|
||||
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="lblProgress.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>12</value>
|
||||
</data>
|
||||
|
@ -172,36 +144,6 @@
|
|||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>lblProgress.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name="cbShowChangelog.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<value>Arial, 8pt</value>
|
||||
</data>
|
||||
<data name="cbShowChangelog.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>352, 142</value>
|
||||
</data>
|
||||
<data name="cbShowChangelog.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>128, 16</value>
|
||||
</data>
|
||||
<data name="cbShowChangelog.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>15</value>
|
||||
</data>
|
||||
<data name="cbShowChangelog.Text" xml:space="preserve">
|
||||
<value>Show update notes</value>
|
||||
</data>
|
||||
<data name="cbShowChangelog.Visible" type="System.Boolean, mscorlib">
|
||||
<value>False</value>
|
||||
</data>
|
||||
<data name=">>cbShowChangelog.Name" xml:space="preserve">
|
||||
<value>cbShowChangelog</value>
|
||||
</data>
|
||||
<data name=">>cbShowChangelog.Type" xml:space="preserve">
|
||||
<value>ShareX.HelpersLib.BlackStyleCheckBox, ShareX.HelpersLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>cbShowChangelog.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>cbShowChangelog.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="lblStatus.Font" type="System.Drawing.Font, System.Drawing">
|
||||
|
@ -229,7 +171,7 @@
|
|||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>lblStatus.ZOrder" xml:space="preserve">
|
||||
<value>3</value>
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="lblFilename.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<value>Arial, 12pt</value>
|
||||
|
@ -256,7 +198,7 @@
|
|||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>lblFilename.ZOrder" xml:space="preserve">
|
||||
<value>4</value>
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name="btnAction.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<value>Arial, 12pt</value>
|
||||
|
@ -283,7 +225,7 @@
|
|||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>btnAction.ZOrder" xml:space="preserve">
|
||||
<value>5</value>
|
||||
<value>3</value>
|
||||
</data>
|
||||
<data name="pbProgress.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>8, 163</value>
|
||||
|
@ -304,7 +246,7 @@
|
|||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>pbProgress.ZOrder" xml:space="preserve">
|
||||
<value>6</value>
|
||||
<value>4</value>
|
||||
</data>
|
||||
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
|
@ -313,8 +255,9 @@
|
|||
<value>6, 13</value>
|
||||
</data>
|
||||
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
|
||||
<value>488, 417</value>
|
||||
<value>488, 205</value>
|
||||
</data>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
|
||||
<value>CenterScreen</value>
|
||||
</data>
|
||||
|
|
Loading…
Reference in a new issue