From 7538aee4f23250a669afe10bd284f26a71902ce9 Mon Sep 17 00:00:00 2001 From: chylex <contact@chylex.com> Date: Sun, 9 Jul 2017 03:50:04 +0200 Subject: [PATCH] Replace all MessageBox.Show calls with FormMessage --- Core/Bridge/TweetDeckBridge.cs | 3 +- Core/FormBrowser.cs | 2 +- Core/Handling/ContextMenuBase.cs | 3 +- Core/Handling/JavaScriptDialogHandler.cs | 10 +++--- .../FormNotificationScreenshotable.cs | 3 +- Core/Other/FormPlugins.cs | 2 +- Core/Other/Settings/BaseTabSettings.cs | 2 +- .../Settings/Dialogs/DialogSettingsCefArgs.cs | 2 +- .../Settings/Dialogs/DialogSettingsManage.cs | 2 +- Core/Other/Settings/Export/ExportManager.cs | 5 ++- Core/Other/Settings/TabSettingsAdvanced.cs | 3 +- Core/Other/Settings/TabSettingsGeneral.cs | 5 ++- .../Settings/TabSettingsNotifications.cs | 2 +- Core/Other/Settings/TabSettingsSounds.cs | 2 +- Core/Utils/BrowserUtils.cs | 3 +- Program.cs | 31 +++++++------------ Reporter.cs | 9 ++---- Resources/ScriptLoader.cs | 4 +-- Updates/FormUpdateDownload.cs | 3 +- 19 files changed, 44 insertions(+), 52 deletions(-) diff --git a/Core/Bridge/TweetDeckBridge.cs b/Core/Bridge/TweetDeckBridge.cs index f898eb42..8669e62e 100644 --- a/Core/Bridge/TweetDeckBridge.cs +++ b/Core/Bridge/TweetDeckBridge.cs @@ -1,6 +1,7 @@ using System.Windows.Forms; using TweetDuck.Core.Controls; using TweetDuck.Core.Notification; +using TweetDuck.Core.Other; using TweetDuck.Core.Utils; namespace TweetDuck.Core.Bridge{ @@ -101,7 +102,7 @@ public void Alert(string type, string contents){ default: icon = MessageBoxIcon.None; break; } - MessageBox.Show(contents, Program.BrandName+" Browser Message", MessageBoxButtons.OK, icon); + FormMessage.Show(Program.BrandName+" Browser Message", contents, icon, FormMessage.OK); } public void CrashDebug(string message){ diff --git a/Core/FormBrowser.cs b/Core/FormBrowser.cs index 864d0b89..2ec1e84a 100644 --- a/Core/FormBrowser.cs +++ b/Core/FormBrowser.cs @@ -341,7 +341,7 @@ private void soundNotification_PlaybackError(object sender, PlaybackErrorEventAr e.Ignore = true; using(FormMessage form = new FormMessage("Notification Sound Error", "Could not play custom notification sound.\n"+e.Message, MessageBoxIcon.Error)){ - form.AddButton("Ignore", ControlType.Cancel | ControlType.Focused); + form.AddButton(FormMessage.Ignore, ControlType.Cancel | ControlType.Focused); Button btnOpenSettings = form.AddButton("View Options"); btnOpenSettings.Width += 16; diff --git a/Core/Handling/ContextMenuBase.cs b/Core/Handling/ContextMenuBase.cs index cc915a4e..1d146d22 100644 --- a/Core/Handling/ContextMenuBase.cs +++ b/Core/Handling/ContextMenuBase.cs @@ -5,6 +5,7 @@ using System.Windows.Forms; using TweetDuck.Core.Bridge; using TweetDuck.Core.Controls; +using TweetDuck.Core.Other; using TweetDuck.Core.Utils; namespace TweetDuck.Core.Handling{ @@ -80,7 +81,7 @@ public virtual bool OnContextMenuCommand(IWebBrowser browserControl, IBrowser br if (saveTarget != null){ BrowserUtils.DownloadFileAsync(parameters.SourceUrl, saveTarget, null, ex => { - MessageBox.Show("An error occurred while downloading the image: "+ex.Message, Program.BrandName+" Has Failed :(", MessageBoxButtons.OK, MessageBoxIcon.Error); + FormMessage.Error(Program.BrandName+" Has Failed :(", "An error occurred while downloading the image: "+ex.Message, FormMessage.OK); }); } diff --git a/Core/Handling/JavaScriptDialogHandler.cs b/Core/Handling/JavaScriptDialogHandler.cs index 7dc03627..989f1744 100644 --- a/Core/Handling/JavaScriptDialogHandler.cs +++ b/Core/Handling/JavaScriptDialogHandler.cs @@ -13,15 +13,15 @@ bool IJsDialogHandler.OnJSDialog(IWebBrowser browserControl, IBrowser browser, s TextBox input = null; if (dialogType == CefJsDialogType.Alert){ - form.AddButton("OK", ControlType.Accept | ControlType.Focused); + form.AddButton(FormMessage.OK, ControlType.Accept | ControlType.Focused); } else if (dialogType == CefJsDialogType.Confirm){ - form.AddButton("No", DialogResult.No, ControlType.Cancel); - form.AddButton("Yes", ControlType.Focused); + form.AddButton(FormMessage.No, DialogResult.No, ControlType.Cancel); + form.AddButton(FormMessage.Yes, ControlType.Focused); } else if (dialogType == CefJsDialogType.Prompt){ - form.AddButton("Cancel", DialogResult.Cancel, ControlType.Cancel); - form.AddButton("OK", ControlType.Accept | ControlType.Focused); + form.AddButton(FormMessage.Cancel, DialogResult.Cancel, ControlType.Cancel); + form.AddButton(FormMessage.OK, ControlType.Accept | ControlType.Focused); input = new TextBox{ Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom, diff --git a/Core/Notification/Screenshot/FormNotificationScreenshotable.cs b/Core/Notification/Screenshot/FormNotificationScreenshotable.cs index e308aa4f..cf3ce0a2 100644 --- a/Core/Notification/Screenshot/FormNotificationScreenshotable.cs +++ b/Core/Notification/Screenshot/FormNotificationScreenshotable.cs @@ -3,6 +3,7 @@ using System.Drawing.Imaging; using System.Windows.Forms; using TweetDuck.Core.Bridge; +using TweetDuck.Core.Other; using TweetDuck.Core.Utils; using TweetDuck.Data; using TweetDuck.Plugins; @@ -43,7 +44,7 @@ public void TakeScreenshot(){ IntPtr context = NativeMethods.GetDC(this.Handle); if (context == IntPtr.Zero){ - MessageBox.Show("Could not retrieve a graphics context handle for the notification window to take the screenshot.", "Screenshot Failed", MessageBoxButtons.OK, MessageBoxIcon.Error); + FormMessage.Error("Screenshot Failed", "Could not retrieve a graphics context handle for the notification window to take the screenshot.", FormMessage.OK); } else{ using(Bitmap bmp = new Bitmap(ClientSize.Width, ClientSize.Height, PixelFormat.Format32bppRgb)){ diff --git a/Core/Other/FormPlugins.cs b/Core/Other/FormPlugins.cs index 08f46986..67704004 100644 --- a/Core/Other/FormPlugins.cs +++ b/Core/Other/FormPlugins.cs @@ -80,7 +80,7 @@ private void btnOpenFolder_Click(object sender, EventArgs e){ } private void btnReload_Click(object sender, EventArgs e){ - if (MessageBox.Show("This will also reload the browser window. Do you want to proceed?", "Reloading Plugins", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.Yes){ + if (FormMessage.Warning("Reloading Plugins", "This will also reload the browser window. Do you want to proceed?", FormMessage.Yes, FormMessage.No)){ pluginManager.Reload(); ReloadPluginList(); } diff --git a/Core/Other/Settings/BaseTabSettings.cs b/Core/Other/Settings/BaseTabSettings.cs index ce232676..68ad42fa 100644 --- a/Core/Other/Settings/BaseTabSettings.cs +++ b/Core/Other/Settings/BaseTabSettings.cs @@ -25,7 +25,7 @@ public virtual void OnReady(){} public virtual void OnClosing(){} protected static void PromptRestart(){ - if (MessageBox.Show("The application must restart for the option to take place. Do you want to restart now?", Program.BrandName+" Options", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes){ + if (FormMessage.Information(Program.BrandName+" Options", "The application must restart for the option to take place. Do you want to restart now?", FormMessage.Yes, FormMessage.No)){ Program.Restart(); } } diff --git a/Core/Other/Settings/Dialogs/DialogSettingsCefArgs.cs b/Core/Other/Settings/Dialogs/DialogSettingsCefArgs.cs index 7a306efc..fb812b6c 100644 --- a/Core/Other/Settings/Dialogs/DialogSettingsCefArgs.cs +++ b/Core/Other/Settings/Dialogs/DialogSettingsCefArgs.cs @@ -33,7 +33,7 @@ private void btnApply_Click(object sender, EventArgs e){ int count = CommandLineArgsParser.ReadCefArguments(CefArgs).Count; string prompt = count == 0 && !string.IsNullOrWhiteSpace(prevArgs) ? "All current arguments will be removed. Continue?" : count+(count == 1 ? " argument was" : " arguments were")+" detected. Continue?"; - if (MessageBox.Show(prompt, "Confirm CEF Arguments", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.OK){ + if (FormMessage.Question("Confirm CEF Arguments", prompt, FormMessage.OK, FormMessage.Cancel)){ DialogResult = DialogResult.OK; Close(); } diff --git a/Core/Other/Settings/Dialogs/DialogSettingsManage.cs b/Core/Other/Settings/Dialogs/DialogSettingsManage.cs index 0999492d..13ae3a6b 100644 --- a/Core/Other/Settings/Dialogs/DialogSettingsManage.cs +++ b/Core/Other/Settings/Dialogs/DialogSettingsManage.cs @@ -58,7 +58,7 @@ private void btnContinue_Click(object sender, EventArgs e){ case State.Deciding: // Reset if (radioReset.Checked){ - if (MessageBox.Show("This will reset all of your program options. Plugins will not be affected. Do you want to proceed?", "Reset "+Program.BrandName+" Options", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2) == DialogResult.Yes){ + if (FormMessage.Warning("Reset "+Program.BrandName+" Options", "This will reset all of your program options. Plugins will not be affected. Do you want to proceed?", FormMessage.Yes, FormMessage.No)){ Program.ResetConfig(); ShouldReloadUI = true; diff --git a/Core/Other/Settings/Export/ExportManager.cs b/Core/Other/Settings/Export/ExportManager.cs index cf42ab4b..e0c4f8eb 100644 --- a/Core/Other/Settings/Export/ExportManager.cs +++ b/Core/Other/Settings/Export/ExportManager.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using System.Windows.Forms; using TweetDuck.Configuration; using TweetDuck.Data; using TweetDuck.Plugins; @@ -39,7 +38,7 @@ public bool Export(ExportFileFlags flags){ try{ stream.WriteFile(new string[]{ "plugin.data", plugin.Identifier, path.Relative }, path.Full); }catch(ArgumentOutOfRangeException e){ - MessageBox.Show("Could not include a plugin file in the export. "+e.Message, "Export Profile", MessageBoxButtons.OK, MessageBoxIcon.Warning); + FormMessage.Warning("Export Profile", "Could not include a plugin file in the export. "+e.Message, FormMessage.OK); } } } @@ -139,7 +138,7 @@ public bool Import(ExportFileFlags flags){ } if (missingPlugins.Count > 0){ - MessageBox.Show("Detected missing plugins when importing plugin data:"+Environment.NewLine+string.Join(Environment.NewLine, missingPlugins), "Importing "+Program.BrandName+" Profile", MessageBoxButtons.OK, MessageBoxIcon.Information); + FormMessage.Information("Importing "+Program.BrandName+" Profile", "Detected missing plugins when importing plugin data:\n"+string.Join("\n", missingPlugins), FormMessage.OK); } if (IsRestarting){ diff --git a/Core/Other/Settings/TabSettingsAdvanced.cs b/Core/Other/Settings/TabSettingsAdvanced.cs index 9a7f89cc..1ca4fddf 100644 --- a/Core/Other/Settings/TabSettingsAdvanced.cs +++ b/Core/Other/Settings/TabSettingsAdvanced.cs @@ -56,8 +56,7 @@ public override void OnReady(){ private void btnClearCache_Click(object sender, EventArgs e){ btnClearCache.Enabled = false; BrowserCache.SetClearOnExit(); - - MessageBox.Show("Cache will be automatically cleared when "+Program.BrandName+" exits.", "Clear Cache", MessageBoxButtons.OK, MessageBoxIcon.Information); + FormMessage.Information("Clear Cache", "Cache will be automatically cleared when "+Program.BrandName+" exits.", FormMessage.OK); } private void checkHardwareAcceleration_CheckedChanged(object sender, EventArgs e){ diff --git a/Core/Other/Settings/TabSettingsGeneral.cs b/Core/Other/Settings/TabSettingsGeneral.cs index 1a91521e..c2dcea15 100644 --- a/Core/Other/Settings/TabSettingsGeneral.cs +++ b/Core/Other/Settings/TabSettingsGeneral.cs @@ -1,5 +1,4 @@ using System; -using System.Windows.Forms; using TweetDuck.Core.Controls; using TweetDuck.Updates; using TweetDuck.Updates.Events; @@ -89,7 +88,7 @@ private void btnCheckUpdates_Click(object sender, EventArgs e){ updateCheckEventId = updates.Check(true); if (updateCheckEventId == -1){ - MessageBox.Show("Sorry, your system is no longer supported.", "Unsupported System", MessageBoxButtons.OK, MessageBoxIcon.Warning); + FormMessage.Warning("Unsupported System", "Sorry, your system is no longer supported.", FormMessage.OK); } else{ btnCheckUpdates.Enabled = false; @@ -103,7 +102,7 @@ private void updates_CheckFinished(object sender, UpdateCheckEventArgs e){ btnCheckUpdates.Enabled = true; if (!e.UpdateAvailable){ - MessageBox.Show("Your version of "+Program.BrandName+" is up to date.", "No Updates Available", MessageBoxButtons.OK, MessageBoxIcon.Information); + FormMessage.Information("No Updates Available", "Your version of "+Program.BrandName+" is up to date.", FormMessage.OK); } } }); diff --git a/Core/Other/Settings/TabSettingsNotifications.cs b/Core/Other/Settings/TabSettingsNotifications.cs index 315b2b2c..6cec96b6 100644 --- a/Core/Other/Settings/TabSettingsNotifications.cs +++ b/Core/Other/Settings/TabSettingsNotifications.cs @@ -154,7 +154,7 @@ private void radioLocCustom_Click(object sender, EventArgs e){ comboBoxDisplay.Enabled = trackBarEdgeDistance.Enabled = false; notification.ShowNotificationForSettings(false); - if (notification.IsFullyOutsideView() && MessageBox.Show("The notification seems to be outside of view, would you like to reset its position?", "Notification is outside view", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes){ + if (notification.IsFullyOutsideView() && FormMessage.Question("Notification is outside view", "The notification seems to be outside of view, would you like to reset its position?", FormMessage.Yes, FormMessage.No)){ Config.NotificationPosition = TweetNotification.Position.TopRight; notification.MoveToVisibleLocation(); diff --git a/Core/Other/Settings/TabSettingsSounds.cs b/Core/Other/Settings/TabSettingsSounds.cs index fe320588..89ab56e0 100644 --- a/Core/Other/Settings/TabSettingsSounds.cs +++ b/Core/Other/Settings/TabSettingsSounds.cs @@ -44,7 +44,7 @@ private void btnPlaySound_Click(object sender, EventArgs e){ } private void sound_PlaybackError(object sender, PlaybackErrorEventArgs e){ - MessageBox.Show("Could not play custom notification sound."+Environment.NewLine+e.Message, "Notification Sound Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + FormMessage.Error("Notification Sound Error", "Could not play custom notification sound.\n"+e.Message, FormMessage.OK); } private void btnBrowseSound_Click(object sender, EventArgs e){ diff --git a/Core/Utils/BrowserUtils.cs b/Core/Utils/BrowserUtils.cs index c56d00ba..f028593c 100644 --- a/Core/Utils/BrowserUtils.cs +++ b/Core/Utils/BrowserUtils.cs @@ -6,6 +6,7 @@ using System.IO; using System.Net; using System.Windows.Forms; +using TweetDuck.Core.Other; namespace TweetDuck.Core.Utils{ static class BrowserUtils{ @@ -67,7 +68,7 @@ public static void OpenExternalBrowser(string url){ OpenExternalBrowserUnsafe(url); } else{ - MessageBox.Show("A potentially malicious URL was blocked from opening:"+Environment.NewLine+url, "Blocked URL", MessageBoxButtons.OK, MessageBoxIcon.Warning); + FormMessage.Warning("Blocked URL", "A potentially malicious URL was blocked from opening:\n"+url, FormMessage.OK); } } diff --git a/Program.cs b/Program.cs index 00631511..40a3a74f 100644 --- a/Program.cs +++ b/Program.cs @@ -75,7 +75,7 @@ private static void Main(){ SubProcessMessage = NativeMethods.RegisterWindowMessage("TweetDuckSubProcess"); if (!WindowsUtils.CheckFolderWritePermission(StoragePath)){ - MessageBox.Show(BrandName+" does not have write permissions to the storage folder: "+StoragePath, "Permission Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); + FormMessage.Warning("Permission Error", BrandName+" does not have write permissions to the storage folder: "+StoragePath, FormMessage.OK); return; } @@ -87,21 +87,16 @@ private static void Main(){ break; } else if (lockResult == LockManager.Result.Fail){ - MessageBox.Show("An unknown error occurred accessing the data folder. Please, make sure "+BrandName+" is not already running. If the problem persists, try restarting your system.", BrandName+" Has Failed :(", MessageBoxButtons.OK, MessageBoxIcon.Error); + FormMessage.Error(BrandName+" Has Failed :(", "An unknown error occurred accessing the data folder. Please, make sure "+BrandName+" is not already running. If the problem persists, try restarting your system.", FormMessage.OK); return; } else if (attempt == 20){ - using(FormMessage form = new FormMessage(BrandName+" Cannot Restart", BrandName+" is taking too long to close.", MessageBoxIcon.Warning)){ - form.CancelButton = form.AddButton("Exit"); - form.ActiveControl = form.AddButton("Retry", DialogResult.Retry); - - if (form.ShowDialog() == DialogResult.Retry){ - attempt /= 2; - continue; - } - - return; + if (FormMessage.Warning(BrandName+" Cannot Restart", BrandName+" is taking too long to close.", FormMessage.Retry, FormMessage.Exit)){ + attempt /= 2; + continue; } + + return; } else Thread.Sleep(500); } @@ -121,9 +116,9 @@ private static void Main(){ } } - if (MessageBox.Show("Another instance of "+BrandName+" is already running.\r\nDo you want to close it?", BrandName+" is Already Running", MessageBoxButtons.YesNo, MessageBoxIcon.Error, MessageBoxDefaultButton.Button2) == DialogResult.Yes){ + if (FormMessage.Error(BrandName+" is Already Running", "Another instance of "+BrandName+" is already running.\nDo you want to close it?", FormMessage.Yes, FormMessage.No)){ if (!LockManager.CloseLockingProcess(10000, 5000)){ - MessageBox.Show("Could not close the other process.", BrandName+" Has Failed :(", MessageBoxButtons.OK, MessageBoxIcon.Error); + FormMessage.Error(BrandName+" Has Failed :(", "Could not close the other process.", FormMessage.OK); return; } @@ -132,7 +127,7 @@ private static void Main(){ else return; } else if (lockResult != LockManager.Result.Success){ - MessageBox.Show("An unknown error occurred accessing the data folder. Please, make sure "+BrandName+" is not already running. If the problem persists, try restarting your system.", BrandName+" Has Failed :(", MessageBoxButtons.OK, MessageBoxIcon.Error); + FormMessage.Error(BrandName+" Has Failed :(", "An unknown error occurred accessing the data folder. Please, make sure "+BrandName+" is not already running. If the problem persists, try restarting your system.", BrandName+" Has Failed :(", FormMessage.OK); return; } } @@ -198,15 +193,13 @@ private static void Main(){ private static void plugins_Reloaded(object sender, PluginErrorEventArgs e){ if (e.HasErrors){ - string doubleNL = Environment.NewLine+Environment.NewLine; - MessageBox.Show("The following plugins will not be available until the issues are resolved:"+doubleNL+string.Join(doubleNL, e.Errors), "Error Loading Plugins", MessageBoxButtons.OK, MessageBoxIcon.Error); + FormMessage.Error("Error Loading Plugins", "The following plugins will not be available until the issues are resolved:\n\n"+string.Join("\n\n", e.Errors), FormMessage.OK); } } private static void plugins_Executed(object sender, PluginErrorEventArgs e){ if (e.HasErrors){ - string doubleNL = Environment.NewLine+Environment.NewLine; - MessageBox.Show("Failed to execute the following plugins:"+doubleNL+string.Join(doubleNL, e.Errors), "Error Executing Plugins", MessageBoxButtons.OK, MessageBoxIcon.Error); + FormMessage.Error("Error Executing Plugins", "Failed to execute the following plugins:\n\n"+string.Join("\n\n", e.Errors), FormMessage.OK); } } diff --git a/Reporter.cs b/Reporter.cs index cb338448..eb7ac857 100644 --- a/Reporter.cs +++ b/Reporter.cs @@ -45,8 +45,8 @@ public void HandleException(string caption, string message, bool canIgnore, Exce FormMessage form = new FormMessage(caption, message+"\nError: "+e.Message, canIgnore ? MessageBoxIcon.Warning : MessageBoxIcon.Error); - Button btnExit = form.AddButton("Exit"); - Button btnIgnore = form.AddButton("Ignore", DialogResult.Ignore, ControlType.Cancel); + Button btnExit = form.AddButton(FormMessage.Exit); + Button btnIgnore = form.AddButton(FormMessage.Ignore, DialogResult.Ignore, ControlType.Cancel); btnIgnore.Enabled = canIgnore; form.ActiveControl = canIgnore ? btnIgnore : btnExit; @@ -83,10 +83,7 @@ public static void HandleEarlyFailure(string caption, string message){ Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - using(FormMessage form = new FormMessage(caption, message, MessageBoxIcon.Error)){ - form.AddButton("Exit", ControlType.Focused); - form.ShowDialog(); - } + FormMessage.Error(caption, message, "Exit"); try{ Process.GetCurrentProcess().Kill(); diff --git a/Resources/ScriptLoader.cs b/Resources/ScriptLoader.cs index 0472723d..cd383301 100644 --- a/Resources/ScriptLoader.cs +++ b/Resources/ScriptLoader.cs @@ -3,7 +3,7 @@ using System; using System.IO; using System.Text; -using System.Windows.Forms; +using TweetDuck.Core.Other; namespace TweetDuck.Resources{ static class ScriptLoader{ @@ -14,7 +14,7 @@ public static string LoadResource(string name, bool silent = false){ return File.ReadAllText(Path.Combine(Program.ScriptPath, name), Encoding.UTF8); }catch(Exception ex){ if (!silent){ - MessageBox.Show("Unfortunately, "+Program.BrandName+" could not load the "+name+" file. The program will continue running with limited functionality.\r\n\r\n"+ex.Message, Program.BrandName+" Has Failed :(", MessageBoxButtons.OK, MessageBoxIcon.Error); + FormMessage.Error(Program.BrandName+" Has Failed :(", "Unfortunately, "+Program.BrandName+" could not load the "+name+" file. The program will continue running with limited functionality.\n\n"+ex.Message, FormMessage.OK); } return null; diff --git a/Updates/FormUpdateDownload.cs b/Updates/FormUpdateDownload.cs index 8659fbac..e2ad01ec 100644 --- a/Updates/FormUpdateDownload.cs +++ b/Updates/FormUpdateDownload.cs @@ -1,5 +1,6 @@ using System; using System.Windows.Forms; +using TweetDuck.Core.Other; using TweetDuck.Core.Utils; namespace TweetDuck.Updates{ @@ -29,7 +30,7 @@ private void timerDownloadCheck_Tick(object sender, EventArgs e){ else if (updateInfo.DownloadStatus == UpdateDownloadStatus.Failed){ timerDownloadCheck.Stop(); - if (MessageBox.Show("Could not download the update: "+(updateInfo.DownloadError?.Message ?? "unknown error")+"\r\n\r\nDo you want to open the website and try downloading the update manually?", "Update Has Failed", MessageBoxButtons.YesNo, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1) == DialogResult.Yes){ + if (FormMessage.Error("Update Has Failed", "Could not download the update: "+(updateInfo.DownloadError?.Message ?? "unknown error")+"\n\nDo you want to open the website and try downloading the update manually?", FormMessage.Yes, FormMessage.No)){ BrowserUtils.OpenExternalBrowserUnsafe(Program.Website); DialogResult = DialogResult.OK; }