aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-06-28 13:28:22 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-06-28 13:28:22 +0800
commit65b4ea4c01aaba9d29c59d9f659f3ecbfacaf0b8 (patch)
tree9b959d42439ff29a4b1aa5452afcb6f6e2ec6782
parent268c7dbe4254f54f55d2bed8a9c740ee89dd9aed (diff)
downloadgsoc2013-evolution-65b4ea4c01aaba9d29c59d9f659f3ecbfacaf0b8.tar.gz
gsoc2013-evolution-65b4ea4c01aaba9d29c59d9f659f3ecbfacaf0b8.tar.zst
gsoc2013-evolution-65b4ea4c01aaba9d29c59d9f659f3ecbfacaf0b8.zip
Get the Mail Component to understand `mailto:'.
svn path=/trunk/; revision=10555
-rw-r--r--mail/ChangeLog8
-rw-r--r--mail/component-factory.c26
2 files changed, 33 insertions, 1 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 3734102af3..3a26eb9156 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,11 @@
+2001-06-28 Ettore Perazzoli <ettore@ximian.com>
+
+ * component-factory.c (component_fn): Register for the "mailto"
+ schema.
+ (handle_external_uri_cb): Callback for the "handle_external_uri"
+ signal.
+ (component_fn): Connect it.
+
2001-06-27 Ettore Perazzoli <ettore@ximian.com>
* component-factory.c (component_fn): Pass NULL as the
diff --git a/mail/component-factory.c b/mail/component-factory.c
index 40f14f908a..fc8ba49e46 100644
--- a/mail/component-factory.c
+++ b/mail/component-factory.c
@@ -96,6 +96,11 @@ static const EvolutionShellComponentFolderType folder_types[] = {
{ NULL, NULL, NULL, NULL }
};
+static const char *schema_types[] = {
+ "mailto",
+ NULL
+};
+
/* EvolutionShellComponent methods and signals. */
static EvolutionShellComponentResult
@@ -571,6 +576,23 @@ debug_cb (EvolutionShellComponent *shell_component, gpointer user_data)
camel_verbose_debug = 1;
}
+static void
+handle_external_uri_cb (EvolutionShellComponent *shell_component,
+ const char *uri,
+ void *data)
+{
+ if (strncmp (uri, "mailto:", 7) != 0) {
+ /* FIXME: Exception? The EvolutionShellComponent object should
+ give me a chance to do so, but currently it doesn't. */
+ g_warning ("Invalid URI requested to mail component -- %s", uri);
+ return;
+ }
+
+ /* FIXME: Sigh. This shouldn't be here. But the code is messy, so
+ I'll just put it here anyway. */
+ send_to_url (uri);
+}
+
static BonoboObject *
component_fn (BonoboGenericFactory *factory, void *closure)
{
@@ -578,7 +600,7 @@ component_fn (BonoboGenericFactory *factory, void *closure)
MailOfflineHandler *offline_handler;
shell_component = evolution_shell_component_new (folder_types,
- NULL,
+ schema_types,
create_view,
create_folder,
remove_folder,
@@ -602,6 +624,8 @@ component_fn (BonoboGenericFactory *factory, void *closure)
GTK_SIGNAL_FUNC (debug_cb), NULL);
gtk_signal_connect (GTK_OBJECT (shell_component), "destroy",
GTK_SIGNAL_FUNC (owner_unset_cb), NULL);
+ gtk_signal_connect (GTK_OBJECT (shell_component), "handle_external_uri",
+ GTK_SIGNAL_FUNC (handle_external_uri_cb), NULL);
offline_handler = mail_offline_handler_new ();
bonobo_object_add_interface (BONOBO_OBJECT (shell_component), BONOBO_OBJECT (offline_handler));