diff --git a/ShareX.HelpersLib/UpdateChecker/GitHubUpdateManager.cs b/ShareX.HelpersLib/UpdateChecker/GitHubUpdateManager.cs index de0394b1e..a1326301c 100644 --- a/ShareX.HelpersLib/UpdateChecker/GitHubUpdateManager.cs +++ b/ShareX.HelpersLib/UpdateChecker/GitHubUpdateManager.cs @@ -81,7 +81,7 @@ private void CheckUpdate() UpdateChecker updateChecker = CreateUpdateChecker(); updateChecker.CheckUpdate(); - if (UpdateMessageBox.Start(updateChecker, firstUpdateCheck, Links.Changelog) == DialogResult.No) + if (UpdateMessageBox.Start(updateChecker, firstUpdateCheck) == DialogResult.No) { AutoUpdateEnabled = false; } diff --git a/ShareX.HelpersLib/UpdateChecker/UpdateCheckerLabel.cs b/ShareX.HelpersLib/UpdateChecker/UpdateCheckerLabel.cs index 0b61052f2..e781004e3 100644 --- a/ShareX.HelpersLib/UpdateChecker/UpdateCheckerLabel.cs +++ b/ShareX.HelpersLib/UpdateChecker/UpdateCheckerLabel.cs @@ -112,7 +112,7 @@ private void UpdateControls() private void llblUpdateAvailable_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { - UpdateMessageBox.Start(updateChecker, true, Links.Changelog); + UpdateMessageBox.Start(updateChecker); } } } \ No newline at end of file diff --git a/ShareX.HelpersLib/UpdateChecker/UpdateMessageBox.cs b/ShareX.HelpersLib/UpdateChecker/UpdateMessageBox.cs index 945af46c6..efb0e0d8a 100644 --- a/ShareX.HelpersLib/UpdateChecker/UpdateMessageBox.cs +++ b/ShareX.HelpersLib/UpdateChecker/UpdateMessageBox.cs @@ -35,14 +35,12 @@ public partial class UpdateMessageBox : Form public static bool IsOpen { get; private set; } public bool ActivateWindow { get; private set; } - public string ChangelogURL { get; private set; } protected override bool ShowWithoutActivation => !ActivateWindow; - public UpdateMessageBox(UpdateChecker updateChecker, bool activateWindow = true, string changelogURL = null) + public UpdateMessageBox(UpdateChecker updateChecker, bool activateWindow = true, bool devBuild = false) { ActivateWindow = activateWindow; - ChangelogURL = changelogURL; InitializeComponent(); ShareXResources.ApplyTheme(this); @@ -75,14 +73,15 @@ public UpdateMessageBox(UpdateChecker updateChecker, bool activateWindow = true, sbText.Append(Resources.UpdateMessageBox_UpdateMessageBox_LatestVersion); sbText.Append(": "); sbText.Append(updateChecker.LatestVersion); + if (devBuild) sbText.Append(" Dev"); if (updateChecker is GitHubUpdateChecker githubUpdateChecker && githubUpdateChecker.IsPreRelease) sbText.Append(" (Pre-release)"); lblText.Text = sbText.ToString(); - lblViewChangelog.Visible = !string.IsNullOrEmpty(ChangelogURL); + lblViewChangelog.Visible = !devBuild; } - public static DialogResult Start(UpdateChecker updateChecker, bool activateWindow = true, string changelogURL = null) + public static DialogResult Start(UpdateChecker updateChecker, bool activateWindow = true, bool devBuild = false) { DialogResult result = DialogResult.None; @@ -92,7 +91,7 @@ public static DialogResult Start(UpdateChecker updateChecker, bool activateWindo try { - using (UpdateMessageBox messageBox = new UpdateMessageBox(updateChecker, activateWindow, changelogURL)) + using (UpdateMessageBox messageBox = new UpdateMessageBox(updateChecker, activateWindow, devBuild)) { result = messageBox.ShowDialog(); } @@ -129,7 +128,7 @@ private void UpdateMessageBox_FormClosing(object sender, FormClosingEventArgs e) private void lblViewChangelog_Click(object sender, EventArgs e) { - URLHelpers.OpenURL(ChangelogURL); + URLHelpers.OpenURL(Links.Changelog); } private void btnYes_MouseClick(object sender, MouseEventArgs e) diff --git a/ShareX/TaskHelpers.cs b/ShareX/TaskHelpers.cs index 064e9742f..fcffdd4f3 100644 --- a/ShareX/TaskHelpers.cs +++ b/ShareX/TaskHelpers.cs @@ -1873,7 +1873,7 @@ public static async Task DownloadDevBuild() await updateChecker.CheckUpdateAsync(); - UpdateMessageBox.Start(updateChecker); + UpdateMessageBox.Start(updateChecker, true, true); } public static async Task DownloadAppVeyorBuild() @@ -1887,7 +1887,7 @@ public static async Task DownloadAppVeyorBuild() await updateChecker.CheckUpdateAsync(); - UpdateMessageBox.Start(updateChecker); + UpdateMessageBox.Start(updateChecker, true, true); } public static Image CreateQRCode(string text, int width, int height)