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/ChangeLog | 7 +++++++ shell/e-shell-view.c | 18 +++++++++++++++--- 2 files changed, 22 insertions(+), 3 deletions(-) (limited to 'shell') diff --git a/shell/ChangeLog b/shell/ChangeLog index 7e1d538d40..d77aef13ff 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,10 @@ +2000-08-29 Ettore Perazzoli + + * e-shell-view.c (shell_view_interface_set_message_cb): If the + message contains a newline, only display the part until the + newline, excluding the newline. Otherwise the status bar resizes + nastily. + 2000-08-28 Ettore Perazzoli * e-shell.c (setup_components): Removed the hardcoding of the 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