aboutsummaryrefslogtreecommitdiffstats
path: root/shell/evolution-activity-client.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2003-11-19 17:54:50 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2003-11-19 17:54:50 +0800
commit9130b26c7b84ea9d96bb9d77f819a4c6fe099eda (patch)
tree6f586f59da99d6df776d631a6bdccd100f90b9dc /shell/evolution-activity-client.c
parent1003ebf6196a0ad8e5de5441c44799a9d8e85a92 (diff)
downloadgsoc2013-evolution-9130b26c7b84ea9d96bb9d77f819a4c6fe099eda.tar.gz
gsoc2013-evolution-9130b26c7b84ea9d96bb9d77f819a4c6fe099eda.tar.zst
gsoc2013-evolution-9130b26c7b84ea9d96bb9d77f819a4c6fe099eda.zip
(evolution_activity_client_construct): Get a raw
GNOME_Evolution_Shell as an arg instead of an EvolutionShellClient. (get_shell_activity_iface): New helper function. (evolution_activity_client_construct): Use it. svn path=/trunk/; revision=23440
Diffstat (limited to 'shell/evolution-activity-client.c')
-rw-r--r--shell/evolution-activity-client.c44
1 files changed, 28 insertions, 16 deletions
diff --git a/shell/evolution-activity-client.c b/shell/evolution-activity-client.c
index 1ab93402d0..584ad6e15a 100644
--- a/shell/evolution-activity-client.c
+++ b/shell/evolution-activity-client.c
@@ -43,9 +43,11 @@
#include <bonobo/bonobo-listener.h>
#include <bonobo/bonobo-exception.h>
+#include <bonobo/Bonobo.h>
+
#include <gal/util/e-util.h>
-
+
#define PARENT_TYPE gtk_object_get_type ()
static GtkObjectClass *parent_class = NULL;
@@ -82,7 +84,7 @@ struct _EvolutionActivityClientPrivate {
double new_progress;
};
-
+
/* Utility functions. */
static gboolean
@@ -136,7 +138,20 @@ update_timeout_callback (void *data)
}
}
-
+static CORBA_Object
+get_shell_activity_iface (GNOME_Evolution_Shell shell_iface)
+{
+ CORBA_Object iface_object;
+ const char *iface_name = "IDL:GNOME/Evolution/Activity:1.0";
+
+ iface_object = bonobo_object_query_remote (shell_iface, iface_name, NULL);
+ if (iface_object == CORBA_OBJECT_NIL)
+ g_warning ("EvolutionActivityClient: No iface %s on Shell", iface_name);
+
+ return iface_object;
+}
+
+
/* BonoboListener callback. */
static void
@@ -158,7 +173,7 @@ listener_callback (BonoboListener *listener,
g_warning ("EvolutionActivityClient: Unknown event from listener -- %s", event_name);
}
-
+
/* GObject methods. */
static void
@@ -216,7 +231,7 @@ impl_finalize (GObject *object)
(* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
-
+
static void
class_init (EvolutionActivityClientClass *klass)
{
@@ -265,10 +280,10 @@ init (EvolutionActivityClient *activity_client)
activity_client->priv = priv;
}
-
+
gboolean
evolution_activity_client_construct (EvolutionActivityClient *activity_client,
- EvolutionShellClient *shell_client,
+ GNOME_Evolution_Shell shell_iface,
const char *component_id,
GdkPixbuf **animated_icon,
const char *information,
@@ -283,8 +298,6 @@ evolution_activity_client_construct (EvolutionActivityClient *activity_client,
g_return_val_if_fail (activity_client != NULL, FALSE);
g_return_val_if_fail (EVOLUTION_IS_ACTIVITY_CLIENT (activity_client), FALSE);
- g_return_val_if_fail (shell_client != NULL, FALSE);
- g_return_val_if_fail (EVOLUTION_IS_SHELL_CLIENT (shell_client), FALSE);
g_return_val_if_fail (animated_icon != NULL, FALSE);
g_return_val_if_fail (*animated_icon != NULL, FALSE);
g_return_val_if_fail (information != NULL, FALSE);
@@ -297,7 +310,7 @@ evolution_activity_client_construct (EvolutionActivityClient *activity_client,
CORBA_exception_init (&ev);
- activity_interface = evolution_shell_client_get_activity_interface (shell_client);
+ activity_interface = get_shell_activity_iface (shell_iface);
priv->activity_interface = CORBA_Object_duplicate (activity_interface, &ev);
if (ev._major != CORBA_NO_EXCEPTION) {
priv->activity_interface = CORBA_OBJECT_NIL;
@@ -331,7 +344,7 @@ evolution_activity_client_construct (EvolutionActivityClient *activity_client,
}
EvolutionActivityClient *
-evolution_activity_client_new (EvolutionShellClient *shell_client,
+evolution_activity_client_new (GNOME_Evolution_Shell shell_iface,
const char *component_id,
GdkPixbuf **animated_icon,
const char *information,
@@ -340,8 +353,7 @@ evolution_activity_client_new (EvolutionShellClient *shell_client,
{
EvolutionActivityClient *activity_client;
- g_return_val_if_fail (shell_client != NULL, NULL);
- g_return_val_if_fail (EVOLUTION_IS_SHELL_CLIENT (shell_client), NULL);
+ g_return_val_if_fail (shell_iface != CORBA_OBJECT_NIL, NULL);
g_return_val_if_fail (animated_icon != NULL, NULL);
g_return_val_if_fail (*animated_icon != NULL, NULL);
g_return_val_if_fail (information != NULL, NULL);
@@ -350,7 +362,7 @@ evolution_activity_client_new (EvolutionShellClient *shell_client,
activity_client = g_object_new (evolution_activity_client_get_type (), NULL);
if (! evolution_activity_client_construct (activity_client,
- shell_client,
+ shell_iface,
component_id,
animated_icon,
information,
@@ -363,7 +375,7 @@ evolution_activity_client_new (EvolutionShellClient *shell_client,
return activity_client;
}
-
+
gboolean
evolution_activity_client_update (EvolutionActivityClient *activity_client,
const char *information,
@@ -444,6 +456,6 @@ evolution_activity_client_request_dialog (EvolutionActivityClient *activity_clie
return retval;
}
-
+
E_MAKE_TYPE (evolution_activity_client, "EvolutionActivityClient", EvolutionActivityClient,
class_init, init, PARENT_TYPE)