From 7c6a10ab046ddb963e4b250f7b3876c3acd78e20 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Tue, 29 Aug 2000 08:46:15 +0000 Subject: Strip off newlines when setting the messages in the statusbar, so that the statusbar's size doesn't change in a bad way if the component gives us a message including a newline. (The latter shouldn't happen anyway, but this is a different issue.) svn path=/trunk/; revision=5094 --- shell/e-shell-view.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'shell/e-shell-view.c') diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index be0845da32..3a7f838d3b 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -694,10 +694,22 @@ shell_view_interface_set_message_cb (EvolutionShellView *shell_view, gtk_progress_set_value (GTK_PROGRESS (app_bar->progress), 1.0); - if (message != NULL) - gnome_appbar_set_status (app_bar, message); - else + if (message != NULL) { + const char *newline; + + newline = strchr (message, '\n'); + if (newline == NULL) { + gnome_appbar_set_status (app_bar, message); + } else { + char *message_until_newline; + + message_until_newline = g_strndup (message, newline - message); + gnome_appbar_set_status (app_bar, message_until_newline); + g_free (message_until_newline); + } + } else { gnome_appbar_set_status (app_bar, ""); + } if (busy) start_progress_bar (E_SHELL_VIEW (data)); -- cgit v1.2.3