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:
parent
f85587fb0b
commit
530b44762b
@ -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");
|
||||
|
@ -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){
|
||||
|
@ -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){
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user