From 7aa37d45375de7a08821f7108cd90cdc96273be5 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Sun, 19 Aug 2001 17:35:44 +0000 Subject: Set the folder bar message here. 2001-08-19 Christopher James Lahey * gui/component/addressbook.c (set_folder_bar_label), gui/widgets/e-addressbook-model.c, gui/widgets/e-addressbook-model.h (update_folder_bar_message), gui/widgets/e-addressbook-view.c, gui/widgets/e-addressbook-view.h (folder_bar_message): Set the folder bar message here. * gui/component/select-names/e-select-names-model.c (SEPLEN): Use strlen(SEPARATOR) here so that if the separator changes the length will work properly. svn path=/trunk/; revision=12220 --- addressbook/gui/component/addressbook.c | 44 ++++++++++++++++++++++ .../component/select-names/e-select-names-model.c | 2 +- 2 files changed, 45 insertions(+), 1 deletion(-) (limited to 'addressbook/gui/component') diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c index a6f0dfc2a5..5e8b523a5a 100644 --- a/addressbook/gui/component/addressbook.c +++ b/addressbook/gui/component/addressbook.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -40,6 +41,8 @@ #include #include +#define d(x) + #define PROPERTY_FOLDER_URI "folder_uri" #define PROPERTY_FOLDER_URI_IDX 1 @@ -791,6 +794,42 @@ set_status_message (EAddressbookView *eav, const char *message, AddressbookView CORBA_exception_free (&ev); } +static void +set_folder_bar_label (EAddressbookView *eav, const char *message, AddressbookView *view) +{ + CORBA_Environment ev; + GNOME_Evolution_ShellView shell_view_interface; + + CORBA_exception_init (&ev); + + shell_view_interface = retrieve_shell_view_interface_from_control (view->control); + if (!shell_view_interface) { + CORBA_exception_free (&ev); + return; + } + + d(g_message("Updating via ShellView")); + + if (message == NULL || message[0] == 0) { + GNOME_Evolution_ShellView_setFolderBarLabel (shell_view_interface, + "", + &ev); + } + else { + GNOME_Evolution_ShellView_setFolderBarLabel (shell_view_interface, + message, + &ev); + } + + if (BONOBO_EX (&ev)) + g_warning ("Exception in label update: %s", + bonobo_exception_get_text (&ev)); + + CORBA_exception_free (&ev); +} + + + BonoboControl * addressbook_factory_new_control (void) { @@ -872,6 +911,11 @@ addressbook_factory_new_control (void) GTK_SIGNAL_FUNC(set_status_message), view); + gtk_signal_connect (GTK_OBJECT (view->view), + "folder_bar_message", + GTK_SIGNAL_FUNC(set_folder_bar_label), + view); + gtk_signal_connect (GTK_OBJECT (view->view), "command_state_change", GTK_SIGNAL_FUNC(update_command_state), diff --git a/addressbook/gui/component/select-names/e-select-names-model.c b/addressbook/gui/component/select-names/e-select-names-model.c index 9dda927640..6e0482ade3 100644 --- a/addressbook/gui/component/select-names/e-select-names-model.c +++ b/addressbook/gui/component/select-names/e-select-names-model.c @@ -21,7 +21,7 @@ #include "addressbook/backend/ebook/e-card-simple.h" #define SEPARATOR ", " -#define SEPLEN 2 +#define SEPLEN (strlen(SEPARATOR)) enum { -- cgit v1.2.3