aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/component
diff options
context:
space:
mode:
authorChris Toshok <toshok@helixcode.com>2001-01-10 07:55:13 +0800
committerChris Toshok <toshok@src.gnome.org>2001-01-10 07:55:13 +0800
commitf75e9f44f928347bb280e927de94e861dcf3260a (patch)
tree0875821393161e6f61210a6ad6597770f33a2ef7 /addressbook/gui/component
parent289cbd41bc8c3bdfe417f3c78e5061bbed07dcfb (diff)
downloadgsoc2013-evolution-f75e9f44f928347bb280e927de94e861dcf3260a.tar
gsoc2013-evolution-f75e9f44f928347bb280e927de94e861dcf3260a.tar.gz
gsoc2013-evolution-f75e9f44f928347bb280e927de94e861dcf3260a.tar.bz2
gsoc2013-evolution-f75e9f44f928347bb280e927de94e861dcf3260a.tar.lz
gsoc2013-evolution-f75e9f44f928347bb280e927de94e861dcf3260a.tar.xz
gsoc2013-evolution-f75e9f44f928347bb280e927de94e861dcf3260a.tar.zst
gsoc2013-evolution-f75e9f44f928347bb280e927de94e861dcf3260a.zip
connect with the EAddressbookView's status_message signal.
2001-01-09 Chris Toshok <toshok@helixcode.com> * gui/component/addressbook.c (addressbook_factory_new_control): connect with the EAddressbookView's status_message signal. (set_status_message): set the status message on the ShellView Interface associated with our control. (retrieve_shell_view_interface_from_control): new function. get the shell view inteface associated with a control. * gui/widgets/e-addressbook-view.c (e_addressbook_view_class_init): register status_message signal. (status_message): new function, emit our status_message signal. (change_view_type): connect with the view->object's "status_message" signal. * gui/widgets/e-addressbook-view.h (struct _EAddressbookViewClass): add status_message signal. svn path=/trunk/; revision=7346
Diffstat (limited to 'addressbook/gui/component')
-rw-r--r--addressbook/gui/component/addressbook.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c
index e9d4f45527..531106b2c4 100644
--- a/addressbook/gui/component/addressbook.c
+++ b/addressbook/gui/component/addressbook.c
@@ -603,6 +603,63 @@ addressbook_query_changed (ESearchBar *esb, AddressbookView *view)
g_free (search_word);
}
+static GNOME_Evolution_ShellView
+retrieve_shell_view_interface_from_control (BonoboControl *control)
+{
+ Bonobo_ControlFrame control_frame;
+ GNOME_Evolution_ShellView shell_view_interface;
+ CORBA_Environment ev;
+
+ shell_view_interface = gtk_object_get_data (GTK_OBJECT (control),
+ "shell_view_interface");
+
+ if (shell_view_interface)
+ return shell_view_interface;
+
+ control_frame = bonobo_control_get_control_frame (control);
+
+ if (control_frame == NULL)
+ return CORBA_OBJECT_NIL;
+
+ CORBA_exception_init (&ev);
+ shell_view_interface = Bonobo_Unknown_queryInterface (control_frame,
+ "IDL:GNOME/Evolution/ShellView:1.0",
+ &ev);
+ CORBA_exception_free (&ev);
+
+ if (shell_view_interface != CORBA_OBJECT_NIL)
+ gtk_object_set_data (GTK_OBJECT (control),
+ "shell_view_interface",
+ shell_view_interface);
+ else
+ g_warning ("Control frame doesn't have Evolution/ShellView.");
+
+ return shell_view_interface;
+}
+
+static void
+set_status_message (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 (message == NULL || message[0] == 0) {
+ printf ("clearing message\n");
+ GNOME_Evolution_ShellView_unsetMessage (shell_view_interface, &ev);
+ }
+ else {
+ printf ("setting message %s\n", message);
+ GNOME_Evolution_ShellView_setMessage (shell_view_interface,
+ message, 0 /* XXX */, &ev);
+ }
+
+ CORBA_exception_free (&ev);
+}
+
BonoboControl *
addressbook_factory_new_control (void)
{
@@ -650,6 +707,11 @@ addressbook_factory_new_control (void)
bonobo_control_set_properties (view->control,
view->properties);
+ gtk_signal_connect (GTK_OBJECT (view->view),
+ "status_message",
+ GTK_SIGNAL_FUNC(set_status_message),
+ view);
+
view->uri = NULL;
gtk_signal_connect (GTK_OBJECT (view->control), "activate",