1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-05-14 11:34:08 +02:00

Make \n the only new line character in FormMessage

This commit is contained in:
chylex 2017-07-09 01:52:44 +02:00
parent f85587fb0b
commit 530b44762b
4 changed files with 4 additions and 4 deletions

View File

@ -340,7 +340,7 @@ private void updates_UpdateDismissed(object sender, UpdateDismissedEventArgs e){
private void soundNotification_PlaybackError(object sender, PlaybackErrorEventArgs e){
e.Ignore = true;
using(FormMessage form = new FormMessage("Notification Sound Error", "Could not play custom notification sound."+Environment.NewLine+e.Message, MessageBoxIcon.Error)){
using(FormMessage form = new FormMessage("Notification Sound Error", "Could not play custom notification sound.\n"+e.Message, MessageBoxIcon.Error)){
form.CancelButton = form.AddButton("Ignore");
Button btnOpenSettings = form.AddButton("View Options");

View File

@ -9,7 +9,7 @@ namespace TweetDuck.Core.Handling {
class JavaScriptDialogHandler : IJsDialogHandler{
bool IJsDialogHandler.OnJSDialog(IWebBrowser browserControl, IBrowser browser, string originUrl, CefJsDialogType dialogType, string messageText, string defaultPromptText, IJsDialogCallback callback, ref bool suppressMessage){
((ChromiumWebBrowser)browserControl).InvokeSafe(() => {
FormMessage form = new FormMessage(Program.BrandName, messageText, MessageBoxIcon.None);
FormMessage form = new FormMessage(Program.BrandName, messageText.Replace("\r", ""), MessageBoxIcon.None);
TextBox input = null;
if (dialogType == CefJsDialogType.Alert){

View File

@ -63,7 +63,7 @@ public FormMessage(string caption, string text, MessageBoxIcon messageIcon){
this.isReady = true;
this.Text = caption;
this.labelMessage.Text = text;
this.labelMessage.Text = text.Replace("\n", Environment.NewLine); // TODO replace all \r\n
}
private void FormMessage_SizeChanged(object sender, EventArgs e){

View File

@ -43,7 +43,7 @@ public bool Log(string data){
public void HandleException(string caption, string message, bool canIgnore, Exception e){
bool loggedSuccessfully = Log(e.ToString());
FormMessage form = new FormMessage(caption, message+Environment.NewLine+"Error: "+e.Message, canIgnore ? MessageBoxIcon.Warning : MessageBoxIcon.Error);
FormMessage form = new FormMessage(caption, message+"\nError: "+e.Message.Replace("\r", ""), canIgnore ? MessageBoxIcon.Warning : MessageBoxIcon.Error);
Button btnExit = form.AddButton("Exit");
Button btnIgnore = form.AddButton("Ignore", DialogResult.Ignore);