aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
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
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')
-rw-r--r--addressbook/gui/component/addressbook.c62
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c23
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.h5
3 files changed, 88 insertions, 2 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",
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
index 416b1e71e6..0c977a2a35 100644
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ b/addressbook/gui/widgets/e-addressbook-view.c
@@ -68,6 +68,13 @@ enum {
ARG_TYPE,
};
+enum {
+ STATUS_MESSAGE,
+ LAST_SIGNAL
+};
+
+static guint e_addressbook_view_signals [LAST_SIGNAL] = {0, };
+
GtkType
e_addressbook_view_get_type (void)
{
@@ -111,6 +118,16 @@ e_addressbook_view_class_init (EAddressbookViewClass *klass)
GTK_ARG_READWRITE, ARG_QUERY);
gtk_object_add_arg_type ("EAddressbookView::type", GTK_TYPE_ENUM,
GTK_ARG_READWRITE, ARG_TYPE);
+
+ e_addressbook_view_signals [STATUS_MESSAGE] =
+ gtk_signal_new ("status_message",
+ GTK_RUN_LAST,
+ object_class->type,
+ GTK_SIGNAL_OFFSET (EAddressbookViewClass, status_message),
+ gtk_marshal_NONE__POINTER,
+ GTK_TYPE_NONE, 1, GTK_TYPE_POINTER);
+
+ gtk_object_class_add_signals (object_class, e_addressbook_view_signals, LAST_SIGNAL);
}
static void
@@ -536,9 +553,11 @@ table_right_click(ETableScrolled *table, gint row, gint col, GdkEvent *event, EA
}
static void
-status_message (GtkObject *object, const gchar *message, EAddressbookView *eav)
+status_message (GtkObject *object, const gchar *status, EAddressbookView *eav)
{
- printf ("status = %s\n", message);
+ gtk_signal_emit (GTK_OBJECT (eav),
+ e_addressbook_view_signals [STATUS_MESSAGE],
+ status);
}
#define SPEC "<?xml version=\"1.0\"?> \
diff --git a/addressbook/gui/widgets/e-addressbook-view.h b/addressbook/gui/widgets/e-addressbook-view.h
index 28c70798fc..ca6cedf0b8 100644
--- a/addressbook/gui/widgets/e-addressbook-view.h
+++ b/addressbook/gui/widgets/e-addressbook-view.h
@@ -73,6 +73,11 @@ struct _EAddressbookView
struct _EAddressbookViewClass
{
GtkTableClass parent_class;
+
+ /*
+ * Signals
+ */
+ void (*status_message) (EAddressbookView *view, const gchar *message);
};
GtkWidget *e_addressbook_view_new (void);