diff options
author | Jain Vivek <jvivek@src.gnome.org> | 2004-12-08 12:17:19 +0800 |
---|---|---|
committer | Jain Vivek <jvivek@src.gnome.org> | 2004-12-08 12:17:19 +0800 |
commit | bde312e81b08f5909f7190ff93d1405c8e6e1236 (patch) | |
tree | f24b276dc3221bbbef1a4da6121de130dbbb16ee /plugins/shared-folder/share-folder-common.c | |
parent | f434741bf8f0f606119961b55ee35509a928b3ed (diff) | |
download | gsoc2013-evolution-bde312e81b08f5909f7190ff93d1405c8e6e1236.tar.gz gsoc2013-evolution-bde312e81b08f5909f7190ff93d1405c8e6e1236.tar.zst gsoc2013-evolution-bde312e81b08f5909f7190ff93d1405c8e6e1236.zip |
*** empty log message ***
svn path=/trunk/; revision=28086
Diffstat (limited to 'plugins/shared-folder/share-folder-common.c')
-rw-r--r-- | plugins/shared-folder/share-folder-common.c | 134 |
1 files changed, 134 insertions, 0 deletions
diff --git a/plugins/shared-folder/share-folder-common.c b/plugins/shared-folder/share-folder-common.c new file mode 100644 index 0000000000..6bee9cef20 --- /dev/null +++ b/plugins/shared-folder/share-folder-common.c @@ -0,0 +1,134 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * Authors: Vivek Jain <jvivek@novell.com> + * + * Copyright 2004 Novell, 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 + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA. + * + */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif +#include <bonobo/bonobo-control.h> +#include <bonobo/bonobo-widget.h> +#include <bonobo/bonobo-exception.h> +#include <bonobo/bonobo-ui-component.h> +#include <addressbook/util/e-destination.h> + +#include <string.h> +#include <glib.h> +#include <gtk/gtk.h> +#include <libgnome/gnome-i18n.h> +#include <gconf/gconf-client.h> +#include <e-util/e-config.h> +#include <mail/em-config.h> +#include <mail/em-popup.h> +#include <mail/em-folder-properties.h> +#include <mail/em-folder-tree.h> +#include <mail/em-folder-selector.h> +#include <camel/providers/groupwise/camel-groupwise-store.h> +#include <camel/providers/groupwise/camel-groupwise-folder.h> +#include <e-gw-container.h> +#include <e-gw-connection.h> +#include <glade/glade.h> +#include "share-folder.h" +#define SELECT_NAMES_OAFID "OAFIID:GNOME_Evolution_Addressbook_SelectNames:" BASE_VERSION + +typedef CORBA_Object GNOME_Evolution_Addressbook_SelectNames; +ShareFolder *common = NULL; + + + +void +shared_folder_check (EPlugin *ep, EConfigTarget *target) +{ + printf ("check **********\n"); +} + + + +void +shared_folder_commit (EPlugin *ep, EConfigTarget *target) +{ + + gchar *mesg = "Folder shared to you"; + gchar *sub = "Shared folder notification"; + ShareFolder *sf; + gchar *check = NULL; + if(common) + share_folder (common); + g_object_run_dispose(common); + + printf ("commit **********\n"); +} + + +void +shared_folder_abort (EPlugin *ep, EConfigTarget *target) +{ + printf ("aborttttttt**********\n"); +} + + + + + + + + +GtkWidget * +org_gnome_shared_folder_factory (EPlugin *ep, EConfigHookItemFactoryData *hook_data) +{ + + gchar *folderuri = NULL; + gchar *account = NULL; + gchar *id = NULL; + gchar *sub = NULL; + EGwConnection *cnc; + ShareFolder *sharing_tab; + EMConfigTargetPrefs *target1 = (EMConfigTargetPrefs *) hook_data->config->target; + EMConfigTargetFolder *target2= (EMConfigTargetFolder *)hook_data->config->target; + folderuri=g_strdup(target2->uri); + account = g_strrstr(folderuri, "groupwise"); + if(account) + { + sub = g_strrstr(folderuri, "#"); + if(sub == NULL) + sub = g_strrstr(folderuri, "/"); + sub++; + g_print("\n\nTHE URI OF THE FOLDER%s\n\n %s\n\n",target2->uri,sub); + CamelFolder *folder = target2->folder ; + CamelGroupwiseFolder *gw_folder = CAMEL_GROUPWISE_FOLDER(folder) ; + CamelGroupwiseStore *gw_store = CAMEL_GROUPWISE_STORE (folder->parent_store) ; + CamelGroupwiseStorePrivate *priv = gw_store->priv ; + + id = g_strdup (container_id_lookup(priv,sub)); + cnc = cnc_lookup (priv); + g_free (sub); + g_free (folderuri); + + sharing_tab = share_folder_new (cnc, id); + gtk_notebook_append_page((GtkNotebook *) hook_data->parent, sharing_tab->vbox, gtk_label_new_with_mnemonic N_("Sharing")); + common = sharing_tab; + + + return sharing_tab; + } else + return NULL; + + +} + |