diff options
author | Jain Vivek <jvivek@src.gnome.org> | 2005-06-13 19:28:32 +0800 |
---|---|---|
committer | Jain Vivek <jvivek@src.gnome.org> | 2005-06-13 19:28:32 +0800 |
commit | 571d426db5c37683f03e2c95d3feea7e3d2905ec (patch) | |
tree | 1865f81f1d81c6fe858ed3632fb2bd0028cb0763 /plugins/shared-folder | |
parent | c52fbd0f99312c8f381a4b0b25a49f59a81f9c63 (diff) | |
download | gsoc2013-evolution-571d426db5c37683f03e2c95d3feea7e3d2905ec.tar gsoc2013-evolution-571d426db5c37683f03e2c95d3feea7e3d2905ec.tar.gz gsoc2013-evolution-571d426db5c37683f03e2c95d3feea7e3d2905ec.tar.bz2 gsoc2013-evolution-571d426db5c37683f03e2c95d3feea7e3d2905ec.tar.lz gsoc2013-evolution-571d426db5c37683f03e2c95d3feea7e3d2905ec.tar.xz gsoc2013-evolution-571d426db5c37683f03e2c95d3feea7e3d2905ec.tar.zst gsoc2013-evolution-571d426db5c37683f03e2c95d3feea7e3d2905ec.zip |
Removed unneeded files
svn path=/trunk/; revision=29497
Diffstat (limited to 'plugins/shared-folder')
-rw-r--r-- | plugins/shared-folder/ChangeLog | 168 | ||||
-rw-r--r-- | plugins/shared-folder/Makefile.am | 28 | ||||
-rw-r--r-- | plugins/shared-folder/install-shared.c | 221 | ||||
-rw-r--r-- | plugins/shared-folder/org-gnome-shared-folder.eplug.in | 49 | ||||
-rw-r--r-- | plugins/shared-folder/org-gnome-shared-folder.error.xml | 15 | ||||
-rw-r--r-- | plugins/shared-folder/properties.glade | 860 | ||||
-rw-r--r-- | plugins/shared-folder/share-folder-common.c | 514 | ||||
-rw-r--r-- | plugins/shared-folder/share-folder.c | 769 | ||||
-rw-r--r-- | plugins/shared-folder/share-folder.h | 120 |
9 files changed, 0 insertions, 2744 deletions
diff --git a/plugins/shared-folder/ChangeLog b/plugins/shared-folder/ChangeLog deleted file mode 100644 index 168c2b4aa7..0000000000 --- a/plugins/shared-folder/ChangeLog +++ /dev/null @@ -1,168 +0,0 @@ -2005-05-16 Not Zed <NotZed@Ximian.com> - - * share-folder-common.c: moved e-error to e-util - - * Makefile.am: error filename changes. - -2005-05-06 Chenthill Palanisamy <pchenthill@novell.com> - - Fixes #273063 - * org-gnome-shared-folder-errors.xml: - * org-gnome-shared-folder-errors.xml.h:Removed the unwanted - tabs and new line characters. - -2005-05-05 Srinivasa Ragavan <sragavan@novell.com> - - * properties.glade : Fixed a typo 272538 - -2005-05-06 Sarfraaz Ahmed <asarfraaz@novell.com> - - * properties.glade : Fixed a typo #273064 - -2005-03-31 Parthasarathi Susarla <sparthasarathi@novell.com> - - * share-folder-common.c:(create_folder): - check the store state, can create a shared - folder only in online mode - Fixes bug 74002 - -2005-03-31 Vivek Jain <jvivek@novell.com> - - **Fixes #74002 - * share-folder-common.c : - (get_cnc): return cnc as NULL if evoluiton is in offline. - (create_folder): return -1 if in offline - -2005-03-31 Vivek Jain <jvivek@novell.com> - - **Fixes #73787 (bugzilla innerweb.novell) - * share-folder.c : - (add_right_clicked) - (edit_right_clicked) - (delete_right_clicked) : use path passed in the callback to get the - current iterator - also including some NULL checks - -2005-03-28 Vivek Jain <jvivek@novell.com> - - **Fixes #73198 - * share-folder-common.c : - (org_gnome_shared_folder_factory): - (create_folder__created) : pass the full name in get_conatiner_id - (get_container_id) : break the full name and start looking for the - name from the top most parent. This will give proper container id - even in the case of the duplicate names at different hierarchies - -2005-03-10 Vivek Jain <jvivek@novell.com> - - **Fixes #73201 - * share-folder-common.c : (org_gnome_shared_folder_factory) - use full_name given by CamelFolder to get the selected folder name - -2005-02-24 Björn Torkelsson <torkel@acc.umu.se> - - * org-gnome-shared-folder.eplug.in: Added Groupwise to name. - Fixed description and added author. - Added xml tag. - -2005-02-17 Vivek Jain <jvivek@novell.com> - - * share-folder-common.c : (get_cnc): - - use ssl when "always" and "whenever possible" is enabled - changed "soap_ssl" to "use_ssl" - use the default port "7191" instead of "7181" - -2005-01-24 Vivek Jain <jvivek@novell.com> - *properties.glade : changed the layout of the widgets - *share-folder.[ch]: removed the checkbuttons for display of rights - : removed new_list, update_list and remove_list - added users_list - *share-folder.c : removed function (update_list_update) - (share_folder_construct) : added gtk_cell_renderer_toggle for - displaying rights - added one structure SharedUsers to have a single list instead of three - different lists. Made corresponding changes in all functions. - *share-folder-common.c : (new_folder_response): use - gtk_widget_reparent to pack the widget - added two files - *org-gnome-shared-folder-errors.xml - *org-gnome-shared-folder-errors.xml.h : to display error message - *Makefile.am : included error data - - - -2005-01-19 Vivek Jain <jvivek@novell.com> - *install-shared.c - (org_gnome_popup_wizard): fixed a crash, caused by g_free - (install_folder_response): free the memory - -2005-01-18 Vivek Jain <jvivek@novell.com> - *install-shared.c - (org_gnome_popup_wizard): removed unnecessary stuff for the display of - wizard - -2005-01-18 Parthasarathi Susarla <sparthasarathi@novell.com> - - *install-shared.c - (org_gnome_popup_wizard): displays the message without the - mime headers - -2005-01-17 Vivek Jain <jvivek@novell.com> - *install-shared.c : (org_gnome_popup_wizard): included a condition - (null check) to fix a crash - * shared-folder-common.c :(org_gnome_shared_folder_factory): some - condition checks to avoid the possible crashes - (get_container_id): included code to return top level container id if - folder name is passed as null - -2005-01-13 Vivek Jain <jvivek@novell.com> - * share-folder.c :changed the function find_node to return user node - corresponding to the mail address given. - (add_clicked): added a condition so that user can't share folder to itself. - (user_selected): modified to display proper rights when owner is selected. - * share-folder-common.c : calling share_folder with a cnc in it. - -2005-01-11 Vivek Jain <jvivek@novell.com> - killed compile time warnings by including suitable definitions - and type casting widgets - -2005-01-10 Vivek Jain <jvivek@novell.com> Included - - * install-shared.c : opens up a wizard on reading a shared folder - notification and installs shared folder at the recepient end. - * share-folder-common.c : added - (refresh_folder_tree) : to refresh the folder tree when a folder is shared or - a shared folder is created so that different icons are displayed - (get_cnc): to get a connection - (get_container_id):to get the container id of the folder user selects - * share-folder.c : minor changes to fix the crash - * Makefile.am : including install-shared.c in sources - * org-gnome-shared-folder.eplug.in : added a plugin to the e-plugin list for - the message-read event - -2004-12-15 Vivek Jain <jvivek@novell.com> - - Added (Create a shared folder) functionality in the plugin - * org-gnome-shared-folder.eplug.in : added a plugin in the plugin list - * share-folder-common.c : included functions to create a shared folder - -2004-12-15 Vivek Jain <jvivek@novell.com> - - * shared-folder-common.c : (org_gnome_shared_folder_factory) - * shared-folder.c : some whitespace changes, typecasting widgets, - in (on_add_clicked) removed assigning the rights portion - - 2004-12-08 Vivek Jain <jvivek@novell.com> - - The following files are added as an initial check in for the plugin that - implements shared-folder functionality in the groupwise folders - * share-folder.c - * share-folder.h - * share-folder-common.c - * properties.glade - * Makefile.am - * org-gnome-shared-folder.eplug.in - - - diff --git a/plugins/shared-folder/Makefile.am b/plugins/shared-folder/Makefile.am deleted file mode 100644 index 40a4d3c7f0..0000000000 --- a/plugins/shared-folder/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -INCLUDES = \ - -I$(top_srcdir)\ - -I$(top_srcdir)/camel \ - $(EVOLUTION_MAIL_CFLAGS)\ - $(CAMEL_GROUPWISE_CFLAGS)\ - -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" - -@EVO_PLUGIN_RULE@ - -plugin_DATA = org-gnome-shared-folder.eplug -plugin_LTLIBRARIES = liborg-gnome-shared-folder.la - -liborg_gnome_shared_folder_la_SOURCES = share-folder-common.c share-folder.c install-shared.c share-folder.h -liborg_gnome_shared_folder_la_LIBADD= $(CAMEL_GROUPWISE_LIBS) - - -liborg_gnome_shared_folder_la_LDFLAGS = -module -avoid-version - -glade_DATA =properties.glade - -error_DATA = org-gnome-shared-folder.error -errordir = $(privdatadir)/errors - -BUILT_SOURCES = $(error_DATA) -EXTRA_DIST = \ - org-gnome-shared-folder.error.xml \ - $(glade_DATA) \ - org-gnome-shared-folder.eplug.in diff --git a/plugins/shared-folder/install-shared.c b/plugins/shared-folder/install-shared.c deleted file mode 100644 index d92e926764..0000000000 --- a/plugins/shared-folder/install-shared.c +++ /dev/null @@ -1,221 +0,0 @@ -/* -*- 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 <string.h> -#include <glib.h> -#include <gnome.h> -#include <gtk/gtk.h> -#include <libgnomeui/libgnomeui.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-event.h> -#include <mail/mail-component.h> -#include <camel/camel-mime-message.h> -#include <camel/camel-stream.h> -#include <camel/camel-session.h> -#include <camel/camel-stream-mem.h> -#include <camel/camel-data-wrapper.h> -#include <camel/camel-multipart.h> -#include <mail/em-folder-tree.h> -#include <mail/mail-config.h> -#include <mail/em-folder-selector.h> -#include <camel/camel-medium.h> -#include <e-gw-connection.h> -#include <share-folder.h> - -extern CamelSession *session; -struct AcceptData { - const char *item_id; - EMFolderTreeModel *model; -}; - - -void org_gnome_popup_wizard (EPlugin *ep, EMEventTargetMessage *target); - -static void -install_folder_response (EMFolderSelector *emfs, int response, gpointer *data) -{ - struct AcceptData *accept_data = (struct AcceptData *)data; - EMFolderTreeModel *model; - const char *uri, *path; - int parts = 0; - gchar **names; - gchar *folder_name; - gchar *parent_name; - gchar *container_id,*item_id; - CamelException ex; - CamelStore *store; - EAccount *account; - CamelProvider *provider; - EGwConnection *cnc; - - if (response == GTK_RESPONSE_CANCEL){ - gtk_widget_destroy (GTK_WIDGET (emfs)); - } else { - model = accept_data->model; - item_id = accept_data->item_id; - uri = em_folder_selector_get_selected_uri (emfs); - path = em_folder_selector_get_selected_path (emfs); - names = g_strsplit (path, "/", -1); - if(names == NULL){ - folder_name = (gchar *)path; - parent_name = NULL; - } else { - while (names [parts]) - parts++; - folder_name = names[parts -1]; - if (parts >= 2) - parent_name = names[parts -2]; - else - parent_name = NULL; - } - camel_exception_init (&ex); - if (!(store = (CamelStore *) camel_session_get_service (session, uri, CAMEL_PROVIDER_STORE, &ex))) { - camel_exception_clear (&ex); - return; - } - - cnc = get_cnc (store); - if(E_IS_GW_CONNECTION (cnc)) { - container_id = get_container_id (cnc, parent_name); - - if(e_gw_connection_accept_shared_folder (cnc, folder_name, container_id, item_id, NULL) == E_GW_CONNECTION_STATUS_OK) { - - uri = camel_url_to_string (((CamelService *) store)->url, CAMEL_URL_HIDE_ALL); - account = mail_config_get_account_by_source_url (uri); - uri = account->source->url; - em_folder_tree_model_remove_store (model, store); - camel_exception_init (&ex); - if (!(provider = camel_provider_get(uri, &ex))) { - camel_exception_clear (&ex); - return; - } - - /* make sure the new store belongs in the tree */ - if (!(provider->flags & CAMEL_PROVIDER_IS_STORAGE)) - return; - - em_folder_tree_model_add_store (model, store, account->name); - camel_object_unref (store); - } - } - - g_strfreev(names); - gtk_widget_destroy ((GtkWidget *)emfs); - } - -} - -static void -accept_clicked(GnomeDruidPage *page, GtkWidget *druid, const char *id) -{ - EMFolderTreeModel *model; - EMFolderTree *folder_tree; - GtkWidget *dialog ; - struct AcceptData *accept_data; - char *uri; - accept_data = g_new0(struct AcceptData, 1); - model = mail_component_peek_tree_model (mail_component_peek ()); - folder_tree = (EMFolderTree *) em_folder_tree_new_with_model (model); - dialog = em_folder_selector_create_new (folder_tree, 0, _("Create folder"), _("Specify where to create the folder:")); - uri = em_folder_tree_get_selected_uri(folder_tree); - em_folder_selector_set_selected ((EMFolderSelector *) dialog, uri); - g_free(uri); - accept_data->item_id = id; - accept_data->model = model; - g_signal_connect (dialog, "response", G_CALLBACK (install_folder_response), accept_data); - gtk_window_set_title (GTK_WINDOW (dialog), "Install Shared Folder"); - gtk_widget_destroy (druid); - gtk_widget_show (dialog); - -} - -void -org_gnome_popup_wizard (EPlugin *ep, EMEventTargetMessage *target) -{ - const CamelInternetAddress *from_addr = NULL; - const char *name, *item_id; - const char *email; - GtkWidget *window; - GnomeDruid *wizard; - GnomeDruidPageEdge *title_page; - CamelMimeMessage *msg = (CamelMimeMessage *) target->message ; - CamelStreamMem *content ; - CamelDataWrapper *dw ; - CamelMimePart *mime_part ; - CamelMultipart *mp ; - char *notification; - char *start_message; - char *buffer = NULL; - - if (!msg) - return ; - - mime_part = CAMEL_MIME_PART(msg) ; - notification = (char *)camel_medium_get_header (CAMEL_MEDIUM(msg),"X-notification") ; - if (!notification) { - return ; - - } else { - mp = (CamelMultipart *) camel_medium_get_content_object (CAMEL_MEDIUM (msg)) ; - dw = camel_data_wrapper_new () ; - content = (CamelStreamMem *)camel_stream_mem_new(); - if (!mp) - return ; - - if (CAMEL_IS_MULTIPART (mp)) { - mime_part = camel_multipart_get_part (mp, 0) ; - dw = camel_medium_get_content_object (CAMEL_MEDIUM (mime_part)) ; - camel_data_wrapper_write_to_stream(dw, (CamelStream *)content) ; - buffer = g_malloc0 (content->buffer->len+1) ; - buffer = memcpy (buffer, content->buffer->data, content->buffer->len) ; - - } else { - dw = camel_medium_get_content_object (CAMEL_MEDIUM (msg)) ; - camel_data_wrapper_write_to_stream(dw, (CamelStream *)content) ; - buffer = g_malloc0 (content->buffer->len+1) ; - buffer = memcpy (buffer, content->buffer->data, content->buffer->len) ; - } - - from_addr = camel_mime_message_get_from ((CamelMimeMessage *)target->message); - if (camel_internet_address_get (from_addr,0, &name, &email)) { - start_message = g_strconcat (" The User ", "'", name, "'" ," has shared a folder with you\n\n", " Message from ", "'" , name, "'\n\n\n", buffer, "\n\n\n", "Click 'Forward' to install the shared folder\n\n",NULL); - title_page = GNOME_DRUID_PAGE_EDGE (gnome_druid_page_edge_new_with_vals(GNOME_EDGE_START, TRUE, "Install the shared folder", start_message, NULL, NULL, NULL)); - wizard = GNOME_DRUID (gnome_druid_new_with_window ("Shared Folder Installation", NULL, TRUE, (GtkWidget**)(&window))); - gtk_window_set_position (GTK_WINDOW (window) , GTK_WIN_POS_CENTER_ALWAYS); - gnome_druid_append_page(wizard, GNOME_DRUID_PAGE(title_page)); - gtk_widget_show_all (GTK_WIDGET (title_page)); - item_id = camel_mime_message_get_message_id (msg); - g_signal_connect (title_page, "next", G_CALLBACK(accept_clicked), item_id); - } else - g_warning ("Could not get the sender name"); - - g_free (buffer) ; - g_free (start_message) ; - } -} - diff --git a/plugins/shared-folder/org-gnome-shared-folder.eplug.in b/plugins/shared-folder/org-gnome-shared-folder.eplug.in deleted file mode 100644 index c0eacb96ef..0000000000 --- a/plugins/shared-folder/org-gnome-shared-folder.eplug.in +++ /dev/null @@ -1,49 +0,0 @@ -<?xml version="1.0"?> -<e-plugin-list> - <e-plugin id="org.gnome.evolution.mail_shared_folder" type="shlib" name="Groupwise shared folder" - location="@PLUGINDIR@/liborg-gnome-shared-folder.so"> - <author name="Vivek Jain" email="jvivek@novell.com"/> - <description>A plugin for setting shared folder properties on Groupwise accounts.</description> - <hook class="org.gnome.evolution.mail.config:1.0"> - <group - id="org.gnome.evolution.mail.folderConfig" - target="folder" - check="shared_folder_check" - commit="shared_folder_commit" - abort="shared_folder_abort"> - <item type="page" path="10.shared" label="Shared" factory="org_gnome_shared_folder_factory"/> - </group> - </hook> - </e-plugin> - - <e-plugin id="org.gnome.evolution.mail_view" type="shlib" - name="Groupwise mail view" - location="@PLUGINDIR@/liborg-gnome-shared-folder.so"> - - <description>A plugin for viewing Groupwise mails.</description> - <author name="Vivek Jain" email="jvivek@novell.com"/> - -<hook class="org.gnome.evolution.mail.events:1.0"> -<event - target="message" - id="message.reading" - type="pass" - handle="org_gnome_popup_wizard"/> -</hook> -</e-plugin> - - <e-plugin id="org.gnome.mail.folder.create_option" - type="shlib" domain="evolution" name="Groupwise Create Folders" - location="@PLUGINDIR@/liborg-gnome-shared-folder.so"> - <description>Allows creating Groupwise shared folders in the folder tree context menu</description> - <author name="Vivek Jain" email="jvivek@novell.com"/> - <hook class="org.gnome.evolution.mail.popup:1.0"> - <menu id="org.gnome.evolution.mail.foldertree.popup" target="folder"> - <item type="item" path="20.emc.00" label="_New Shared Folder" - activate="org_gnome_create_option" - enable="delete" visible="delete"/> - </menu> - </hook> - </e-plugin> - -</e-plugin-list> diff --git a/plugins/shared-folder/org-gnome-shared-folder.error.xml b/plugins/shared-folder/org-gnome-shared-folder.error.xml deleted file mode 100644 index 645c17d943..0000000000 --- a/plugins/shared-folder/org-gnome-shared-folder.error.xml +++ /dev/null @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<error-list domain="org.gnome.evolution.mail_shared_folder"> -<error id="invalid-user" type="error"> -<_primary>Invalid user</_primary> -<_secondary>You cannot share folder with specified user "{0}"</_secondary> -</error> - -<error id="no-user" type="error"> -<_primary>Specify User</_primary> -<_secondary>You have to specify a user name whom you want to add to the list</_secondary> -</error> - - -</error-list> - diff --git a/plugins/shared-folder/properties.glade b/plugins/shared-folder/properties.glade deleted file mode 100644 index 03fea277b7..0000000000 --- a/plugins/shared-folder/properties.glade +++ /dev/null @@ -1,860 +0,0 @@ -<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> -<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> - -<glade-interface> -<requires lib="gnome"/> - -<widget class="GtkWindow" id="main_page"> - <property name="title" translatable="yes">Folder Properties</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_NONE</property> - <property name="modal">False</property> - <property name="resizable">True</property> - <property name="destroy_with_parent">False</property> - <property name="decorated">True</property> - <property name="skip_taskbar_hint">False</property> - <property name="skip_pager_hint">False</property> - <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> - <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> - - <child> - <widget class="GtkNotebook" id="sharing_props"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="show_tabs">True</property> - <property name="show_border">True</property> - <property name="tab_pos">GTK_POS_TOP</property> - <property name="scrollable">False</property> - <property name="enable_popup">False</property> - - <child> - <widget class="GtkVBox" id="vboxSharing"> - <property name="border_width">12</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">12</property> - - <child> - <widget class="GtkVBox" id="vboxSharingOptions"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkHBox" id="hbox186"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">12</property> - - <child> - <widget class="GtkLabel" id="label539"> - <property name="visible">True</property> - <property name="label" translatable="yes"></property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vbox190"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkRadioButton" id="radNotShared"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_Not Shared</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkRadioButton" id="radShared"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_Shared With ...</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - <property name="group">radNotShared</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vbox194"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkHBox" id="hbox226"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkVBox" id="vbox195"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkHBox" id="hbox227"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkLabel" id="label557"> - <property name="visible">True</property> - <property name="label" translatable="yes">Name:</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="entry4"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="users"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Users:</b></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">6</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkScrolledWindow" id="scrolledwindow4"> - <property name="width_request">282</property> - <property name="height_request">150</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property> - <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property> - <property name="shadow_type">GTK_SHADOW_NONE</property> - <property name="window_placement">GTK_CORNER_TOP_LEFT</property> - - <child> - <placeholder/> - </child> - </widget> - <packing> - <property name="padding">6</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vbox196"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkButton" id="Address"> - <property name="width_request">96</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - - <child> - <widget class="GtkAlignment" id="alignment6"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">0</property> - <property name="yscale">0</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkHBox" id="hbox232"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">2</property> - - <child> - <widget class="GtkImage" id="image5"> - <property name="visible">True</property> - <property name="stock">gtk-jump-to</property> - <property name="icon_size">4</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label563"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Contacts...</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="Add"> - <property name="width_request">61</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - - <child> - <widget class="GtkAlignment" id="alignment4"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">0</property> - <property name="yscale">0</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkHBox" id="hbox229"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">2</property> - - <child> - <widget class="GtkImage" id="image3"> - <property name="visible">True</property> - <property name="stock">gtk-add</property> - <property name="icon_size">4</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label561"> - <property name="width_request">29</property> - <property name="visible">True</property> - <property name="label" translatable="yes">_Add</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="Remove"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - - <child> - <widget class="GtkAlignment" id="alignment5"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">0</property> - <property name="yscale">0</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkHBox" id="hbox230"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">2</property> - - <child> - <widget class="GtkImage" id="image4"> - <property name="visible">True</property> - <property name="stock">gtk-remove</property> - <property name="icon_size">4</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label562"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Remove</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <placeholder/> - </child> - - <child> - <widget class="GtkButton" id="Notification"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - - <child> - <widget class="GtkAlignment" id="alignment7"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">0</property> - <property name="yscale">0</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkHBox" id="hbox233"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">2</property> - - <child> - <widget class="GtkImage" id="image6"> - <property name="visible">True</property> - <property name="stock">gnome-stock-mail-new</property> - <property name="icon_size">4</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label564"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Customize notification message</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">11</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="tab_expand">False</property> - <property name="tab_fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="lblSharing"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Sharing</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="type">tab</property> - </packing> - </child> - </widget> - </child> -</widget> - -<widget class="GtkWindow" id="window1"> - <property name="visible">True</property> - <property name="title" translatable="yes">Shared Folder Notification</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_CENTER</property> - <property name="modal">False</property> - <property name="resizable">True</property> - <property name="destroy_with_parent">False</property> - <property name="decorated">True</property> - <property name="skip_taskbar_hint">False</property> - <property name="skip_pager_hint">False</property> - <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> - <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> - - <child> - <widget class="GtkVBox" id="vbox191"> - <property name="border_width">12</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">12</property> - - <child> - <widget class="GtkLabel" id="label551"> - <property name="visible">True</property> - <property name="label" translatable="yes">The participants will receive the following notification. -</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.66</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">1</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox223"> - <property name="height_request">309</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">12</property> - - <child> - <widget class="GtkVBox" id="vbox193"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">5</property> - - <child> - <widget class="GtkLabel" id="label553"> - <property name="visible">True</property> - <property name="label" translatable="yes">Subject</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkEntry" id="entry3"> - <property name="width_request">158</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">True</property> - <property name="max_length">0</property> - <property name="text" translatable="yes"></property> - <property name="has_frame">True</property> - <property name="invisible_char" translatable="yes">*</property> - <property name="activates_default">False</property> - </widget> - <packing> - <property name="padding">6</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label554"> - <property name="visible">True</property> - <property name="label" translatable="yes">Message</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkScrolledWindow" id="scrolledwindow3"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property> - <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property> - <property name="shadow_type">GTK_SHADOW_NONE</property> - <property name="window_placement">GTK_CORNER_TOP_LEFT</property> - - <child> - <widget class="GtkTextView" id="textview1"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="overwrite">False</property> - <property name="accepts_tab">True</property> - <property name="justification">GTK_JUSTIFY_LEFT</property> - <property name="wrap_mode">GTK_WRAP_NONE</property> - <property name="cursor_visible">True</property> - <property name="pixels_above_lines">0</property> - <property name="pixels_below_lines">0</property> - <property name="pixels_inside_wrap">0</property> - <property name="left_margin">0</property> - <property name="right_margin">0</property> - <property name="indent">0</property> - <property name="text" translatable="yes"></property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox224"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkLabel" id="label555"> - <property name="width_request">248</property> - <property name="visible">True</property> - <property name="label" translatable="yes"></property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.52</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkHButtonBox" id="hbuttonbox2"> - <property name="visible">True</property> - <property name="layout_style">GTK_BUTTONBOX_END</property> - <property name="spacing">6</property> - - <child> - <widget class="GtkButton" id="nCancel"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-cancel</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_nCancel_clicked" last_modification_time="Tue, 23 Nov 2004 10:56:42 GMT"/> - </widget> - </child> - - <child> - <widget class="GtkButton" id="nOK"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-ok</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_nOK_clicked" last_modification_time="Tue, 23 Nov 2004 10:57:50 GMT"/> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">42</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> -</widget> - -</glade-interface> diff --git a/plugins/shared-folder/share-folder-common.c b/plugins/shared-folder/share-folder-common.c deleted file mode 100644 index 58c58e4b6d..0000000000 --- a/plugins/shared-folder/share-folder-common.c +++ /dev/null @@ -1,514 +0,0 @@ -/* -*- 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 <string.h> -#include <glib.h> -#include <gtk/gtk.h> -#include <libgnome/gnome-i18n.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 <mail/mail-mt.h> -#include <mail/mail-component.h> -#include <mail/mail-config.h> -#include <mail/em-vfolder-rule.h> -#include <filter/filter-rule.h> -#include <camel/camel-store.h> -#include <camel/camel-session.h> -#include <camel/camel-store.h> -#include <camel/camel-offline-store.h> -#include <camel/camel-vee-store.h> -#include <camel/camel-folder.h> -#include <camel/camel-offline-store.h> -#include <e-gw-container.h> -#include <e-gw-connection.h> -#include <glade/glade.h> -#include "e-util/e-error.h" -#include <libgnomeui/libgnomeui.h> -#include "e-util/e-error.h" -#include "share-folder.h" -#define d(x) - -ShareFolder *common = NULL; -extern CamelSession *session; -struct ShareInfo { - GtkWidget *d; - ShareFolder *sf; - EMFolderTreeModel *model; - EMFolderSelector *emfs; -}; - -GtkWidget * org_gnome_shared_folder_factory (EPlugin *ep, EConfigHookItemFactoryData *hook_data); -void org_gnome_create_option(EPlugin *ep, EMPopupTargetFolder *target); -void shared_folder_commit (EPlugin *ep, EConfigTarget *tget); -void shared_folder_abort (EPlugin *ep, EConfigTarget *target); - -static void refresh_folder_tree (EMFolderTreeModel *model, CamelStore *store); - -static void -refresh_folder_tree (EMFolderTreeModel *model, CamelStore *store) -{ - gchar *uri; - EAccount *account; - CamelException ex; - CamelProvider *provider; - - uri = camel_url_to_string (((CamelService *) store)->url, CAMEL_URL_HIDE_ALL); - account = mail_config_get_account_by_source_url (uri); - uri = account->source->url; - em_folder_tree_model_remove_store (model, store); - - camel_exception_init (&ex); - if (!(provider = camel_provider_get(uri, &ex))) { - camel_exception_clear (&ex); - return; - } - if (!(provider->flags & CAMEL_PROVIDER_IS_STORAGE)) - return; - em_folder_tree_model_add_store (model, store, account->name); - //camel_object_unref (store); -} - -void -shared_folder_commit (EPlugin *ep, EConfigTarget *tget) -{ - EMConfigTargetFolder *target = (EMConfigTargetFolder *)tget->config->target; - CamelFolder *folder = target->folder; - CamelStore *store = folder->parent_store; - EMFolderTreeModel *model = mail_component_peek_tree_model (mail_component_peek ()); - if (common) { - share_folder (common); - refresh_folder_tree (model, store); - g_object_run_dispose ((GObject *)common); - common = NULL; - } -} - -void -shared_folder_abort (EPlugin *ep, EConfigTarget *target) -{ - if (common) { - g_object_run_dispose ((GObject *)common); - common = NULL; - } -} - -struct _EMCreateFolder { - struct _mail_msg msg; - - /* input data */ - CamelStore *store; - char *full_name; - char *parent; - char *name; - - /* output data */ - CamelFolderInfo *fi; - - /* callback data */ - void (* done) (struct _EMCreateFolder *m, void *user_data); - void *user_data; -}; - -static char * -create_folder__desc (struct _mail_msg *mm, int done) -{ - struct _EMCreateFolder *m = (struct _EMCreateFolder *) mm; - - return g_strdup_printf (_("Creating folder `%s'"), m->full_name); -} - -static void -create_folder__create (struct _mail_msg *mm) -{ - struct _EMCreateFolder *m = (struct _EMCreateFolder *) mm; - - d(printf ("creating folder parent='%s' name='%s' full_name='%s'\n", m->parent, m->name, m->full_name)); - - if ((m->fi = camel_store_create_folder (m->store, m->parent, m->name, &mm->ex))) { - if (camel_store_supports_subscriptions (m->store)) - camel_store_subscribe_folder (m->store, m->full_name, &mm->ex); - } -} - -static void -create_folder__created (struct _mail_msg *mm) -{ - struct _EMCreateFolder *m = (struct _EMCreateFolder *) mm; - struct ShareInfo *ssi = (struct ShareInfo *) m->user_data; - CamelStore *store = CAMEL_STORE (m->store) ; - EGwConnection *ccnc; - - if (m->done) { - ccnc = get_cnc (store); - if(E_IS_GW_CONNECTION (ccnc)) { - (ssi->sf)->cnc = ccnc; - - (ssi->sf)->container_id = get_container_id ((ssi->sf)->cnc, m->full_name); - share_folder(ssi->sf); - } - - m->done (m, m->user_data); - } -} - -static void -create_folder__free (struct _mail_msg *mm) -{ - struct _EMCreateFolder *m = (struct _EMCreateFolder *) mm; - - camel_store_free_folder_info (m->store, m->fi); - camel_object_unref (m->store); - g_free (m->full_name); - g_free (m->parent); - g_free (m->name); -} - -static struct _mail_msg_op create_folder_op = { - create_folder__desc, - create_folder__create, - create_folder__created, - create_folder__free, -}; - -static void -new_folder_created_cb (struct _EMCreateFolder *m, void *user_data) -{ - struct ShareInfo *ssi = (struct ShareInfo *) user_data; - EMFolderSelector *emfs = ssi->emfs; - if (m->fi){ - refresh_folder_tree (ssi->model, m->store); - gtk_widget_destroy ((GtkWidget *) emfs); - gtk_widget_destroy ((GtkWidget *) ssi->d); - } - - g_object_unref (emfs); -} - -static int -create_folder (CamelStore *store, const char *full_name, void (* done) (struct _EMCreateFolder *m, void *user_data), void *user_data) -{ - char *name, *namebuf = NULL; - struct _EMCreateFolder *m; - const char *parent; - int id; - - - if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) { - //e_error_run (NULL, _("Cannot create GroupWise folders in offline mode."), NULL, NULL); - g_warning (_("Cannot Create shared folder in offline mode.")); - return -1; - } - - if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) { - //e_error_run (NULL, _("Cannot create GroupWise folders in offline mode."), NULL, NULL); - g_warning (_("Cannot Create shared folder in offline mode.")); - return -1; - } - - namebuf = g_strdup (full_name); - if (!(name = strrchr (namebuf, '/'))) { - name = namebuf; - parent = ""; - } else { - *name++ = '\0'; - parent = namebuf; - } - - m = mail_msg_new (&create_folder_op, NULL, sizeof (struct _EMCreateFolder)); - camel_object_ref (store); - m->store = store; - m->full_name = g_strdup (full_name); - m->parent = g_strdup (parent); - m->name = g_strdup (name); - m->user_data = (struct ShareInfo *) user_data; - m->done = done; - g_free (namebuf); - id = m->msg.seq; - e_thread_put (mail_thread_new, (EMsg *) m); - - return id; -} - -static void -users_dialog_response(GtkWidget *dialog, int response, struct ShareInfo *ssi) -{ - struct _EMFolderTreeModelStoreInfo *si; - EMFolderSelector *emfs = ssi->emfs; - const char *uri, *path; - CamelException ex; - CamelStore *store; - - if (response != GTK_RESPONSE_OK) { - gtk_widget_destroy ((GtkWidget *) emfs); - gtk_widget_destroy(dialog); - return; - } - - uri = em_folder_selector_get_selected_uri (emfs); - path = em_folder_selector_get_selected_path (emfs); - - d(printf ("Creating new folder: %s (%s)\n", path, uri)); - - camel_exception_init (&ex); - if (!(store = (CamelStore *) camel_session_get_service (session, uri, CAMEL_PROVIDER_STORE, &ex))) { - camel_exception_clear (&ex); - return; - } - - if (!(si = g_hash_table_lookup ((ssi->model)->store_hash, store))) { - g_assert_not_reached (); - camel_object_unref (store); - return; - } - - if (CAMEL_IS_VEE_STORE(store)) { - EMVFolderRule *rule; - - rule = em_vfolder_rule_new(); - filter_rule_set_name((FilterRule *)rule, path); - vfolder_gui_add_rule(rule); - gtk_widget_destroy((GtkWidget *)emfs); - } else { - g_object_ref (emfs); - ssi->d = dialog; - create_folder (si->store, path, new_folder_created_cb, ssi); - - } - camel_object_unref (store); -} - -static void -new_folder_response (EMFolderSelector *emfs, int response, EMFolderTreeModel *model) -{ - GtkWidget *users_dialog; - GtkWidget *w; - struct ShareInfo *ssi; - const char *uri; - EGwConnection *cnc; - CamelException ex; - CamelStore *store; - - ssi = g_new0(struct ShareInfo, 1); - if (response != GTK_RESPONSE_OK) { - gtk_widget_destroy ((GtkWidget *) emfs); - return; - } - - /* i want store at this point to get cnc not sure proper or not*/ - uri = em_folder_selector_get_selected_uri (emfs); - camel_exception_init (&ex); - if (!(store = (CamelStore *) camel_session_get_service (session, uri, CAMEL_PROVIDER_STORE, &ex))) { - camel_exception_clear (&ex); - return; - } - - cnc = get_cnc (store); - users_dialog = gtk_dialog_new_with_buttons ( - _("Users"), NULL, GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); - w = gtk_label_new_with_mnemonic (_("Enter the users and set permissions")); - gtk_widget_show(w); - gtk_box_pack_start(GTK_BOX (GTK_DIALOG (users_dialog)->vbox), (GtkWidget *) w, TRUE, TRUE, 6); - ssi->sf = share_folder_new (cnc, NULL); - gtk_widget_set_sensitive (GTK_WIDGET ((ssi->sf)->table), TRUE); - ssi->model = model; - ssi->emfs = emfs; - gtk_widget_reparent (GTK_WIDGET ((ssi->sf)->table), GTK_DIALOG (users_dialog)->vbox); - gtk_widget_hide((GtkWidget*) emfs); - gtk_window_resize (GTK_WINDOW (users_dialog), 350, 300); - gtk_widget_show(users_dialog); - g_signal_connect (users_dialog, "response", G_CALLBACK (users_dialog_response), ssi); - - camel_object_unref (store); - return ; - -} - -void -org_gnome_create_option(EPlugin *ep, EMPopupTargetFolder *target) -{ - - EMFolderTreeModel *model; - EMFolderTree *folder_tree; - GtkWidget *dialog ; - char *uri; - - model = mail_component_peek_tree_model (mail_component_peek ()); - folder_tree = (EMFolderTree *) em_folder_tree_new_with_model (model); - dialog = em_folder_selector_create_new (folder_tree, 0, _("Create folder"), _("Specify where to create the folder:")); - uri = em_folder_tree_get_selected_uri(folder_tree); - em_folder_selector_set_selected ((EMFolderSelector *) dialog, uri); - g_free(uri); - g_signal_connect (dialog, "response", G_CALLBACK (new_folder_response), model); - gtk_window_set_title (GTK_WINDOW (dialog), "New Shared Folder" ); - gtk_widget_show(dialog); - -} - -GtkWidget * -org_gnome_shared_folder_factory (EPlugin *ep, EConfigHookItemFactoryData *hook_data) -{ - - gchar *folderuri = NULL; - gchar *account = NULL; - gchar *id = NULL; - gchar *sub = NULL; - gchar *folder_name = NULL; - EGwConnection *cnc; - ShareFolder *sharing_tab; - EMConfigTargetFolder *target= (EMConfigTargetFolder *)hook_data->config->target; - CamelFolder *folder = target->folder; - - folder_name = g_strdup (folder->full_name); - folderuri = g_strdup(target->uri); - if (folderuri && folder_name) - account = g_strrstr(folderuri, "groupwise"); - else - return NULL; - - sub = g_strrstr (folder_name, "/"); - if (sub) - sub++; - else - sub = folder_name; - - /* This is kind of bad..but we don't have types for all these folders.*/ - - if ( !( strcmp (sub, "Mailbox") && strcmp (sub, "Calendar") && strcmp (sub, "Contacts") && strcmp (sub, "Documents") && strcmp (sub, "Authored") && strcmp (sub, "Default Library") && strcmp (sub, "Work In Progress") && strcmp (sub, "Cabinet") && strcmp (sub, "Sent Items") && strcmp (sub, "Trash") && strcmp (sub, "Checklist"))) { - g_free (folderuri); - return NULL; - } - - if (account) { - CamelStore *store = folder->parent_store; - cnc = get_cnc (store); - - if (E_IS_GW_CONNECTION (cnc)) - id = get_container_id (cnc, folder_name); - else - g_warning("Could not Connnect\n"); - - if (cnc && id) - sharing_tab = share_folder_new (cnc, id); - else - return NULL; - - gtk_notebook_append_page((GtkNotebook *) hook_data->parent, (GtkWidget *) sharing_tab->vbox, gtk_label_new_with_mnemonic N_("Sharing")); - common = sharing_tab; - g_free (folderuri); - return GTK_WIDGET (sharing_tab); - } else - return NULL; -} - -EGwConnection * -get_cnc (CamelStore *store) -{ - EGwConnection *cnc; - const char *uri, *property_value, *server_name, *user, *port; - char *use_ssl; - CamelService *service; - CamelURL *url; - - if (!store) - return NULL; - - if (((CamelOfflineStore *) store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) - return NULL; - - service = CAMEL_SERVICE(store); - url = service->url; - server_name = g_strdup (url->host); - user = g_strdup (url->user); - property_value = camel_url_get_param (url, "soap_port"); - use_ssl = g_strdup (camel_url_get_param (url, "use_ssl")); - if(property_value == NULL) - port = g_strdup ("7191"); - else if (strlen(property_value) == 0) - port = g_strdup ("7191"); - else - port = g_strdup (property_value); - - if (use_ssl && !g_str_equal (use_ssl, "never")) - uri = g_strconcat ("https://", server_name, ":", port, "/soap", NULL); - else - uri = g_strconcat ("http://", server_name, ":", port, "/soap", NULL); - - cnc = e_gw_connection_new (uri, user, service->url->passwd); - if (!E_IS_GW_CONNECTION(cnc) && use_ssl && g_str_equal (use_ssl, "when-possible")) { - char *http_uri = g_strconcat ("http://", uri + 8, NULL); - cnc = e_gw_connection_new (http_uri, user, service->url->passwd); - g_free (http_uri); - } - g_free (use_ssl); - use_ssl = NULL; - - return cnc; - -} - -gchar * -get_container_id(EGwConnection *cnc, gchar *fname) -{ - GList *container_list = NULL; - gchar *id = NULL; - gchar *name; - gchar **names; - int i = 0, parts = 0; - - names = g_strsplit (fname, "/", -1); - if(names){ - while (names [parts]) - parts++; - fname = names[i]; - } - - /* get list of containers */ - if (e_gw_connection_get_container_list (cnc, "folders", &(container_list)) == E_GW_CONNECTION_STATUS_OK) { - GList *container = NULL; - - for (container = container_list; container != NULL; container = container->next) { - name = g_strdup (e_gw_container_get_name (container->data)); - /* if Null is passed as name then we return top lavel id*/ - if (fname == NULL) { - id = g_strdup (e_gw_container_get_id (container->data)); - break; - } else if (!strcmp (name, fname)) { - if (i == parts - 1) { - id = g_strdup (e_gw_container_get_id (container->data)); - break; - } else - fname = names[++i]; - } - g_free (name); - } - e_gw_connection_free_container_list (container_list); - if (names) - g_strfreev(names); - } - return id; -} diff --git a/plugins/shared-folder/share-folder.c b/plugins/shared-folder/share-folder.c deleted file mode 100644 index f6618a0745..0000000000 --- a/plugins/shared-folder/share-folder.c +++ /dev/null @@ -1,769 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author: 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 <glade/glade.h> -#include "share-folder.h" -#include <glib/gmain.h> -#include <gtk/gtktreemodel.h> -#include <gtk/gtkliststore.h> -#include <gtk/gtktreeselection.h> -#include <gtk/gtktreeview.h> -#include <gtk/gtkdialog.h> -#include <gtk/gtkbutton.h> -#include <gtk/gtk.h> -#include <gtk/gtktogglebutton.h> -#include <gtk/gtkcellrenderertoggle.h> -#include <gtk/gtkcellrenderertext.h> -#include <libedataserverui/e-contact-store.h> -#include <libgnomeui/gnome-ui-init.h> -#include <libgnome/gnome-init.h> -#include <e-util/e-error.h> -#include <e-gw-container.h> -#include <e-gw-connection.h> -#define ROOTNODE "vboxSharing" -#define NROOTNODE "vbox191" -#define d(x) - -struct _SharedUser { - EShUsers *user_node; - int flag; -}; -typedef struct _SharedUser SharedUser; - -static void share_folder_class_init (ShareFolderClass *class); -static void share_folder_init (ShareFolder *sf); -static void share_folder_destroy (GtkObject *obj); -static void share_folder_finalise (GObject *obj); -static void free_user_node(EShUsers *user); -static void free_node(SharedUser *user); -static void free_all(ShareFolder *sf); -static SharedUser * find_node(GList *list, gchar *email); -static void free_all(ShareFolder *sf); -static void get_container_list (ShareFolder *sf); -static void user_selected(GtkTreeSelection *selection, ShareFolder *sf); -static void not_shared_clicked (GtkRadioButton *button, ShareFolder *sf); -static void shared_clicked (GtkRadioButton *button, ShareFolder *sf); -static void add_clicked(GtkButton *button, ShareFolder *sf); -static void remove_clicked(GtkButton *button, ShareFolder *sf); -static void not_ok_clicked(GtkButton *button, ShareFolder *sf); -static void not_cancel_clicked(GtkButton *button, GtkWidget *window); -static void not_cancel_clicked(GtkButton *button, GtkWidget *window); -static void share_folder_construct (ShareFolder *sf); -GType share_folder_get_type (void); - -static GtkVBoxClass *parent_class = NULL; - -GType -share_folder_get_type (void) -{ - static GType type = 0; - - if (!type) { - static const GTypeInfo info = { - sizeof (ShareFolderClass), - NULL, NULL, - (GClassInitFunc) share_folder_class_init, - NULL, NULL, - sizeof (ShareFolder), - 0, - (GInstanceInitFunc) share_folder_init - }; - - type = g_type_register_static (gtk_vbox_get_type (), "ShareFolder", &info, 0); - } - - return type; -} - -static void -share_folder_class_init (ShareFolderClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass); - - parent_class = g_type_class_ref (gtk_vbox_get_type ()); - object_class->destroy = share_folder_destroy; - gobject_class->finalize = share_folder_finalise; -} - -static void -share_folder_finalise (GObject *obj) -{ - ShareFolder *sf = (ShareFolder *) obj; - g_object_unref (sf->xml); - free_all(sf); - G_OBJECT_CLASS (parent_class)->finalize (obj); -} - -static void -share_folder_destroy (GtkObject *obj) -{ - - ShareFolder *sf = (ShareFolder *) obj; - free_all (sf); - GTK_OBJECT_CLASS (parent_class)->destroy (obj); -} - -static void -share_folder_init (ShareFolder *sf) -{ - sf->gcontainer = NULL; - sf->users = 0; - sf->flag_for_ok = 0; - sf->shared = FALSE; - sf->container_list = NULL; - sf->users_list = NULL; - sf->sub = "Shared Folder notification"; - sf->message = NULL; -} - -static void -free_user_node(EShUsers *user) -{ - if(user){ - g_free(user->email); - user->email = NULL; - } - return ; -} - -static void -free_node(SharedUser *usr) -{ - EShUsers *user = usr->user_node; - if(user){ - g_free(user->email); - user->email = NULL; - } - return ; -} - -static SharedUser * -find_node(GList *list, gchar *email) -{ - SharedUser *user = NULL; - EShUsers *usr = NULL; - GList *tmp; - gint i ; - - if(list){ - tmp = g_list_first(list); - for(i=0; tmp ; i++) - { - user = tmp->data; - usr = user->user_node; - if(!g_ascii_strcasecmp(usr->email, email)){ - return user; /*if found, it returns that user*/ - } - tmp= g_list_next(tmp); - } - } - return NULL; -} - -static void -free_all (ShareFolder *sf) -{ - if (sf->users_list){ - g_list_foreach (sf->users_list,(GFunc) free_node, NULL); - g_list_free (sf->users_list); - sf->users_list = NULL; - } - - e_gw_connection_free_container_list (sf->container_list); -} - - -static void -display_container (EGwContainer *container , ShareFolder *sf) -{ - gchar **tail; - gchar *id_shared; - gchar *id_unshared; - gboolean byme = FALSE; - gboolean tome = FALSE; - gchar *email = NULL; - gchar *msg; - GList *user_list = NULL; - EShUsers *user = NULL; - - id_shared = g_strdup(e_gw_container_get_id(container)); - /* this has to be done since id changes after the folder is shared*/ - if( g_str_has_suffix (id_shared, "35")){ - tail = g_strsplit(id_shared, "@", 2); - id_unshared = g_strconcat(tail[0], "@", "13", NULL); - g_strfreev(tail); - } - - if((!g_ascii_strcasecmp(id_unshared, sf->container_id)) || (!g_ascii_strcasecmp(id_shared, sf->container_id)) ){ - sf->gcontainer = container; - byme = e_gw_container_get_is_shared_by_me(container); - tome = e_gw_container_get_is_shared_to_me(container); - if(byme || tome) { - e_gw_container_get_user_list (sf->gcontainer, &user_list); - sf->users = g_list_length (user_list); - if(sf->users != 0) { - sf->is_shared = TRUE; - gtk_toggle_button_set_active((GtkToggleButton *) sf->shared, TRUE); - shared_clicked(sf->shared , sf); - if (tome) { - gtk_widget_set_sensitive (GTK_WIDGET (sf->not_shared), FALSE); - gtk_widget_set_sensitive (GTK_WIDGET (sf->add_button), FALSE); - gtk_widget_set_sensitive (GTK_WIDGET (sf->remove), FALSE); - gtk_widget_set_sensitive (GTK_WIDGET (sf->add_book), FALSE); - gtk_widget_set_sensitive (GTK_WIDGET (sf->notification), FALSE); - gtk_widget_set_sensitive (GTK_WIDGET (sf->user_list), FALSE); - email = g_strdup (e_gw_container_get_owner (sf->gcontainer)); - msg = g_strconcat (email, " (Owner)", NULL); - gtk_list_store_append (GTK_LIST_STORE (sf->model), &(sf->iter)); - gtk_list_store_set (GTK_LIST_STORE (sf->model), &(sf->iter), 0, msg, -1); - g_free (msg); - g_free (email); - - } else - gtk_widget_set_sensitive (GTK_WIDGET (sf->table), TRUE); -/* I populate the list and set flags to 0 for the existing users*/ - while (user_list) { - SharedUser *shared_user = g_new0 (SharedUser , 1); - gboolean add, edit, delete; - add = edit = delete = FALSE; - user = user_list->data; - shared_user->user_node = user; - shared_user->flag = 0; - email = g_strdup (user->email); - if (user->rights & 0x1) - add = TRUE; - if (user->rights & 0x2) - edit = TRUE; - if (user->rights & 0x4) - delete = TRUE; - - msg = g_strdup_printf ("%s", email); - gtk_list_store_append (GTK_LIST_STORE (sf->model), &(sf->iter)); - gtk_list_store_set (GTK_LIST_STORE (sf->model), &(sf->iter), 0, msg, 1, add, 2, edit, 3, delete, -1); - sf->users_list = g_list_append (sf->users_list, shared_user); - g_free (msg); - g_free (email); - msg = NULL; - email = NULL; - user_list = user_list->next; - } - /* i also need to display status*/ - } else { - - gtk_toggle_button_set_active ((GtkToggleButton *) sf->not_shared, TRUE); - not_shared_clicked (sf->not_shared , sf); - } - } - } -} - -static void -get_container_list (ShareFolder *sf) -{ - sf->container_list = NULL; - if (E_IS_GW_CONNECTION (sf->cnc)) { - /* get list of containers */ - if (e_gw_connection_get_container_list (sf->cnc, "folders", &(sf->container_list)) == E_GW_CONNECTION_STATUS_OK) { - GList *container = NULL; - - for (container = sf->container_list; container != NULL; container = container->next) - display_container (E_GW_CONTAINER (container->data), sf); - - } - else - g_warning("Could not get the Container List"); - } -} - - -static void -shared_clicked (GtkRadioButton *button, ShareFolder *sf) -{ - - gtk_widget_set_sensitive (GTK_WIDGET (sf->table) ,TRUE); - sf->flag_for_ok = 0; -} - -static void -not_shared_clicked (GtkRadioButton *button, ShareFolder *sf) -{ - if (!sf->is_shared) { - sf->flag_for_ok = 0; - } else { - sf->flag_for_ok = 2; - } - gtk_widget_set_sensitive (GTK_WIDGET (sf->table), FALSE); - -} - -static void -add_clicked(GtkButton *button, ShareFolder *sf) -{ - const char *email = NULL; - const char *self_email = NULL; - SharedUser *new_user = NULL; - EShUsers *usr = NULL; - gint rights = 0; - gchar *msg = NULL; - EDestinationStore *destination_store; - GList *destinations, *tmp; - ENameSelectorEntry *name_selector_entry; - - name_selector_entry = e_name_selector_peek_section_entry (sf->name_selector, "Add User"); - destination_store = e_name_selector_entry_peek_destination_store (E_NAME_SELECTOR_ENTRY ( - name_selector_entry)); - destinations = e_destination_store_list_destinations (destination_store); - tmp = destinations; - self_email = g_strdup (e_gw_connection_get_user_email (sf->cnc)); - for (; tmp != NULL; tmp = g_list_next (tmp)) { - email = e_destination_get_email (tmp->data); - /* You can't share a folder with yourself*/ - if (g_strrstr (email, "@") == NULL || (!g_ascii_strcasecmp (email , self_email))) - e_error_run (NULL, "org.gnome.evolution.mail_shared_folder:invalid-user",email ,NULL); - else { - if (!g_ascii_strcasecmp (email, "" )) { - e_error_run (NULL, "org.gnome.evolution.mail_shared_folder:no-user",NULL); - - return ; - } - - - /*check whether already exists*/ - if (sf->users_list && email){ - new_user = find_node (sf->users_list, (gchar *)email); - if (new_user) - return ; - - } - usr = g_new0 (EShUsers, 1); - new_user = g_new0 (SharedUser, 1); - usr->email = g_strdup(email); - usr->rights = rights; - new_user->user_node = usr; - new_user->flag = 1; - msg = g_strdup (email); - gtk_list_store_append (GTK_LIST_STORE (sf->model), &(sf->iter)); - - /* have to add code for rights*/ - gtk_list_store_set (GTK_LIST_STORE (sf->model), &(sf->iter), 0, msg, -1); - g_free(msg); - sf->users_list = g_list_append (sf->users_list, new_user); - sf->flag_for_ok = 0; - } - } - gtk_entry_set_text (GTK_ENTRY(name_selector_entry), ""); - -} - -static void -remove_clicked(GtkButton *button, ShareFolder *sf) -{ - - SharedUser *usr = NULL; - gchar *email; - - gtk_tree_model_get ((GtkTreeModel *) sf->model, &(sf->iter), 0, &email, -1); - usr = find_node (sf->users_list, email); - if (usr->flag & 0x1) { - sf->users_list = g_list_remove (sf->users_list, usr); - free_node(usr); - } else { - usr->flag = 0; - usr->flag |= 0x4; - } - g_free (email); - gtk_list_store_remove (GTK_LIST_STORE (sf->model), &(sf->iter)); - sf->flag_for_ok = 1; -} - -void -share_folder (ShareFolder *sf) -{ - - GList *new_list = NULL; - GList *update_list = NULL; - GList *remove_list = NULL; - GList *node = NULL; - SharedUser *user = NULL; - - for (node = sf->users_list; node; node = node->next) - { - user = node->data; - if (user->flag & 0x1) - new_list = g_list_append (new_list, user->user_node); - else if (user->flag & 0x2) - update_list = g_list_append (update_list, user->user_node); - else if (user->flag & 0x4) { - remove_list = g_list_append (remove_list, user->user_node); - } - } - - if (E_IS_GW_CONNECTION (sf->cnc)) { - if(sf->flag_for_ok == 2){ /* you have to remove all the users*/ - GList *list = NULL; - - if(new_list){ - g_list_foreach (new_list, (GFunc) free_user_node, NULL); - g_list_free (new_list); - } - if(update_list){ - g_list_foreach (update_list, (GFunc) free_user_node, NULL); - g_list_free (update_list); - } - - new_list = NULL; - if(remove_list){ - g_list_foreach (remove_list,(GFunc) free_user_node, NULL); - g_list_free (remove_list); - } - remove_list = NULL; - if (sf->gcontainer) { - e_gw_container_get_user_list (sf->gcontainer, &list); - remove_list = g_list_copy (list); - - } else { - g_warning("Container is Null"); - } - - - } else { - if (new_list) { - if (e_gw_connection_share_folder (sf->cnc, sf->container_id, new_list, sf->sub, sf->mesg, 0) == E_GW_CONNECTION_STATUS_OK); - } - - if (update_list) { - sf->sub = "Shared Folder rights updated"; - - if (e_gw_connection_share_folder (sf->cnc, sf->container_id, update_list, sf->sub, sf->mesg, 2) == E_GW_CONNECTION_STATUS_OK); - } - } - if (remove_list) { - sf->sub = "Shared Folder removed"; - if (e_gw_connection_share_folder (sf->cnc, sf->container_id, remove_list, sf->sub, sf->mesg, 1) == E_GW_CONNECTION_STATUS_OK); - } - - } -} - -static void -not_ok_clicked(GtkButton *button, ShareFolder *sf) -{ - - gchar *subj = NULL; - gchar *msg = NULL; - GtkTextIter *start, *end; - GtkTextBuffer *buffer; - - buffer = gtk_text_buffer_new (NULL); - start = g_new0 (GtkTextIter, 1); - end = g_new0 (GtkTextIter, 1); - subj = g_strdup (gtk_entry_get_text (sf->subject)); - if (subj) - sf->sub = subj; - buffer = gtk_text_view_get_buffer (sf->message); - gtk_text_buffer_get_start_iter (buffer, start); - gtk_text_buffer_get_end_iter (buffer, end); - msg = gtk_text_buffer_get_text (buffer, start, end, FALSE); - if (msg) - sf->mesg = msg; - gtk_widget_destroy (GTK_WIDGET (sf->window)); - -} - -static void -not_cancel_clicked(GtkButton *button, GtkWidget *window) -{ - gtk_widget_destroy(window); -} - - -static void -notification_clicked(GtkButton *button, ShareFolder *sf) -{ - static GladeXML *xmln; - GtkButton *not_ok; - GtkButton *not_cancel; - GtkWidget *vbox; - - sf->window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - xmln = glade_xml_new (EVOLUTION_GLADEDIR "/properties.glade", NROOTNODE , NULL); - vbox = GTK_WIDGET (glade_xml_get_widget (xmln, "vbox191")); - gtk_container_add (GTK_CONTAINER (sf->window), vbox); - sf->subject = GTK_ENTRY (glade_xml_get_widget (xmln, "entry3")); - gtk_entry_set_text(GTK_ENTRY (sf->subject) , sf->sub); - sf->message = GTK_TEXT_VIEW (glade_xml_get_widget (xmln, "textview1")); - not_ok = GTK_BUTTON (glade_xml_get_widget (xmln, "nOK")); - g_signal_connect ((gpointer) not_ok, "clicked", G_CALLBACK (not_ok_clicked), sf); - not_cancel = GTK_BUTTON (glade_xml_get_widget (xmln, "nCancel")); - g_signal_connect ((gpointer) not_cancel, "clicked", G_CALLBACK (not_cancel_clicked), sf->window); - gtk_window_set_title (GTK_WINDOW (sf->window), "Custom Notification"); - gtk_window_set_position (GTK_WINDOW (sf->window) , GTK_WIN_POS_CENTER_ALWAYS); - gtk_window_set_default_size (GTK_WINDOW (sf->window), 100, 200); - gtk_widget_show_all (sf->window); -} - -static void -addressbook_dialog_response (ENameSelectorDialog *name_selector_dialog, gint response, gpointer user_data) -{ - gtk_widget_hide (GTK_WIDGET (name_selector_dialog)); -} - -static void -addressbook_entry_changed (GtkWidget *entry, gpointer user_data) -{ - -} - -static void -address_button_clicked_cb (GtkButton *button, gpointer data) -{ - ShareFolder *sf = data; - ENameSelectorDialog *name_selector_dialog; - - name_selector_dialog = e_name_selector_peek_dialog (sf->name_selector); - gtk_widget_show (GTK_WIDGET (name_selector_dialog)); -} - - static void -user_selected(GtkTreeSelection *selection, ShareFolder *sf) -{ - - gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE); - if (gtk_tree_selection_get_selected (selection, &(sf->model), &(sf->iter))){ - gtk_widget_set_sensitive (GTK_WIDGET (sf->remove), TRUE); - - } -} - - -static void -add_right_clicked (GtkCellRenderer *renderer, gchar *arg1, ShareFolder *sf ) -{ - gboolean right = FALSE; - SharedUser *usr = NULL; - EShUsers *user = NULL; - char *email = NULL; - GtkTreePath *path = NULL; - - path = gtk_tree_path_new_from_string (arg1); - if (!gtk_tree_model_get_iter ((GtkTreeModel *) sf->model, &(sf->iter), path)){ - gtk_tree_path_free (path); - return ; - } - gtk_tree_model_get ((GtkTreeModel *) sf->model, &(sf->iter), 0, &email, 1, &right , -1); - usr = find_node(sf->users_list, email); - if (!usr) { - gtk_tree_path_free (path); - return; - } - if(! usr->flag) /* if user was already existing one change the flag to update*/ - usr->flag = usr->flag | 0x2; - user = usr->user_node; - if (!right) { - user->rights |= 0x1; - gtk_list_store_set (GTK_LIST_STORE (sf->model), &(sf->iter), 1, TRUE, -1); - } else { - user->rights &= 0x6; - gtk_list_store_set (GTK_LIST_STORE (sf->model), &(sf->iter), 1, FALSE, -1); - } - gtk_tree_path_free (path); -} - - static void -edit_right_clicked(GtkCellRenderer *renderer, gchar *arg1, ShareFolder *sf ) -{ - gboolean right = FALSE; - SharedUser *usr = NULL; - EShUsers *user = NULL; - char *email = NULL; - GtkTreePath *path = NULL; - - path = gtk_tree_path_new_from_string (arg1); - if (!gtk_tree_model_get_iter ((GtkTreeModel *) sf->model, &(sf->iter), path)) { - gtk_tree_path_free (path); - return; - } - gtk_tree_model_get ((GtkTreeModel *) sf->model, &(sf->iter), 0, &email, 2, &right , -1); - usr = find_node(sf->users_list, email); - if (!usr) { - gtk_tree_path_free (path); - return; - } - if(! usr->flag) /* if user was already existing one change the flag to update*/ - usr->flag = usr->flag | 0x2; - user = usr->user_node; - - if (!right) { - user->rights |= 0x2; - gtk_list_store_set (GTK_LIST_STORE (sf->model), &(sf->iter), 2, TRUE, -1); - } else { - user->rights &= 0x5; - gtk_list_store_set (GTK_LIST_STORE (sf->model), &(sf->iter), 2, FALSE, -1); - } - gtk_tree_path_free (path); -} - - static void -delete_right_clicked(GtkCellRenderer *renderer, gchar *arg1, ShareFolder *sf ) -{ - gboolean right = FALSE; - SharedUser *usr = NULL; - EShUsers *user = NULL; - char *email = NULL; - GtkTreePath *path = NULL; - - path = gtk_tree_path_new_from_string (arg1); - if (!gtk_tree_model_get_iter ((GtkTreeModel *) sf->model, &(sf->iter), path)) { - gtk_tree_path_free (path); - return; - } - gtk_tree_model_get ((GtkTreeModel *) sf->model, &(sf->iter), 0, &email, 3, &right , -1); - usr = find_node(sf->users_list, email); - if (!usr) { - gtk_tree_path_free (path); - return; - } - if(! usr->flag) /* if user was already existing one change the flag to update*/ - usr->flag = usr->flag | 0x2; - user = usr->user_node; - if (!right) { - user->rights |= 0x4; - gtk_list_store_set (GTK_LIST_STORE (sf->model), &(sf->iter), 3, TRUE, -1); - } else { - user->rights &= 0x3; - gtk_list_store_set (GTK_LIST_STORE (sf->model), &(sf->iter), 3, FALSE, -1); - } - gtk_tree_path_free (path); -} - -static void -share_folder_construct (ShareFolder *sf) -{ - GladeXML *xml; - ENameSelectorDialog *name_selector_dialog; - ENameSelectorModel *name_selector_model; - ENameSelectorEntry *name_selector_entry; - GtkWidget *box; - - xml = glade_xml_new (EVOLUTION_GLADEDIR "/properties.glade", ROOTNODE, NULL); - sf->xml =xml; - - if (!sf->xml) { - g_warning ("could not get xml"); - } - sf->vbox = GTK_VBOX (glade_xml_get_widget(sf->xml, "vboxSharing")); - sf->table = GTK_WIDGET (glade_xml_get_widget (sf->xml, "vbox194")); - gtk_widget_set_sensitive (GTK_WIDGET (sf->table), FALSE); - - sf->shared = GTK_RADIO_BUTTON (glade_xml_get_widget (sf->xml, "radShared")); - g_signal_connect ((gpointer) sf->shared, "clicked", G_CALLBACK (shared_clicked), sf); - - sf->not_shared = GTK_RADIO_BUTTON (glade_xml_get_widget (sf->xml, "radNotShared")); - g_signal_connect ((gpointer) sf->not_shared, "clicked", G_CALLBACK (not_shared_clicked), sf); - - sf->add_book = GTK_BUTTON (glade_xml_get_widget (sf->xml, "Address")); - gtk_widget_set_sensitive (GTK_WIDGET (sf->add_book), TRUE); - g_signal_connect((GtkWidget *) sf->add_book, "clicked", G_CALLBACK (address_button_clicked_cb), sf); - - sf->name_selector = e_name_selector_new (); - name_selector_dialog = e_name_selector_peek_dialog (sf->name_selector); - g_signal_connect (name_selector_dialog, "response", - G_CALLBACK (addressbook_dialog_response), sf); - - name_selector_model = e_name_selector_peek_model (sf->name_selector); - e_name_selector_model_add_section (name_selector_model, "Add User", "Add User", NULL); - - name_selector_entry = e_name_selector_peek_section_entry (sf->name_selector, "Add User"); - g_signal_connect (name_selector_entry, "changed", - G_CALLBACK (addressbook_entry_changed), sf); - - sf->add_button = GTK_BUTTON (glade_xml_get_widget(sf->xml, "Add")); - g_signal_connect((GtkWidget *) sf->add_button, "clicked", G_CALLBACK (add_clicked), sf); - - sf->remove = GTK_BUTTON(glade_xml_get_widget(sf->xml, "Remove")); - g_signal_connect ((GtkWidget *) sf->remove, "clicked", G_CALLBACK (remove_clicked), sf); - gtk_widget_set_sensitive(GTK_WIDGET (sf->remove), FALSE); - - sf->notification = GTK_BUTTON (glade_xml_get_widget (sf->xml, "Notification")); - g_signal_connect((GtkWidget *) sf->notification, "clicked", G_CALLBACK (notification_clicked), sf); - - sf->name = GTK_ENTRY (glade_xml_get_widget (sf->xml, "entry4")); - /*TODO:connect name and label*/ - gtk_widget_hide (GTK_WIDGET(sf->name)); - box = GTK_WIDGET (glade_xml_get_widget (sf->xml, "hbox227")); - gtk_box_pack_start (GTK_BOX (box), (GtkWidget *) name_selector_entry, TRUE, TRUE, 0); - gtk_widget_show ((GtkWidget *) name_selector_entry); - - sf->scrolled_window = GTK_WIDGET (glade_xml_get_widget (sf->xml,"scrolledwindow4")); - - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sf->scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - - sf->model = gtk_list_store_new (4, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN); - sf->user_list = gtk_tree_view_new (); - gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (sf->scrolled_window), (GtkWidget *)sf->user_list); - gtk_tree_view_set_model (GTK_TREE_VIEW (sf->user_list), GTK_TREE_MODEL (sf->model)); - gtk_widget_show (GTK_WIDGET (sf->user_list)); - - sf->cell = gtk_cell_renderer_text_new (); - sf->column = gtk_tree_view_column_new_with_attributes ("Users", sf->cell, "text", 0, NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW (sf->user_list), - GTK_TREE_VIEW_COLUMN (sf->column)); - - sf->cell = gtk_cell_renderer_toggle_new (); - sf->column = gtk_tree_view_column_new_with_attributes ("Add ", sf->cell, "active" , 1, NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW (sf->user_list), - GTK_TREE_VIEW_COLUMN (sf->column)); - g_signal_connect (sf->cell, "toggled", G_CALLBACK (add_right_clicked), sf); - - sf->cell = gtk_cell_renderer_toggle_new (); - sf->column = gtk_tree_view_column_new_with_attributes ("Modify", sf->cell, "active", 2, NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW (sf->user_list), - GTK_TREE_VIEW_COLUMN (sf->column)); - g_signal_connect (sf->cell, "toggled", G_CALLBACK (edit_right_clicked), sf); - - sf->cell = gtk_cell_renderer_toggle_new (); - sf->column = gtk_tree_view_column_new_with_attributes ("Delete", sf->cell, "active", 3, NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW (sf->user_list), - GTK_TREE_VIEW_COLUMN (sf->column)); - g_signal_connect (sf->cell, "toggled", G_CALLBACK (delete_right_clicked), sf); - - g_signal_connect(gtk_tree_view_get_selection(GTK_TREE_VIEW (sf->user_list)), "changed", G_CALLBACK (user_selected), sf); -} - -ShareFolder * -share_folder_new (EGwConnection *ccnc, gchar *id) -{ - ShareFolder *new; - new = (ShareFolder *) g_object_new (share_folder_get_type (), NULL); - share_folder_construct (new); - new->cnc = ccnc; - new->container_id = id; - if (ccnc && id) - get_container_list(new); - - return (ShareFolder *) new; -} - - diff --git a/plugins/shared-folder/share-folder.h b/plugins/shared-folder/share-folder.h deleted file mode 100644 index ac34ada29c..0000000000 --- a/plugins/shared-folder/share-folder.h +++ /dev/null @@ -1,120 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: Vivek Jain <jvivek@novell.com> - * - * Copyright 2002-2003 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * 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. - * - */ - -#ifndef __SHARE_FOLDER_H__ -#define __SHARE_FOLDER_H__ - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus */ - -#include <glib.h> -#include <gtk/gtkvbox.h> -#include <gtk/gtk.h> -#include <camel/camel-store.h> -#include <e-gw-connection.h> -#include <libedataserverui/e-name-selector.h> - -#define _SHARE_FOLDER_TYPE (share_folder_get_type ()) -#define SHARE_FOLDER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), SHARE_FOLDER, ShareFolder)) -#define SHARE_FOLDER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), SHARE_FOLDER_TYPE, ShareFolder)) -#define IS_SHARE_FOLDER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), SHARE_FOLDER_TYPE)) -#define IS_SHARE_FOLDER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), SHARE_FOLDER_TYPE)) - -typedef struct _ShareFolder ShareFolder; -typedef struct _ShareFolderClass ShareFolderClass; - -struct _GtkWidget; -struct _GladeXML; -struct _GtkButton; -struct _GtkTreeView; -struct _GtkLabel; -struct _GtkEntry; -struct _GtkWindow; -struct _GtkRadioButton; -struct _GtkListStore; -struct _GtkCellRenderer; -struct _GtkTreeViewColumn; -struct _GtkFrame; -struct _GtkVBox; - -struct _ShareFolder { - GtkVBox parent_object; - - struct _GladeXML *xml; - - /* General tab */ - - /* Default Behavior */ - struct _GtkTreeView *user_list; - struct _GtkTextView *message; - struct _GtkButton *add_button; - struct _GtkButton *remove; - struct _GtkButton *add_book; - struct _GtkButton *notification; - struct _GtkEntry *name; - struct _GtkEntry *subject; - struct _GtkRadioButton *shared; - struct _GtkRadioButton *not_shared; - struct _GtkWidget *scrolled_window; - struct _GtkListStore *model; - struct _GtkCellRenderer *cell; - struct _GtkTreeViewColumn *column; - struct _GtkVBox *vbox; - struct _GtkVBox *table; - struct _GtkWidget *window; - - GList *users_list; - EGwContainer *gcontainer; - gint users; - gboolean byme; - gboolean tome; - gint flag_for_ok; - gchar *email; - gboolean is_shared; - EGwConnection *cnc; - gchar *container_id; - gchar *sub; - gchar *mesg; - GList *container_list; - GtkTreeIter iter; - ENameSelector *name_selector; - -}; - -struct _ShareFolderClass { - GtkVBoxClass parent_class; - -}; - -GType share_folderget_type (void); -struct _ShareFolder * share_folder_new (EGwConnection *ccnc, gchar *id); -void share_folder(struct _ShareFolder *sf); -gchar * get_container_id (EGwConnection *cnc, gchar *fname); -EGwConnection * get_cnc (CamelStore *store); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __EM_COMPOSER_PREFS_H__ */ |