aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--shell/ChangeLog8
-rw-r--r--shell/Makefile.am22
-rw-r--r--shell/main.c52
3 files changed, 81 insertions, 1 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index c94cfd3744..ba7aecdd52 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,11 @@
+2003-03-28 Ettore Perazzoli <ettore@ximian.com>
+
+ [#40377]
+
+ * main.c (kill_old_wombat): New.
+ (kill_wombat): New.
+ (idle_cb): Call kill_old_wombat().
+
2003-03-27 Ettore Perazzoli <ettore@ximian.com>
* e-shell-offline-handler.c (update_dialog_tree_view): Renamed
diff --git a/shell/Makefile.am b/shell/Makefile.am
index c81d66ee67..defd6266c3 100644
--- a/shell/Makefile.am
+++ b/shell/Makefile.am
@@ -78,6 +78,27 @@ $(SELECT_NAMES_IDL_GENERATED_H): $(SELECT_NAMES_IDL)
$(SELECT_NAMES_IDL_GENERATED_C): $(SELECT_NAMES_IDL_GENERATED_H)
+# Wombat CORBA stuff
+
+WOMBAT_IDL = \
+ $(top_srcdir)/wombat/Evolution-Wombat.idl
+
+WOMBAT_IDL_GENERATED_H = \
+ Evolution-Wombat.h
+
+WOMBAT_IDL_GENERATED_C = \
+ Evolution-Wombat-common.c \
+ Evolution-Wombat-skels.c \
+ Evolution-Wombat-stubs.c
+
+WOMBAT_IDL_GENERATED = $(WOMBAT_IDL_GENERATED_C) $(WOMBAT_IDL_GENERATED_H)
+
+$(WOMBAT_IDL_GENERATED_H): $(WOMBAT_IDL)
+ $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) $(WOMBAT_IDL)
+
+$(WOMBAT_IDL_GENERATED_C): $(WOMBAT_IDL_GENERATED_H)
+
+
# IDL install
idl_DATA = $(IDLS)
@@ -140,6 +161,7 @@ libeshell_la_LIBADD = \
evolution_SOURCES = \
$(SELECT_NAMES_IDL_GENERATED) \
+ $(WOMBAT_IDL_GENERATED) \
e-activity-handler.c \
e-activity-handler.h \
e-component-info.c \
diff --git a/shell/main.c b/shell/main.c
index 45a2e0c74f..8aa3b9b79a 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -1,7 +1,7 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* main.c
*
- * Copyright (C) 2000, 2001, 2002 Ximian, Inc.
+ * Copyright (C) 2000, 2001, 2002, 2003 Ximian, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
@@ -60,6 +60,7 @@
#include <glade/glade.h>
#include "e-config-upgrade.h"
+#include "Evolution-Wombat.h"
#ifdef GTKHTML_HAVE_GCONF
#include <gconf/gconf.h>
@@ -167,6 +168,53 @@ shell_weak_notify (void *data,
}
+static void
+kill_wombat (void)
+{
+ g_print ("(Killing old version of Wombat...)\n");
+
+ system (KILL_PROCESS_CMD " -9 lt-evolution-wombat 2> /dev/null");
+ system (KILL_PROCESS_CMD " -9 evolution-wombat 2> /dev/null");
+}
+
+static void
+kill_old_wombat (void)
+{
+ GNOME_Evolution_WombatInterfaceCheck iface;
+ CORBA_Environment ev;
+ CORBA_char *version;
+
+ CORBA_exception_init (&ev);
+
+ iface = bonobo_activation_activate_from_id ("OAFIID:GNOME_Evolution_Wombat_InterfaceCheck", 0, NULL, &ev);
+ if (BONOBO_EX (&ev) || iface == CORBA_OBJECT_NIL) {
+ kill_wombat ();
+ CORBA_exception_free (&ev);
+ return;
+ }
+
+ version = GNOME_Evolution_WombatInterfaceCheck__get_interfaceVersion (iface, &ev);
+ if (BONOBO_EX (&ev)) {
+ kill_wombat ();
+ CORBA_Object_release (iface, &ev);
+ CORBA_exception_free (&ev);
+ return;
+ }
+
+ if (strcmp (version, VERSION) != 0) {
+ CORBA_free (version);
+ kill_wombat ();
+ CORBA_Object_release (iface, &ev);
+ CORBA_exception_free (&ev);
+ return;
+ }
+
+ CORBA_free (version);
+ CORBA_Object_release (iface, &ev);
+ CORBA_exception_free (&ev);
+}
+
+
/* Warning dialog to scare people off a little bit. */
static void
@@ -299,6 +347,8 @@ idle_cb (void *data)
gboolean display_default;
gboolean displayed_any;
+ kill_old_wombat ();
+
CORBA_exception_init (&ev);
uri_list = (GSList *) data;